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

                 Key: STDCXX-808
                 URL: https://issues.apache.org/jira/browse/STDCXX-808
             Project: C++ Standard Library
          Issue Type: Bug
          Components: 27. Input/Output
    Affects Versions: 4.2.0
            Reporter: Martin Sebor
            Assignee: Eric Lemings
             Fix For: 4.3


When compiled with Sun C++ in wide mode (with the 
[-m64|http://docs.sun.com/app/docs/doc/819-5267/gewhd?a=view] 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.
{noformat}

$ 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)
[EMAIL PROTECTED] ([EMAIL PROTECTED]) 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: [EMAIL PROTECTED]
=>[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"
{noformat}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to