Issue Details (XML | Word | Printable)

Key: STDCXX-859
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Martin Sebor
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library

SIGSEGV in localedef on invalid Unicode character

Created: 12/Apr/08 08:58 PM   Updated: 12/Apr/08 08:58 PM
Return to search
Component/s: Utilities
Affects Version/s: 4.2.0
Fix Version/s: 4.2.2

Time Tracking:
Original Estimate: 2h
Original Estimate - 2h
Remaining Estimate: 2h
Remaining Estimate - 2h
Time Spent: Not Specified
Remaining Estimate - 2h

Severity: Runtime Error


 Description  « Hide
The localedef utility crashes on the invalid locale definition file below:
$ cat ctype.src && ./localedef -c -w -f ~/stdcxx/etc/nls/charmaps/ISO-8859-1 -i ctype.src ctype
LC_CTYPE
cntrl <U0000>..<U004>
END LC_CTYPE
Segmentation fault

The stack trace:

(gdb) r -c -w -f ~/stdcxx/etc/nls/charmaps/ISO-8859-1 -i ctype.src ctype
Starting program: /build/sebor/stdcxx-gcc-4.1.2-15D/bin/localedef -c -w -f ~/stdcxx/etc/nls/charmaps/ISO-8859-1 -i ctype.src ctype
[Thread debugging using libthread_db enabled]
[Detaching after fork from child process 5076. (Try `set detach-on-fork off'.)]
[New Thread 46912499609232 (LWP 5073)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912499609232 (LWP 5073)]
0x00002aaaaab1e9d3 in __rw::__rw_memset (dst=0x79c732, c=48, 
    nbytes=18446744073709475633) at /home/sebor/stdcxx/src/string.cpp:93
93              *tmp = c;
Missing separate debuginfos, use: debuginfo-install gcc.x86_64
(gdb) where
#0  0x00002aaaaab1e9d3 in __rw::__rw_memset (dst=0x79c732, c=48, 
    nbytes=18446744073709475633) at /home/sebor/stdcxx/src/string.cpp:93
#1  0x00002aaaaab29f14 in std::char_traits<char>::assign (
    __s=0x79c732 '0' <repeats 200 times>..., __n=18446744073709551615, 
    __c=48 '0') at /home/sebor/stdcxx/include/rw/_traits.h:451
#2  0x00002aaaaab2a0bb in std::string::replace (this=0x7ffffed7e0d0, __pos=2, 
    __len=0, __count=18446744073709551615, __val=48 '0')
    at /home/sebor/stdcxx/include/string.cc:432
#3  0x00002aaaaab3c5f3 in std::string::append (this=0x7ffffed7e0d0, 
    __n=18446744073709551615, __c=48 '0')
    at /home/sebor/stdcxx/include/string:1244
#4  0x0000000000452ae4 in Def::process_sym_ellipsis (this=0x7ffffed7e790, 
    start_sym=@0x7ffffed7e890, end_sym=@0x7ffffed7e200, 
    type=Scanner::tok_hex_ellipsis, m=__rw::__rw_cntrl)
    at /home/sebor/stdcxx/util/ctype.cpp:260
#5  0x000000000045345a in Def::process_mask (this=0x7ffffed7e790, 
    m=__rw::__rw_cntrl, name=0x4d2019 "cntrl")
    at /home/sebor/stdcxx/util/ctype.cpp:349
#6  0x0000000000453ff2 in Def::process_ctype (this=0x7ffffed7e790)
    at /home/sebor/stdcxx/util/ctype.cpp:764
#7  0x000000000045be12 in Def::process_input (this=0x7ffffed7e790)
    at /home/sebor/stdcxx/util/def.cpp:495
#8  0x0000000000406b5f in create_locale (std_src=@0x7ffffed7ff60, 
    std_cmap=@0x7ffffed7ff50, outdir=@0x7ffffed7ff40, 
    std_locale=@0x7ffffed7ff30, force_output=true, use_ucs=false, 
    no_position=false, link_aliases=false)
    at /home/sebor/stdcxx/util/localedef.cpp:217
#9  0x0000000000407f26 in localedef_main (argc=8, argv=0x7ffffed800d8)
    at /home/sebor/stdcxx/util/localedef.cpp:564
#10 0x0000000000408146 in main (argc=8, argv=0x7ffffed800d8)
    at /home/sebor/stdcxx/util/localedef.cpp:596


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.