NetBSD-Bugs archive

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

Re: lib/46781: statically compiled bash makes locale loading fail

The following reply was made to PR lib/46781; it has been noted by GNATS.

From: Martin Husemann <>
Subject: Re: lib/46781: statically compiled bash makes locale loading fail
Date: Wed, 8 Aug 2012 12:24:12 +0200

 I am not yet convinced this is a library bug. Bash replaces malloc() and
 free() with its own versions, and the _rune_read_file() functions fails
 somewhere, calling bash's version of free.
 This function then fails with an assertion:
 #1  0x000000000013d410 in programming_error (
     format=0x2c5df8 "free: start and end chunk sizes differ") at error.c:176
 #2  0x0000000000219494 in xbotch (mem=0x42c008, e=8, 
     s=0x2c5df8 "free: start and end chunk sizes differ", file=0x0, line=0)
     at malloc.c:319
 #3  0x000000000021a7bc in internal_free (mem=0x42c008, file=0x0, line=0, 
     flags=0) at malloc.c:902
 #4  0x000000000021b2f8 in free (mem=0x42c008) at malloc.c:1269
 #5  0x000000000027b284 in _rune_load ()
 This could be the rune code writing out of bounds somewhere - or a bug in
 the malloc/free implementation used in bash. For starters, it does not
 provide proper alignement for a general malloc on all archs:
 #define MALIGN_MASK     7       /* one less than desired alignment */
 so I have not a lot of trust in it. However, fixing that alignement issue,
 the local loading failure perrsists.
 Please someone check why _rune_read_file goes to err: at all, and wether
 anything has been overwritten.
 Why bash needs its own memory allocator at all is beyound me (maybe the
 pkg should completely avoid that?)

Home | Main Index | Thread Index | Old Index