Shmat attaching the shm segment at address different than earlier

Hi,
I'm using 4 shared memory segments for storing data among 3 processes. The first segment contains the information about remaining 3 segments, where as 2nd segment is nothing but an array of pointers which point to the structures allocated out of other 2 segments.
Server process starts & creates the 3 segments first. If the 3rd segment gets completely finished, that process creates 4th data segment & stores the address of this new segment also in 1st segment.
Then I bring down this process - detaching all the 4 segments from it, but not doing IPC_RMID on them.
Later I started the same program assuming that I will be able to access the data from these shared memory segment.
But, I found that the address of 4th segment was not the same as that of first time when it was created a fresh. It got attached at different address. This caused SIGSEGV.
I'm using SHM_SHARE_MMU with all the calls I do to shmat().
How can I ensure that all the segments always get attached at same address during the second run of the process?
Please help.

You actually need to run it with "check -access"; memuse and leaks won't help with the crash, which happens because of illegal memory access. Hopefully, "check -access" will help you to locate the bad guy, but that's not panacea either.
To be precise:
- start dbx
$ dbx <your app>
- issue
(dbx) check -access
(dbx) run
and wait for dbx to stop and report suspicious memory access.

Similar Messages

  • I want to buy a macbook pro using my credit card, can i put a shipping address different than the billing address?

    i want to buy a macbook pro using my credit card, can i put a shipping address different than the billing address?

    Does the order form not have a billing address and a shipping address?

  • The code segment cannot be greater than or equal to 64K. - Windows 8

    Hello,
    I am having an issue on some windows 8 systems, a crash occurs in NtSetEvent, the exception thrown is "0x000000C8: The code segment cannot be greater than or equal to 64K.".
    This crash only occurs on Windows 8.
    The callstack doesn't help much
        KERNELBASE.dll!_RaiseException@16()    Unknown
        ntdll.dll!_NtSetEvent@8()    Unknown
        kernel32.dll!@BaseThreadInitThunk@12()    Unknown
        ntdll.dll!__RtlUserThreadStart()    Unknown
        ntdll.dll!__RtlUserThreadStart@8()    Unknown
    Could it be a bug within windows 8 ? If not what steps should I take to find the cause of this crash ?
    Thank you,
    Max

    I have a feeling like you have corrupted something.  Likely by stomping on memory due to a bug in your program such as a buffer overrun or use of a deleted object in C++.
    Although you may have incurred corruption to your registry through a variety of means, not limited to bad disk drives, or the unintentional write of bad data due to a bug in your program, if you are experiencing this on multiple systems, then registry corruption
    is less likely.  Which brings me back to the idea that you have a bug in your code that has trashed memory somehow.
    The stack traces and error codes do not indicate the cause of the problem.
    What does your program do??
    Without seeing at least some of the code, or knowing how big the scope of the code is, it's not useful for me to start guessing specifics of what may have happened.  But since you're not disclosing anything at all about your code apart from your exception,
    I'm forced to do some guesswork and just give general advice.
    Here are some easy classical strategies for locating the cause of the problem:
    Build your code in debug mode and run your code in the debugger.  (Yes, some people need to be told this.)
    Bisect the problem through revision control.  Back up to when the problem didn't happen and find the last revision that causes the problem.  (If you're not using a revision control system, start now.)
    Bisect the problem by eliminating chunks of code.  Trim out functionality until the problem goes away.
    Write unit tests.  Test the various pieces of your program to eliminate bugs.  At the very least, make use of assertions.
    Have a look at what your program is DOING when the crash happens.  Certainly there must be a cause.  Try to isolate the problem by associating it with a certain activity in your program.  Gate off functionality by introducing places where
    your program waits before proceeding.  At some point, you'll pass a point where the error can now occur.
    Run code analysis on your project and see if it comes up with any possible culprits.
    Don't ignore compiler warnings, they often indicate something that can turn into a bigger problem.  Compile at the highest warning level.
    Look at your usage of various API functions for logical mistakes.  Here are some examples:
    When using third party libraries or SDKs, have you initialized libraries appropriately?  Have you called all the appropriate initialization functions and used the APIs as intended?  Read documentation and make sure you are using calls appropriately.
    For functions that take a HANDLE, such as SetEvent, are you passing a valid handle?  Have you closed the handle but kept the old handle value around?
    When storing pointers to objects, have you accidentally deleted an object but kept its pointer around, only to make use of the pointer at a later time in your program?  This is particularly harmful when performing a write operation as you can corrupt
    just about anything.
    Are you using variables without giving them an initial value?  You may get unexpected values for variables if you do not initialize them.  This is particularly important for stack variables.
    When using arrays or string buffers, have you allocated enough storage for the bytes you are writing?  C++ doesn't detect reading or writing with an invalid array index as a problem.  It happily reads or writes past the end of your intended
    storage.  Such offences are called "buffer overruns".
    When multi-threading, are you taking steps to ensure data integrity?  Unsynchronized access to data from multiple threads is a notorious cause of strange and difficult to reproduce bugs.  Your data passes through states that you may not expect
    that can be observed by unsynchronized threads.  Use locking mechanisms appropriately and marshal your data diligently.
    Are you relying on valid input from an external source beyond your control such as a network client, database, or file?  Diligently validate all input that comes from an external source.  Be prepared for any situation that you can't control at
    compile time.
    Are you ignoring error codes?  Some functions may fail, but you may be assuming they have succeeded and then gone on to use invalid data.
    Look for mathematical errors.  Calculation of indices of arrays are a notorious culprit.  Beware of off by one errors.  Indices start at zero and go up to N-1, where N is the number of elements in the array.
    Beware of sentinel values.  Some functions such as "IndexOf" will return an index of -1 when not found and can result in a miscalculation of an actual index.
    Are you making use of
    RAII techniques in your code?  Failing to correctly allocate and deallocate resources can cause problems.
    Are you making use of unsafe casts?  C-Style casts say "I know what I'm doing", and you can get into dangerous situations.  Prefer static_cast<> over a C-Style cast wherever possible.
    Also look at your project settings for problems
    Have you accidentally mixed incompatible compiler settings between components?
    Approach debugging with an open mind.  Mark Twain said, "It ain't what you don't know that gets you into trouble. It's what you know for sure that just ain't so."

  • Why does ipad has the same ios like the Iphone4s ,it should be different than iphonewhy does ipad has the same ios like the Iphone4s ,it should be different than iphone

    why does ipad has the same ios like the Iphone4s ,it should be different than iphone

    Having one iOS that works across several platforms is one of the advantages of the iOS system. This allows developers to produce one software product instead of several and reduces development time and costs. This is a fundamental difference between iOS and Android operating systems where operating system varieties impede development.

  • HT201304 Can the restrictions pass code be different than the auto lock pass code?

    Can the restrictions pass code be different than the auto lock pass code. Defeats the purpose if a child can get into restrictions using the same code that is used to prevent unauthorized access to the phone itself.

    Dre73 wrote:
    Can the restrictions pass code be different than the auto lock pass code.
    Of course it can, for the reason you state.

  • Why are emails downloaded with the subject and from address different from what is actually in the email?

    The subject and from address listed in the message pane are totally different from what is in the actual email, viewed either in the preview pane or when the email is opened. The emails are correct when viewed online. For example:
    Email subject A from Sender A - email A
    Email subject B from Sender B - email B
    Email subject C from Sender C - email C
    After downloading to Thunderbird:
    Email subject A from Sender A - email A
    Email subject B from Sender B - email B
    Email subject C from Sender C - email A *** Subject and Sender for C but is actually email A
    This started happening within the past month and appears to be random. Sometimes everything is correct. But more often there are a few that exhibit the above behavior. I have multiple email address downloading from the same domain but this problem seems to occur ostly with my main email account.

    Try to rebuild the index file of the troubled folder.
    Right-click the folder - Properties - Repair Folder

  • Is the iPad iTunes app quite different than the regular PC

    I'm new to iPad. I went to check out iTunes app on iPad, and it is so limited what you can do. Very different than regular PC. Is there something I am missing?

    It depends on what you want to see/manage - you can tap on your id at at the bottom of, for example, the Music tab in the iTunes app (or via Settings > iTunes & App Stores) and you can view/manage your id, address and payment info.

  • The image in iPhoto is different than the photo

    when I select an image in iphoto the picture I click on is different than the one I chose

    Back up your iPhoto library, Depress and hold the option (alt) and command keys and launch iPhoto - rebuild your thumbnails - it may take a few attempts
    LN

  • Yosemite Mail Sets IMAP Flags differently than earlier Mail Versions

    Since converting to Yosemite, our junk mail filtering system (a copy of Thunderbird running 24/7 on our Linux server) has not worked.   We get over 1,000 pieces of Spam per day and use this setup to screen the junk before reading on our iPhones.
    After hours of debugging I discovered that when Yosemite Mail initially downloads a message from the IMAP server (we use HostGator), Yosemite Mail sets the IMAP Flags on the server to be NonJunk    $NotJunk    NotJunk 
    Yosemite Mail does this before any message is viewed.
    This is very different than Mavericks and earlier versions of Mail.  In those earlier versions, no IMAP server Flags were set when a message was downloaded.  The same is for the current version of iOS on my iPhone; no IMAP server Flags are set.
    The problem is that the three versions a "Not Junk" flag set by Yosemite Mail are confusing Thunderbird and probably other Mail clients.
    Does anyone know a way to stop to Yosemite Mail from setting these flags?   I filled a bug report with Apple, but am not optimistic...

    Back up all data before proceeding.
    1. Triple-click anywhere in the line below on this page to select it:  
    ~/Library/Mail/Bundles
    Right-click or control-click the highlighted line and select
              Services ▹ Open
    from the contextual menu.* A folder may open, or you may get an error message that the item can't be found. Either result is normal. If the folder does open and has contents, move the contents to the Desktop. Relaunch Mail and test. If there's no change, put the contents of the folder back and quit Mail again.
    2. Repeat with this line:
    /Library/Mail/Bundles
    This time you may be prompted for your administrator login password when you remove the items. Make sure they're removed from the folder and not just copied to the Desktop. If necessary, copy them first and then move the originals to the Trash.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination  command-C. In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

  • Need to have a reply-to address different than my Gmail account.

    I use gmail to send and receive my business email. When I send mail the recipient sees it as coming from [email protected] not gmail. On the mac this is fine as the "Email Address" is different to the username used to login to the Gmail IMAP account.
    On the iphone the address is the account login info and when I send a message it shows as coming from [email protected]
    Is there an app out there paid or free that can add this functionality I need. Apple could add this functionality easily by adding a reply-to field to the settings for the account or having the

    ericafromnewlondon wrote:
    Trying to setup airport express in a new office - do I need to have a static IP address?
    No.
    how do I find out what my DSN Server is, and DHCP client ID is?
    The DNS Server settings are normally provided by whatever router is "upstream" from the AirPort Express, presuming that the Express is configure to use DHCP.  What is the "upstream" device?  Will the AirPort Express connect to it wirelessly or by Ethernet?

  • Why is browser ip address different than network ip address?

    Trying to use remote access from home to my server computer at work (small salon running a management software called STX Salon Transcripts) and used to look for my server ip address using what's my ip.com, which gives me an ip that hasn't been working--now I find an ip in my network settings that's completely different...   Server computer is plugged into the internet directly to the modem...

    Not enough information.
    Was this ever working for you?
    Does the service provider at work claim to provide a static IP address?
    Are you accessing what's my ip.com from the server at work?
    Is either of the addresses involved in the ranges that RFC1918 defined as private (10.0.0.0 - 10.255.255.255, 172.16.0.0 - 172.31.255.255, or 192.168.0.0 - 192.168.255.255)?
    Is either of the addresses involved in the range that IANA reserves for carrier-grade NAT (100.64.0.0 - 100.95.255.255)?

  • Why would the browser preview display look different than what I am seeing in the design view? Pls help!

    When working with accordion panels, when I first insert the widget it looks fine, then I begin customizing the content and then the Preview display does not look the same as the Design display. For instance, in the design display the panel aligns with the adjacent image, but in Preview, it appears offset by one or two pixels.

    Hi,
    Please take a look at this post with similar discussion : Re: What I see in Design mode is not the same in Preview mode. ?
    Regards,
    Aish

  • Why does the Harvey Balls font print differently than it displays in Acrobat?

    I used the Harvey Balls font (harvey_balls.ttf) to populate a table in a PowerPoint 2007 document. I saved the document as a PDF using the Save As - Adobe PDF function in PowerPoint. When the document displays on my screen, it looks normal. Please see below an example of two 4-balls on the left and two 3-balls on the right.
    However, when I print it from Acrobat, the solid black circles that represent "4" in the Harvey Ball font print out with a white cutout in the upper left quadrant of each. Please see below, an example of the same two 4-balls on the left and two 3-balls on the right.
    How can I get this to print properly?

    Hi Tara ,
    Please refer to the following links and see how it goes .
    https://helpx.adobe.com/acrobat/using/advanced-pdf-print-settings.html
    http://docs.oracle.com/cd/E19728-01/820-2550/printing_pdffonts.html
    Regards
    Sukrit Dhingra

  • Iphone 3gs problem during sync: what is actually on the phone after sync is different than what shows is on the phone in iTunes

    What I synced my iPhone 3G S, it lost much of the music and podcasts (but not all). In iTunes on my Windows machine it shows that the phone has everything that it had on it before plus the new podcasts, playlist, and music I had tried to move to it. But, what is REALLY on the phone (i.e. that which I can access through playlists and my music/podcasts) is much less - with most of it missing. Additionally, for the new playlists I added, the playlist titles were added, but when I go to play them on my iPhone the playlist if totally empty, even when I access the iPhone's playlist when the iPhone is plugged in via iTunes it shows all the songs on the playlist. I've tried to reset the sync history, but that doesn't help. Has anyone else experienced this problem?  I'm hoping there is a solution other than resetting to factory settings.

    previous posts cover this in depth but 1 thing I haven't seen in the possible solutions Is the location of your music folder.
    I keep my music on a portable hard drive but after the upgrade my "iTunes media folder location" had defaulted to the c:/ drive
    select the actual music folder location and let your library update e- you can then sync !

  • Is the password for Migration assistant different than the apple ID password?

    When I attempt to use the migration assistant using the Apple ID usename and password doesn't work.  What other password do I need?

    If you are transferring material from a PC to a new Mac, see:How to transfer data from a PC to a Mac - Apple Support for Migration Assistant help.

Maybe you are looking for