This is the mail archive of the libc-hacker@sourceware.org mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Prevent people shooting themselves in the foot with MALLOC_CHECK_=


Hi!

If malloc.c didn't try to special case MALLOC_CHECK_= (empty string in
the env var), I'd say why bother, but as it does, it probably doesn't
hurt to handle it gracefully.

ATM apps segfault, because in that case mallopt (M_CHECK_ACTION, something)
is not called, but __malloc_check_init is.  But in that case
malloc_consolidate has not been called and we die later on.

I'm attaching 2 patches, one which handles MALLOC_CHECK_= as if
MALLOC_CHECK_=3 was given (3 stands for DEFAULT_CHECK_ACTION here),
the other ignores MALLOC_CHECK_ var completely if it contains an empty
string.

	Jakub

Attachment: X
Description: Text document

Attachment: Y
Description: Text document


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