CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2005
    Posts
    112

    C memory segmentation fault

    Hi,

    Im getting the following segmentation fault from some C code on x86
    Code:
    (gdb) bt full
    #0  0xfeb3487a in _malloc_unlocked () from /usr/lib/libc.so.1
    No symbol table info available.
    #1  0xfeb34704 in malloc () from /usr/lib/libc.so.1
    No symbol table info available.

    If I can rule out something wrong in the stack, then since this seg fault
    happens in memory management , then maybe its the heap that at fault.

    RESOLVED: it did turn out to be heap related.
    Last edited by Moore; June 23rd, 2011 at 03:35 AM. Reason: removing unecessary detail and marked as resolved.

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: C memory segmentation fault

    The first thing to check is that you aren't running out of memory. A glance at top should show you the current memory usage. Is this a 32-bit or a 64-bit system?

  3. #3
    Join Date
    May 2005
    Posts
    112

    Re: C memory segmentation fault

    Hello,
    Thanks for reply.
    This is 32 bit binary.
    No problem with memory availability.
    I have seen the process dump core with core size well less that 1G (which is significantly smaller than max ~4G process address space.).
    Have not seen the process grow greater than 600M before core.

  4. #4
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: C memory segmentation fault

    Indeed that does not seem to be the problem, then. In practice, a 32-bit process will run into memory trouble only once it is using 1.5-2GB on Windows systems, and perhaps a bit more on Linux.

  5. #5
    Join Date
    May 2005
    Posts
    112

    Re: C memory segmentation fault

    topic resolved.
    Last edited by Moore; June 23rd, 2011 at 05:12 PM. Reason: topic resolved.

Tags for this Thread

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured