[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE:C programming: Segmentation fault within malloc?



Shaul Karl writes:
 > Obviously I am missing something.

Since it's fairly unlikely that malloc is wrong, then you've got
something like memory being freed twice, or accessing freed memory or
something along those lines.  It only happens to show up when you do
the malloc.

A quick check would be to use a garbage collector for C:

  http://www.hpl.hp.com/personal/Hans_Boehm/gc/

or Electric Fence:

  http://www.perens.com/FreeSoftware/

or Debauch:

  http://quorum.tamu.edu/jon/gnu/

Debauch and Electric Fence are in Debian testing, too.

Andrew.



Reply to: