|
From: Simon J. <ja...@ex...> - 2003-12-01 17:05:02
|
Nicholas Nethercote <nj...@ca...> writes: > On Mon, 1 Dec 2003, Simon Josefsson wrote: > >> Yes, I read FAQ #1, but I'm using the latest glibc (which glibc >> versions are considered too old/buggy in FAQ #1, btw?). But why >> doesn't the problem occur when I link with other libraries? The glibc >> is the same. I have been using valgrind extensively on other projects >> on this machine, so it must be some interaction between this >> particular library, valgrind and possibly the system. All libraries >> are built on the same machine, with the same compiler etc. > > I guess that libshishi allocates some memory upon startup (in its .init > section, even if it's not used at all), and then something goes wrong > later when it tries to deallocate it... which seems to be triggered by > __libc_freeres. I don't know anything beyond that. Thanks for the ideas, libshishi.so do define a '_init' symbol, but I didn't write it. So it probably is the default so initializer. Linking with all of the other libraries that libshishi depend on doesn't cause the same problem, so the problem probably isn't a _init from one of the other libraries either. Weird. I'll see if I can remove things from libshishi until the problem disappears. jas@latte:~$ gcc -g -o foo foo.c -lshishi jas@latte:~$ gdb ./foo GNU gdb 5.3-debian Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-linux"... (gdb) b _init Breakpoint 1 at 0x804836a (gdb) r Starting program: /home/jas/foo Breakpoint 1, 0x0804836a in _init () (gdb) disass Dump of assembler code for function _init: 0x8048364 <_init>: push %ebp 0x8048365 <_init+1>: mov %esp,%ebp 0x8048367 <_init+3>: sub $0x8,%esp 0x804836a <_init+6>: call 0x80483d4 <call_gmon_start> 0x804836f <_init+11>: call 0x8048440 <frame_dummy> 0x8048374 <_init+16>: call 0x8048560 <__do_global_ctors_aux> 0x8048379 <_init+21>: leave 0x804837a <_init+22>: ret End of assembler dump. (gdb) s Single stepping until exit from function _init, which has no line number information. 0x080484bb in __libc_csu_init () (gdb) disass Dump of assembler code for function __libc_csu_init: 0x80484a0 <__libc_csu_init>: push %ebp 0x80484a1 <__libc_csu_init+1>: mov %esp,%ebp 0x80484a3 <__libc_csu_init+3>: push %edi 0x80484a4 <__libc_csu_init+4>: push %esi ... |