C++ Standard Library
  1. C++ Standard Library
  2. STDCXX-289

localedef SIAGABRT on an incomplete day definition in LC_TIME

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 4.1.2, 4.1.3
    • Fix Version/s: 4.2.0
    • Component/s: Utilities
    • Labels:
      None
    • Environment:

      all

    • Severity:
      Runtime Error

      Description

      The localedef utility aborts on LC_TIME definitions containing fewer than the usual number of strings for multistring keywords such as day, abday, etc,

      $ cat charmap && cat locale.src && ../bin/localedef -c -w -f charmap -i locale.src dummy || gdb -q ../bin/localedef core
      CHARMAP
      END CHARMAP
      LC_TIME
      day "Sun";"Mon";"Tue"
      END LC_TIME
      Assertion failed: str1[0] == '\"', file /build/sebor/stdcxx-4.1.3/util/def.cpp, line 254
      Abort (core dumped)
      Core was generated by `../bin/localedef -c -w -f charmap -i locale.src dummy'.
      Program terminated with signal 6, Aborted.
      ...
      #0  0xff31d3d4 in _libc_kill () from /usr/lib/libc.so.1
      (gdb) where
      #0  0xff31d3d4 in _libc_kill () from /usr/lib/libc.so.1
      #1  0xff2b5698 in abort () from /usr/lib/libc.so.1
      #2  0xff2b5938 in _assert () from /usr/lib/libc.so.1
      #3  0x0007e050 in Def::convert_string (this=0xffbfe910, str1=@0xffbfe990)
          at /build/sebor/stdcxx-4.1.3/util/def.cpp:254
      #4  0x0009f964 in Def::process_time (this=0xffbfe910)
          at /build/sebor/stdcxx-4.1.3/util/time.cpp:184
      #5  0x0007d5e0 in Def::process_input (this=0xffbfe910)
          at /build/sebor/stdcxx-4.1.3/util/def.cpp:506
      #6  0x00013cac in create_locale ()
      #7  0x00015a2c in main (argc=8, argv=0xffbffb8c)
          at /build/sebor/stdcxx-4.1.3/util/localedef.cpp:560
      

        Activity

        Martin Sebor made changes -
        Fix Version/s 4.2.1 [ 12312690 ]
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 4.2.0 [ 12311945 ]
        Hide
        Martin Sebor added a comment -

        Marking as Resolved in 4.2.0 – I couldn't reproduce it even there.
        Will close once we create a regression test, or a full-blown test for the utility.

        Show
        Martin Sebor added a comment - Marking as Resolved in 4.2.0 – I couldn't reproduce it even there. Will close once we create a regression test, or a full-blown test for the utility.
        Martin Sebor made changes -
        Remaining Estimate 2h [ 7200 ] 1h [ 3600 ]
        Time Spent 1h [ 3600 ]
        Martin Sebor made changes -
        Description The localedef utility aborts on LC_TIME definitions containing fewer than the usual number of strings for multistring keywords such as day, abday, etc,

        $ cat charmap && cat locale.src && ../bin/localedef -c -w -f charmap -i locale.src dummy || gdb -q ../bin/localedef core
        CHARMAP
        END CHARMAP
        LC_TIME
        day "Sun";"Mon";"Tue"
        END LC_TIME
        Assertion failed: str1[0] == '\"', file /build/sebor/stdcxx-4.1.3/util/def.cpp, line 254
        Abort (core dumped)
        Core was generated by `../bin/localedef -c -w -f charmap -i locale.src dummy'.
        Program terminated with signal 6, Aborted.
        ...
        #0 0xff31d3d4 in _libc_kill () from /usr/lib/libc.so.1
        (gdb) where
        #0 0xff31d3d4 in _libc_kill () from /usr/lib/libc.so.1
        #1 0xff2b5698 in abort () from /usr/lib/libc.so.1
        #2 0xff2b5938 in _assert () from /usr/lib/libc.so.1
        #3 0x0007e050 in Def::convert_string (this=0xffbfe910, str1=@0xffbfe990)
            at /build/sebor/stdcxx-4.1.3/util/def.cpp:254
        #4 0x0009f964 in Def::process_time (this=0xffbfe910)
            at /build/sebor/stdcxx-4.1.3/util/time.cpp:184
        #5 0x0007d5e0 in Def::process_input (this=0xffbfe910)
            at /build/sebor/stdcxx-4.1.3/util/def.cpp:506
        #6 0x00013cac in create_locale ()
        #7 0x00015a2c in main (argc=8, argv=0xffbffb8c)
            at /build/sebor/stdcxx-4.1.3/util/localedef.cpp:560
        The localedef utility aborts on LC_TIME definitions containing fewer than the usual number of strings for multistring keywords such as day, abday, etc,

        {noformat}
        $ cat charmap && cat locale.src && ../bin/localedef -c -w -f charmap -i locale.src dummy || gdb -q ../bin/localedef core
        CHARMAP
        END CHARMAP
        LC_TIME
        day "Sun";"Mon";"Tue"
        END LC_TIME
        Assertion failed: str1[0] == '\"', file /build/sebor/stdcxx-4.1.3/util/def.cpp, line 254
        Abort (core dumped)
        Core was generated by `../bin/localedef -c -w -f charmap -i locale.src dummy'.
        Program terminated with signal 6, Aborted.
        ...
        #0 0xff31d3d4 in _libc_kill () from /usr/lib/libc.so.1
        (gdb) where
        #0 0xff31d3d4 in _libc_kill () from /usr/lib/libc.so.1
        #1 0xff2b5698 in abort () from /usr/lib/libc.so.1
        #2 0xff2b5938 in _assert () from /usr/lib/libc.so.1
        #3 0x0007e050 in Def::convert_string (this=0xffbfe910, str1=@0xffbfe990)
            at /build/sebor/stdcxx-4.1.3/util/def.cpp:254
        #4 0x0009f964 in Def::process_time (this=0xffbfe910)
            at /build/sebor/stdcxx-4.1.3/util/time.cpp:184
        #5 0x0007d5e0 in Def::process_input (this=0xffbfe910)
            at /build/sebor/stdcxx-4.1.3/util/def.cpp:506
        #6 0x00013cac in create_locale ()
        #7 0x00015a2c in main (argc=8, argv=0xffbffb8c)
            at /build/sebor/stdcxx-4.1.3/util/localedef.cpp:560
        {noformat}
        Hide
        Martin Sebor added a comment -

        Disabled formatting to make stack trace more readable.

        Show
        Martin Sebor added a comment - Disabled formatting to make stack trace more readable.
        Martin Sebor logged work - 19/Mar/08 01:10
        • Time Spent:
          1h
           
          Unsuccessfully tried to reproduce.
        Hide
        Martin Sebor added a comment -

        I can't reproduce this with gcc 4.1.2 on Linux. The following command completes successfully:

        $ cat >charmap<<EOF && cat >locale.src<<EOF && ../bin/localedef -c -w -f charmap -i locale.src dummy && LC_TIME=dummy ../bin/locale -ck LC_TIME
        CHARMAP
        END CHARMAP
        EOF
        LC_TIME
        day "Sun";"Mon";"Tue"
        END LC_TIME
        EOF
        

        ...with the following output:

        LC_TIME
        abday="";"";"";"";"";"";""
        day="Sun";"Mon";"Tue";"";"";"";""
        abmon="";"";"";"";"";"";"";"";"";"";"";""
        mon="";"";"";"";"";"";"";"";"";"";"";""
        am_pm="";""
        d_t_fmt=""
        d_fmt=""
        t_fmt=""
        t_fmt_ampm=""
        era=""
        era_d_t_fmt=""
        era_d_fmt=""
        era_t_fmt=""
        alt_digits=""
        END LC_TIME
        
        Show
        Martin Sebor added a comment - I can't reproduce this with gcc 4.1.2 on Linux. The following command completes successfully: $ cat >charmap<<EOF && cat >locale.src<<EOF && ../bin/localedef -c -w -f charmap -i locale.src dummy && LC_TIME=dummy ../bin/locale -ck LC_TIME CHARMAP END CHARMAP EOF LC_TIME day "Sun";"Mon";"Tue" END LC_TIME EOF ...with the following output: LC_TIME abday="";"";"";"";"";"";"" day="Sun";"Mon";"Tue";"";"";"";"" abmon="";"";"";"";"";"";"";"";"";"";"";"" mon="";"";"";"";"";"";"";"";"";"";"";"" am_pm="";"" d_t_fmt="" d_fmt="" t_fmt="" t_fmt_ampm="" era="" era_d_t_fmt="" era_d_fmt="" era_t_fmt="" alt_digits="" END LC_TIME
        Martin Sebor made changes -
        Remaining Estimate 2h [ 7200 ]
        Severity Runtime Error
        Original Estimate 2h [ 7200 ]
        Martin Sebor made changes -
        Field Original Value New Value
        Fix Version/s 4.2.1 [ 12312690 ]
        Priority Major [ 3 ] Trivial [ 5 ]
        Fix Version/s 4.2 [ 12311945 ]
        Hide
        Martin Sebor added a comment -

        Lowered Priority to Trivial (the error occurs on ill-formed input) and deferred until after 4.2.

        Show
        Martin Sebor added a comment - Lowered Priority to Trivial (the error occurs on ill-formed input) and deferred until after 4.2.
        Martin Sebor created issue -

          People

          • Assignee:
            Martin Sebor
            Reporter:
            Martin Sebor
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 2h
              2h
              Remaining:
              Time Spent - 1h Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - 1h Remaining Estimate - 1h
              1h

                Development