Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-1043

[Como como 4.3.10.1] std::cout << std::endl causes SIGSEGV on Linux

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 4.2.1
    • None
    • 22. Localization
    • None
    • Linux Gentoo x86_64, como 4.3.10.1, GCC 4.3.2 backend with -m32 switch.
      stdcxx 4.2.1 BUILDTYPE 12s with full locales installed.

    • Incorrect Behavior

    Description

      The program below

      x.cpp:
      #include <iostream>

      int main() {
      std::cout << std::endl;
      return 0;
      }

      results in SIGSEGV.

      como -g3 -gstabs x.cpp -o x
      ./x
      Segmentation fault (core dumped)

      gdb ./x core
      [...]
      Core was generated by `./x'.
      Program terminated with signal 11, Segmentation fault.
      [New process 6685]
      #0 0xf7e46cb3 in strchr () from /lib32/libc.so.6
      (gdb) bt
      #0 0xf7e46cb3 in strchr () from /lib32/libc.so.6
      #1 0x080571bf in std::locale::_C_get_std_facet ()
      #2 0x08049a6a in ZN4rw18rw_get_std_facetERKSt6localeNS_10rw_facet13_C_facet_typeEPFPS3_jPKcE (11910_42__loc=0xff8ac138,
      _11911_48_type=N4rw10rw_facet8_C_ctypeE, __11912_48_ctor=0x804a7b9 <rw::_rw_ct_ctype(unsigned int, char const*)>)
      at /opt/stdcxx-4.2.1-como/include/loc/_locale.h:369
      #3 0x0804995f in ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc (this=0x8091ae4, __15295_27__c=10 '\n') at /opt/stdcxx-4.2.1-como/include/rw/_basic_ios.h:225
      #4 0x080499fb in ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6 (_16097_39__strm=0x8091ae0) at /opt/stdcxx-4.2.1-como/include/ostream:480
      #5 0x08049824 in main () at x.cpp:4

      changing LANG, LC_ALL, etc. to C or any other locale seems to have no effect on the program's behavior.

      Attachments

        Activity

          People

            Unassigned Unassigned
            zola Jaroslaw Zola
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: