Sourceware Bugzilla – Bug 2015
Segfault in setlocale() call makes programs unusable
Last modified: 2007-08-07 06:23:47 UTC
Building on AIX 4.3. Programs segfault instantly, even with --help. Debugger
shows a crash inside setlocale():
user@host:~/tmp/binutils-2.16.1> dbx /tmp/BINUTILS/bin/readelf
Type 'help' for help.
reading symbolic information ...
(dbx) run --help
Segmentation fault in _ptrgl at 0xd016ff90
0xd016ff90 (_ptrgl) 800b0000 lwz r0,0x0(r11)
setlocale(??, ??) at 0xd018e4f8
main(argc = 2, argv = 0x2ff22aac), line 12137 in "readelf.c"
__start() at 0x100001d8
Recompiled with --disable-nls; no improvement. Commented out the "#define
HAVE_SETLOCALE 1" line in each config.h file; programs run normally.
Unless there is a problem with how setlocale() is being invoked, it would
appear that this system library routine is broken on AIX 4.3.
There appear to be various AIX patchsets that relate to setlocale. Have you
tried applying those?
The patchsets do make the problem go away. Another workaround, sans patches, is
to set LANG=C (default value is "en_US" on my system).
Information on obtaining the patchsets, for anyone reading this [archived] bug
1. Load up IBM's "Quick links for AIX fixes" site:
2. Go to "Specific Fixes" for AIX 4.3
3. Search by APAR number: IY45774
("CORE DUMP IN SETLOCALE WHEN CALLED AFTER PROCE")
4. Download the .bff files, and install with smitty
Fix available, and not a binutils bug.