This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: malloc patch for 2.2.4



Wolfram.Gloger@dent.med.uni-muenchen.de said:
> OK, for a bit more potential portability I'm presenting the patch
> below, although I couldn't find evidence that it actually makes a
> difference for gcc. 

I have a problem here that might be related to the malloc problem you are 
trying to fix.  The application I use is part of a rather large package 
distributed by the NCBI (National Center for Biotechnology Information, part 
of the NIH) used to do sequence similarity searches in databases of nucleotide 
or protein sequences.

I have compiled this package on several platforms (Solaris, HPUX, and Linux).
On HPUX and Solaris, it runs fine in single- and multi-threaded mode.

With older glibc releases (2.1.x) it runs fine in single- and multi-threaded
mode.

With current glibc releases, it runs fine in single-threaded mode, but gets a 
SegV in multi-threaded mode (the thread mode is selected by a run-time 
switch).  A typical back-trace looks like this:

$ gdb /usr/src/redhat/BUILD/ncbi/build/megablast core.30156
GNU gdb 5.0rh-5 Red Hat Linux 7.1
Copyright 2001 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-redhat-linux"...
Core was generated by `/usr/src/redhat/BUILD/ncbi/build/megablast -d est_hum-re est_hum-up -i chrom21_'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libpthread.so.0...done.
 
warning: Unable to set global thread event mask: generic error
[New Thread 1024 (LWP 30156)]
Error while reading shared library symbols:
Cannot enable thread event reporting for Thread 1024 (LWP 30156): generic error
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0  0x400d2740 in chunk_alloc () from /lib/libc.so.6
(gdb) where
#0  0x400d2740 in chunk_alloc () from /lib/libc.so.6
#1  0x400d3f79 in calloc () from /lib/libc.so.6
#2  0x08198c2b in s_MemAllocator (ptr=0x0, size=16, flags=4, allocator=eA_Calloc) at ncbimem.c:261
#3  0x08198e94 in Nlm_MemNew (size=16) at ncbimem.c:339
#4  0x08199901 in ValNodeNew (vnp=0x0) at ncbimisc.c:466
#5  0x080d291d in SeqEntryNew () at objsset.c:829
#6  0x080e66b5 in FastaToSeqEntryInternalExEx (input=0x82ca418, type=2, next_char=0x0, is_na=1 '\001', errormsg=0x0, parseSeqId=0 '\000',
    special_symbol=0x0, prefix=0xbffff520 "", ctrptr=0xbffff536, mask_ptr=0xbffff514, trustID=1 '\001') at tofasta.c:1932
#7  0x080e5c9c in FastaToSeqEntryForDb (fp=0x82ca418, is_na=1, errormsg=0x0, parseSeqId=0, prefix=0xbffff520 "", ctrptr=0xbffff536,
    mask_ptr=0xbffff514) at tofasta.c:1403
#8  0x0804b7aa in Nlm_Main () at megablast.c:1007
#9  0x081970ed in main (argc=15, argv=0xbffff5d4) at ncbimain.c:100
#10 0x40072733 in __libc_start_main () from /lib/libc.so.6

but sometimes the process dies while accessing an invalid pointer in one of 
the program's functions.

I have tried to compile with -fno-strict-aliasing.  I have tried to apply your 
malloc volatile patch.  Still, I get the same behaviour.

What can I do to help track this down ?

Regards,
					Christian



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]