Professional Web Applications Themes

Why does this kick out an "Unmapped memory exception"??? - Mac Programming

From my Globals.h file (Which IS #included properly): typedef struct AddrCacheListEntry { char Address[255]; InetAddress ResolvedAddress; InetPort Port; char URL[255]; Boolean Used; Boolean SuccessfullyContacted; Boolean DeleteFromList; unsigned long Timestamp; } AddrCachelistEntry; typedef AddrCacheListEntry *AddrCacheListEntryPtr; The offending code snippet: case 'u': case 'U': { // If ResponseLine starts with a 'u' or 'U', we need to allocate space for a AddrCacheListEntry. AddrCacheListEntryPtr Temp; Temp = (AddrCacheListEntryPtr)NewPtrClear(sizeof(AddrCach eListEntry)); (Arg... non-overridable auto-wrapping sux sometimes...) The app has way more than plenty of memory allocated to it to run in (for dev purposes, I've assigned it a 16MB minimum/preferred size, with plans to "tune" ...

  1. #1

    Default Why does this kick out an "Unmapped memory exception"???

    From my Globals.h file (Which IS #included properly):

    typedef struct AddrCacheListEntry
    {
    char Address[255];
    InetAddress ResolvedAddress;
    InetPort Port;
    char URL[255];
    Boolean Used;
    Boolean SuccessfullyContacted;
    Boolean DeleteFromList;
    unsigned long Timestamp;
    } AddrCachelistEntry;

    typedef AddrCacheListEntry *AddrCacheListEntryPtr;

    The offending code snippet:
    case 'u': case 'U':
    {
    // If ResponseLine starts with a 'u' or 'U', we need to
    allocate space for a AddrCacheListEntry.
    AddrCacheListEntryPtr Temp;

    Temp =
    (AddrCacheListEntryPtr)NewPtrClear(sizeof(AddrCach eListEntry));

    (Arg... non-overridable auto-wrapping sux sometimes...)

    The app has way more than plenty of memory allocated to it to run in
    (for dev purposes, I've assigned it a 16MB minimum/preferred size, with
    plans to "tune" that once things get to the point where tuning is worth
    trying to do) and isn't using much of it at all (Less than 2 megs,
    according to "About this computer") while running.

    Same error whether running in the debugger, or "standalone", so I would
    presume that means that the problem isn't an artifact of the debugging
    environment, but an actual problem in my code.

    If it makes a difference, I'm targeting Carbon on 9.2

    Anybody got any insights? This failure isn't making any sense, and a
    dialog box that says "Unmapped memory exception" and offers an "OK"
    button isn't too helpful as a diagnostic.

    --
    Don Bruder - net - New Email policy in effect as of Feb. 21, 2004.
    I respond to Email as quick as humanly possible. If you Email me and get no
    response, see <http://www.sonic.net/~dakidd/main/contact.html> Short
    form: I'm trashing EVERYTHING that doesn't contain a password in the subject.
    Don Guest

  2. #2

    Default Re: Why does this kick out an "Unmapped memory exception"???

    In article <A2Xoc.11141$sonic.net>,
    Don Bruder <net> wrote:
     

    If this call crashes your system, you very probably trashed our heap in
    some way before this call. To verify that, set a breakpoint on the above
    call, drop into MacsBug, and type 'hc' (Heap Check)

    Reinder
    Reinder Guest

  3. #3

    Default Re: Why does this kick out an "Unmapped memory exception"???

    In article <wxs.nl>,
    Reinder Verlinde <invalid> wrote:
     
    >
    > If this call crashes your system, you very probably trashed our heap in
    > some way before this call. To verify that, set a breakpoint on the above
    > call, drop into MacsBug, and type 'hc' (Heap Check)
    >
    > Reinder[/ref]

    Hokay... Let's see what happens...

    Ugh... Before the call executes, NMI-ing into MacsBug and issuing the HC
    command responds immediately with:

    The heap at 1CD54800 is bad
    Zone pointer, bkLim, or length of trailer block is bad


    Guess I gotta go looking for where it gets whacked. One stdlog, coming
    to a screen near me in moments...

    This ought to be fun... Call by call, backtracking to where I went
    wrong...

    --
    Don Bruder - net - New Email policy in effect as of Feb. 21, 2004.
    I respond to Email as quick as humanly possible. If you Email me and get no
    response, see <http://www.sonic.net/~dakidd/main/contact.html> Short
    form: I'm trashing EVERYTHING that doesn't contain a password in the subject.
    Don Guest

  4. #4

    Default Re: Why does this kick out an "Unmapped memory exception"???

    In article <2CYoc.11165$sonic.net>,
    Don Bruder <net> wrote:
     

    Bingo... Some pre-prcessing (WAY pre-processing... About 6 routines back
    in the chain of things that happen to the string) had a slight lack of
    re-zeroing before a pointer got reused, leading it to go wandering off
    the end of its list and leave tracks in places there shouldn't ought to
    be tracks. It stomped the heap real proper-like.

    Interestingly, now that I've spotted/swatted that bug, it looks to be
    operational. I wonder why... <rolls eyes>

    On to the next... :)

    Thanks Reinder!

    --
    Don Bruder - net - New Email policy in effect as of Feb. 21, 2004.
    I respond to Email as quick as humanly possible. If you Email me and get no
    response, see <http://www.sonic.net/~dakidd/main/contact.html> Short
    form: I'm trashing EVERYTHING that doesn't contain a password in the subject.
    Don Guest

Similar Threads

  1. Replies: 3
    Last Post: August 8th, 02:36 AM
  2. error message of 0x4e9468dd referenced memory at 0xffffffff8. the memory could not be "read"
    By Claudia_Hunt@adobeforums.com in forum Adobe Indesign Windows
    Replies: 1
    Last Post: May 14th, 04:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139