Bug 2015 - Segfault in setlocale() call makes programs unusable
Summary: Segfault in setlocale() call makes programs unusable
Status: RESOLVED INVALID
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.16
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-09 17:29 UTC by Daniel Richard G.
Modified: 2007-08-07 06:23 UTC (History)
1 user (show)

See Also:
Host: powerpc-ibm-aix4.3.3.0
Target: powerpc-ibm-aix4.3.3.0
Build: powerpc-ibm-aix4.3.3.0
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Richard G. 2005-12-09 17:29:22 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) 
(dbx) up 
setlocale(??, ??) at 0xd018e4f8 
(dbx) up 
main(argc = 2, argv = 0x2ff22aac), line 12137 in "readelf.c" 
(dbx) up 
__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.
Comment 1 Ben Elliston 2006-03-29 05:27:10 UTC
There appear to be various AIX patchsets that relate to setlocale.  Have you
tried applying those?
Comment 2 Daniel Richard G. 2006-04-07 22:36:35 UTC
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 
report: 
 
  1. Load up IBM's "Quick links for AIX fixes" site: 
     http://www.ibm.com/servers/eserver/support/unixservers/aixfixes.html 
 
  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 
Comment 3 Alan Modra 2007-08-07 06:23:47 UTC
Fix available, and not a binutils bug.