EHLO!
What can cause a segmentation fault? Things, which I'm aware of, are
checked, and they are
-incorrect malloc/realloc/free operations
-bad hardware
-a bug in libc
To make clear of what I'm talking about:
I wrote a program (info viewer -- pinfo), and in two functions I get
segmentation faults. I've checked it on few machines, running
different operating systems, and the result was always the same.
I also run the program compiled with -lefence, and after that I also
tried with -lccmalloc. The result was that the segmentation faults
didn't occur at all.
I've also created wrappers for malloc/realloc/free, which logged what
they werre doing. And nothing. The program sigsegv'ed on realloc() when
reallocating block of (re)allocated previously memory (of certain size).
Gdb said that all those faults came from libc_free...
So? I'm really confused, I think I'll become grey because of this ;)
And on my side, I'll take a closer look at the free() sources...
--
____\___\___
(_(\|,|_|,|_ Gassho! [http://dione.ids.pl/~pborys][mr MUA home]
| | |. [teksty o zen,programowaniu,moje sf,xfaq_pl, inne]