Bug 189587 - MALLOC_CHECK= doesn't like being empty
Summary: MALLOC_CHECK= doesn't like being empty
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 4
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-04-21 13:07 UTC by Nigel Horne
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-04-24 09:02:46 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Nigel Horne 2006-04-21 13:07:53 UTC
Description of problem:
Set malloc check to an empty string, and watch programs crash

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

How reproducible:
Every time

Steps to Reproduce:
1. export MALLOC_CHECK_=3
2. MALLOC_CHECK_= who
3.
  
Actual results:
[njh@njh Greater_London]$ MALLOC_CHECK_= who
malloc: using debugging hooks
Segmentation fault

Expected results:
[njh@njh Greater_London]$ MALLOC_CHECK_=3 who
malloc: using debugging hooks
njh      pts/0        Apr 21 13:53 (bandsman.co.uk)
[njh@njh Greater_London]$


Additional info:

Comment 1 Jakub Jelinek 2006-04-24 09:02:46 UTC
Oh, it hurts!  Don't do it then, MALLOC_CHECK_= is not documented to have any
meaning.
Anyway, I posted two alternative patches for upstream inclusion, certainly this
is not something that needs to be backported though.
http://sources.redhat.com/ml/libc-hacker/2006-04/msg00010.html

Comment 2 Nigel Horne 2006-04-24 09:09:24 UTC
MALLOC_CHECK_ is documented in "man malloc".

Responding with "well don't do it then" when someone reports a bug doesn't
inspire people to report more bugs.

Comment 3 Jakub Jelinek 2006-04-24 09:18:21 UTC
MALLOC_CHECK_ with empty string certainly is not documented, neither in man
malloc nor in info libc.
Passing clearly invalid values to functions/env vars/etc. is a user bug, unless
it has security consequences.  As MALLOC_CHECK_ is completely disregarded in
suid/sgid and other programs with escalated priviledges, this doesn't have
security consequences.


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