|
From: Harry M. <hj...@ta...> - 2006-03-07 07:46:47
|
I have an odd bug - it's actually a non-bug. My vanilla C/terminal app runs fine when run under valgrind and also when compiled with the dmalloc memory debugging libs - it loses some memory but it's acceptable at this point. However, when recompiled without dmalloc and run normally under bash, it generates a segfault. Run thru ddd/gdb, I can tell where it's crashing but it's the oddest thing - I'm callocing what should be (and is, according to gdb) a pointer that has been explicitly set to 0x0 and it crashes. I don't even get a chance to check the returned pointer value. I get the awful: Program received signal SIGSEGV, Segmentation fault. 0xb7dc1523 in free () from /lib/tls/i686/cmov/libc.so.6 which seems a bit odd - I wasn't trying to free anything - I was trying to calloc it. Does a calloc() automatically attempt to free the pointer 1st? I found that the referenced /lib/tls.... libc.so.6 can sometimes interfere with free() just as I describe, but after disabling it, I get the same error message with the remaining /lib/libc.so.6 Has anyone else seen this bizarre behavior? hjm |