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

[Sun C++ -m64] SIGBUS in strstreambuf::seekoff() on empty stream

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • 4.2.0
    • 4.2.2
    • 27. Input/Output
    • None
    • Regression
    • Runtime Error

    Description

      When compiled with Sun C++ in wide mode (with the -m64 option) the following program (taken from the Rogue Wave regression test test_bug11205.cpp) abends with SIGBUS. This happens in both 4.2.0 and on the head of trunk. Suspect a compiler bug.

      $ cat t.cpp && gmake t && dbx -q -c"run;where" t
      #include <cassert>
      #include <iosfwd>
      #include <strstream>
      
      int main ()
      {
          std::strstreambuf sb;
      
          std::streampos pos = sb.pubseekoff (10, std::ios::beg, std::ios::in);
      
          assert (-1 == pos);
      }
      CC -library=%none -g  -m64 +w -errtags -erroff=hidef  -D_RWSTDDEBUG   -mt -I/amd/devco/sebor/stdcxx/include -I/build/sebor/stdcxx-suncc-5.9_j1-15D/include -I/amd/devco/sebor/stdcxx/examples/include  -library=%none  -mt  -m64 -L/build/sebor/stdcxx-suncc-5.9_j1-15D/lib  -R/build/sebor/stdcxx-suncc-5.9_j1-15D/lib  t.cpp  -lstd15D  -lm -o t
      Running: t 
      (process id 20476)
      t@1 (l@1) signal BUS (invalid address alignment) in std::basic_streambuf<char,std::char_traits<char> >::eback at line 166 in file "streambuf"
        166           return _C_eback;
      current thread: t@1
      =>[1] std::basic_streambuf<char,std::char_traits<char> >::eback(this = 0xa), line 166 in "streambuf"
        [2] std::basic_streambuf<char,std::char_traits<char> >::_C_is_valid(this = 0xa), line 520 in "streambuf"
        [3] std::strstreambuf::seekoff(this = 0xa, off = 0, way = 4, which = 0), line 166 in "strstream.cpp"
        [4] std::basic_streambuf<char,std::char_traits<char> >::pubseekoff(this = 0xffffffff7ffff850, __off = 10, __way = __rw_beg, __which = __rw_in), line 99 in "streambuf"
        [5] main(), line 9 in "t.cpp"
      

      Attachments

        Activity

          People

            elemings Eric Lemings
            sebor Martin Sebor
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 4h
                4h
                Remaining:
                Time Spent - 1.5h Remaining Estimate - 2.5h
                2.5h
                Logged:
                Time Spent - 1.5h Remaining Estimate - 2.5h
                1.5h