Strange problems in the old libc malloc routines

Andrew Duane aduane at juniper.net
Wed Feb 2 18:31:36 UTC 2011


We are still using the FreeBSD 6 malloc routines, and are rather suddenly having a large number of problems with one or two of our programs. Before I dig into the 100+ crash dumps I have, I thought I'd see if anyone else has ever encountered this.

The problems all seem to stem from some case of malloc returning the pointer "1" instead of either NULL or a valid pointer. Always exactly "1". Where this goes bad depends on where it happens (in the program or inside malloc itself), but that pointer value of "1" is always involved. Some of the structures like page_dir look corrupted too. It seems as if maybe the "1" is coming from sbrk(0) which is just returning the value of curbrk (which is correct, and not even close to "1"). 

Does this ring any bells?

--
Andrew Duane             Juniper Networks
978-589-0551              10 Technology Park Dr
aduane at juniper.net      Westford, MA  01886-3418


More information about the freebsd-hackers mailing list