Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Jan 2004 13:15:42 +0100
From:      "Willem Jan Withagen" <wjw@withagen.nl>
To:        <questions@freebsd.iae.nl>, <current@FreeBSD.ORG>
Subject:   Strange calloc problem
Message-ID:  <029c01c3d12a$2488c2c0$471b3dd4@dual>

next in thread | raw e-mail | index | archive | help

I'm running this compiler which is rather heap intensive and it crashed with
a SigFault
in calloc/malloc (I've tied both, but as expected calloc calls malloc)
What suggestions are there further to track this down to the real problem.

Giving that calloc/malloc should at least print something if it understands
the error
I expect heap corruption.
No flags set in /etc/malloc.conf

--WjW

Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libc.so.5...done.
Loaded symbols for /lib/libc.so.5
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x281e1f53 in memset () from /lib/libc.so.5
(gdb) bt
#0  0x281e1f53 in memset () from /lib/libc.so.5
#1  0x00000110 in ?? ()
#2  0x281e0ea4 in tcflow () from /lib/libc.so.5
#3  0x281e1286 in malloc () from /lib/libc.so.5
#4  0x281dda91 in calloc () from /lib/libc.so.5
#5  0x0804d4ab in ast2beg_StdProc (o=0x812a460, t=0x8148de4) at
std2beg.c:253
#6  0x0804a333 in ast2beg (t=0x8148e78) at ast2beg.c:766
#7  0x08049b49 in ast2beg (t=0x814a7f0) at ast2beg.c:502
#8  0x080496e6 in ast2beg (t=0x814b098) at ast2beg.c:351
#9  0x080491d1 in main (argc=4, argv=0xbfbfeaf8) at pas.c:109
#10 0x08048e42 in _start ()
(gdb) frame 4
#4  0x281dda91 in calloc () from /lib/libc.so.5
(gdb) up
#5  0x0804d4ab in ast2beg_StdProc (o=0x812a460, t=0x8148de4) at
std2beg.c:253
253                   char *fname = calloc(1,flen+1);
(gdb) p flen
$1 = 13



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?029c01c3d12a$2488c2c0$471b3dd4>