bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

malloc in glibc 2.3.1


From: Eugeni Dodonov
Subject: malloc in glibc 2.3.1
Date: Mon, 18 Nov 2002 08:53:50 -0200
User-agent: Mutt/1.4i

Hello.

I recently upgraded my system from slackware 8.1 to slackware-current,
and some of my programs suddenly stopped working (in fact, it was my
master degree thesis implementation :-). Using GDB, I found out that
the problem is in malloc() call.

The slackware-current has upgraded gcc from 2.95.3 to 3.2 and glibc from
2.2.5 to 2.3.1. First of all, I suspected that the bug was with the gcc
version; however, a test program I compiled (just to test the malloc()
functionality with several buffer sizes) compiled and worked just fine.

I downloaded the dmalloc package and linked my project with it. It worked
just fine, so I suspect that the problem is with the glibc's malloc
implementation.

The problem that this bug only appears in several places inside my
project, so I cannot clearly send a proof-of-concept code (yet? :-). The
information of my system follows next.

I am not very familiar with the debugging tools, so I send all the data
I've collected. If you need some other information please inform me.

---
Output of glibcbug:
-------------------

Host type: i386-slackware-linux-gnu
System: Linux loki 2.4.19 #1 Sun Aug 18 13:24:13 PDT 2002 i686 unknown
Architecture: i686

Addons: linuxthreads
Build CFLAGS: -O2 -g -march=i386 -mcpu=i686
Build CC: gcc
Compiler version: 3.2
Kernel headers: 2.4.19
Symbol versioning: yes
Build static: yes
Build shared: yes
Build pic-default: no
Build profile: yes
Build omitfp: no
Build bounded: no
Build static-nss: no


---
Output of gdb:
--------------
xxgdb ./test
XXGDB comes with ABSOLUTELY NO WARRANTY.
GNU gdb 5.2.1
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-slackware-linux"...
(xxgdb) No default source file yet.  Do "help list".
run
[New Thread 16384 (LWP 23528)]
[New Thread 32769 (LWP 23529)]
[New Thread 16386 (LWP 23530)]
[New Thread 32771 (LWP 23531)]
[New Thread 49156 (LWP 23532)]
---> Indo para posicao 0 do arquivo
---> Lendo 32767 bytes

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 23528)]
0x400eb847 in _int_malloc () from /lib/libc.so.6
(xxgdb) bt
#0  0x400eb847 in _int_malloc () from /lib/libc.so.6
#1  0x400ea715 in malloc () from /lib/libc.so.6
#2  0x0805431d in cache_read (fd=7, buf=0xbffdf670 "", count=1075458608) at 
cache.c:139
#3  0x08053e5d in main ()
#4  0x4008ab34 in __libc_start_main () from /lib/libc.so.6
(xxgdb) 


---
Offending code:
---------------
(cache.c:139) buffer = (char *)malloc(sizeof(char)*count);

---
The program was compiled with -O3 -g flags; however, the same bug remains
even if compiled without any -O flags.

I guess that's it. If you have any suggestion on tracking this bug or any
further questions regarting this problem, please do not hesitate to contact
me.

-- 
[]'s,
Eugeni Dodonov
"All things are possible, except skiing thru a revolving door."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]