Bug 68499

Summary: glibc-2.2.90-14 MALLOC_CHECK_=1 is broken
Product: [Retired] Red Hat Public Beta Reporter: Jonathan Kamens <jik>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: limboCC: fweimer
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-07-10 18:36:20 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 67217    
Attachments:
Description Flags
program to illustrate MALLOC_CHECK_ bug none

Description Jonathan Kamens 2002-07-10 14:28:54 EDT
I have glibc-2.2.90-14.i686.rpm.  I compile the attached program, set the
MALLOC_CHECK_ environment variable to 0, and then run it, and I get this ouput:

jik:/tmp!75> ./a.out
malloc: using debugging hooks
ptr=0x0, new_ptr=0x80495d0, i=4000
ptr=0x80495d0, new_ptr=0x80495d0, i=8000
ptr=0x80495d0, new_ptr=0x80495d0, i=16000
ptr=0x80495d0, new_ptr=0x80495d0, i=32000
ptr=0x80495d0, new_ptr=0x80495d0, i=64000
ptr=0x80495d0, new_ptr=0x80495d0, i=128000
ptr=0x80495d0, new_ptr=0x40023008, i=256000
ptr=0x40023008, new_ptr=0x0, i=512000

Without MALLOC_CHECK_ set, I get this:

jik:/tmp!77> ./a.out
ptr=0x0, new_ptr=0x80495d0, i=4000
ptr=0x80495d0, new_ptr=0x80495d0, i=8000
ptr=0x80495d0, new_ptr=0x80495d0, i=16000
ptr=0x80495d0, new_ptr=0x80495d0, i=32000
ptr=0x80495d0, new_ptr=0x80495d0, i=64000
ptr=0x80495d0, new_ptr=0x80495d0, i=128000
ptr=0x80495d0, new_ptr=0x40023008, i=256000
ptr=0x40023008, new_ptr=0x40023008, i=512000
ptr=0x40023008, new_ptr=0x40023008, i=1024000
ptr=0x40023008, new_ptr=0x40023008, i=2048000
ptr=0x40023008, new_ptr=0x40023008, i=4096000
ptr=0x40023008, new_ptr=0x40023008, i=8192000
ptr=0x40023008, new_ptr=0x40023008, i=16384000
ptr=0x40023008, new_ptr=0x40023008, i=32768000
ptr=0x40023008, new_ptr=0x42119008, i=65536000
ptr=0x42119008, new_ptr=0x42119008, i=131072000
ptr=0x42119008, new_ptr=0x42119008, i=262144000
ptr=0x42119008, new_ptr=0x42119008, i=524288000
ptr=0x42119008, new_ptr=0x0, i=1048576000

The latter is correct.

I'm not sure it's OK to ship the next release with MALLOC_CHECK_ broken like
this.  It is significant glibc functionality.
Comment 1 Jonathan Kamens 2002-07-10 14:36:37 EDT
Created attachment 64626 [details]
program to illustrate MALLOC_CHECK_ bug
Comment 2 Jakub Jelinek 2002-07-24 11:17:35 EDT
Fixed in glibc-2.2.90-15.