Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 80370 - malloc segfaults if clearenv() has been called
Summary: malloc segfaults if clearenv() has been called
Alias: None
Product: Red Hat Public Beta
Classification: Retired
Component: glibc
Version: phoebe
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
Depends On:
TreeView+ depends on / blocked
Reported: 2002-12-25 05:25 UTC by Chaskiel Grundman
Modified: 2016-11-24 15:03 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-01-07 11:22:19 UTC

Attachments (Terms of Use)

Description Chaskiel Grundman 2002-12-25 05:25:49 UTC
Description of problem:
malloc segfaults if an application calls clearenv() before the first malloc()

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Compile the following test program:
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv) {

        void *x;
        printf("we didn't die\n");
2. Run it.
Actual results:
Program received signal SIGSEGV, Segmentation fault.
0x420764f6 in ptmalloc_init () from /lib/i686/
(gdb) where
#0  0x420764f6 in ptmalloc_init () from /lib/i686/
#1  0x42076305 in malloc_hook_ini () from /lib/i686/
#2  0x420730f5 in malloc () from /lib/i686/
#3  0x080483c9 in main ()
#4  0x420158d4 in __libc_start_main () from /lib/i686/

Comment 1 Aleksey Nogin 2003-01-07 07:23:26 UTC
Still happening in Phoebe (glibc-2.3.1-21):

(gdb) bt
#0  0x42072d52 in posix_memalign () from /lib/i686/
#1  0x42072bd5 in posix_memalign () from /lib/i686/
#2  0x42070205 in malloc () from /lib/i686/
#3  0x080483b3 in main ()
#4  0x42015970 in __libc_start_main () from /lib/i686/

P.S. Possibly related - bug 81259 (a different crash in malloc)

Comment 2 Jakub Jelinek 2003-01-07 11:22:19 UTC
glibc-2.3.1-21 is way too old, please upgrade.
This particular bug is fixed since 2.3.1-23 (ATM we're at 2.3.1-32).

Comment 3 Aleksey Nogin 2003-01-07 11:34:12 UTC
Any chances of a new glibc being available on up2date?

Note You need to log in before you can comment on or make changes to this bug.