[rganesan@myrealbox.com] libc/1632: towupper() segfaults after call to set locale

Andreas Jaeger aj@suse.de
Tue Mar 7 08:42:00 GMT 2000


>>>>> H J Lu writes:

HJ> On Tue, Mar 07, 2000 at 04:41:12PM +0100, Andreas Jaeger wrote:
>> 
>> Hi glibc folks,
>> 
>> We've received the appended bug report.  I can reproduce the problem
>> after clearing my environment from LANG and LC_ALL.
>> 
>> Here's an output from gdb:
>> 
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x400c3ff5 in towupper (wc=65) at wcfuncs.c:97
>> 97        return (wint_t) __ctype32_toupper[idx];
>> (gdb) p __ctype32_toupper 
>> $1 = (__int32_t *) 0x0
>> 
>> Btw. towlower works fine.
>> 

HJ> It is a typo. Here is a patch. We should check all the locale
HJ> initializations for things like that.

I'll do that now.

HJ> H.J.
HJ> ---
HJ> 2000-03-07  H.J. Lu  <hjl@gnu.org>

HJ> 	* locale/C-ctype.c (_nl_C_LC_CTYPE): Fix the initializer order
HJ> 	for _NL_CTYPE_TOXXXER32_EX.

Thanks.  The patch is obviously correct and does fix the problem.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.rhein-neckar.de


More information about the Libc-alpha mailing list