This is the mail archive of the glibc-bugs@sources.redhat.com mailing list for the glibc project.


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

[Bug libc/356] New: localedata: tests-mbwc/tst_iswalnum segfaults during make check


I am running on linux kernel 2.6.7 on an i686 (pentium III).
gcc version 3.4.1
binutils assembler 2.15
downloaded glibc 2.3.3, applied two fixes as documented in
     msg00179.html    (conflicting types for 'fixup' and profile_fixup')
     msg00013.html    (initfini.c)
after which build ok but make check - segfault in tst_iswalnum.

The segfault occurs in wcfuncs.c func __iswalnum here
        return wctype_table_lookup (desc, wc);		
desc is supposed to be a ptr to a const string but contains 0x10.

On some more investigating, I think I see (maybe) why:
in loadlocale.c func _nl_intern_locale_data() line 118
      if (__builtin_expect (_nl_value_types[category][cnt] == word, 0))
In the failing case, category is 0 (LC_CTYPE) and cnt (index) is 82
However the size of the _nl_value_types[LC_CTYPE] array is only 65.
So the above line is accessing outrside the bounds of the array and may be 
therefore incorrectly assigning the value of the word instead of the pointer to
the string.
The size of the _nl_value_types[LC_CTYPE] array is determined by 
   categories.def
whereas the size of the max number of values of LC_CTYPE is determined in
_NL_NUM_LC_CTYPE, which has a bigger and different list than categories.def

I see the comment /* The actual definition of ctype is meaningless here.*/
in categories.def and I see some tricky run-time resolution of these externs in 
localeinfo.h :
   it is desireable to avoid always linking in the code
   and data for every category when we can tell at link time that they are
   unused.  We can manage this playing some tricks with weak references.
so maybe I am completely misunderstanding these type and value arrays
(and gdb can't understand any of it either)
but it does crash so please can you help.

P.S.  I did not try building from cvs since I don't have room for hoth 2.3.3 and
cvs and want to use 2.3.3, and I see these files look pretty much the same in
cvsweb,  but if there's a fix in it please advise.

-- 
           Summary: localedata: tests-mbwc/tst_iswalnum segfaults during
                    make check
           Product: glibc
           Version: 2.3.3
            Status: NEW
          Severity: critical
          Priority: P2
         Component: libc
        AssignedTo: gotom at debian dot or dot jp
        ReportedBy: johnlumby at hotmail dot com
                CC: glibc-bugs at sources dot redhat dot com


http://sources.redhat.com/bugzilla/show_bug.cgi?id=356

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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