C
Chris
A general question here, what causes segmentation faults in malloc?
Shouldn't malloc always gracefully fail? Take a look at the gdb core
stack trace (from an HP-UX 11.11)
Program terminated with signal 11, Segmentation fault.
#0 0xc01961c8 in mallinfo+0x718 () from /usr/lib/libc.2
(gdb) where
#0 0xc01961c8 in mallinfo+0x718 () from /usr/lib/libc.2
#1 0xc0198690 in _sbrk+0x580 () from /usr/lib/libc.2
#2 0xc0196bb4 in _sigfillset+0x7a4 () from /usr/lib/libc.2
#3 0xc0194774 in _sscanf+0x54c () from /usr/lib/libc.2
#4 0xc0199944 in malloc+0x18c () from /usr/lib/libc.2
Has anybody seen this before? Obviously I'm doing something wrong, but
I'm not doing any free()ing.
Thanks in advance,
~Chris
Shouldn't malloc always gracefully fail? Take a look at the gdb core
stack trace (from an HP-UX 11.11)
Program terminated with signal 11, Segmentation fault.
#0 0xc01961c8 in mallinfo+0x718 () from /usr/lib/libc.2
(gdb) where
#0 0xc01961c8 in mallinfo+0x718 () from /usr/lib/libc.2
#1 0xc0198690 in _sbrk+0x580 () from /usr/lib/libc.2
#2 0xc0196bb4 in _sigfillset+0x7a4 () from /usr/lib/libc.2
#3 0xc0194774 in _sscanf+0x54c () from /usr/lib/libc.2
#4 0xc0199944 in malloc+0x18c () from /usr/lib/libc.2
Has anybody seen this before? Obviously I'm doing something wrong, but
I'm not doing any free()ing.
Thanks in advance,
~Chris