[Boost-bugs] [Boost C++ Libraries] #3808: Segfault after using boost::io::ios_all_saver() - on 64 bit only

Subject: [Boost-bugs] [Boost C++ Libraries] #3808: Segfault after using boost::io::ios_all_saver() - on 64 bit only
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-01-02 03:08:24


#3808: Segfault after using boost::io::ios_all_saver() - on 64 bit only
----------------------------------------------------+-----------------------
 Reporter: Enrique Perez-Terron <enrio@…> | Owner: dlwalker
     Type: Bugs | Status: new
Milestone: Boost 1.42.0 | Component: io
  Version: Boost 1.41.0 | Severity: Problem
 Keywords: |
----------------------------------------------------+-----------------------
 See the file I will attach for exact example.
 Compiled against current svn boost-trunk

 On my amd46, but not on my old Pentium 4, I get a segfault in
 {{{
   std::iostream_insert<char,T> (S&, char const*, long)
 }}}
 where T and S are as follows:
 {{{
    T = std::char_traits<char>
    S = std::basic_ostream<char,T>
 }}}
 from the following statement
 {{{
    std::cout << "Blah " << anObject << " More blah.\n";
 }}}
 but not from the following pair of statements:
 {{{
    std::cout << "Blah " << anObject;
    std::cout << " More blah.\n";
 }}}

 where Object has the following {{{operator<< }}}:
 {{{
    using std;
    ostream& operator<< (ostream& os, Object& ob)
    {
       boost::io::ios_all_saver saver(os);
       os << '#'
          << hex << setfill('0') << setw(8)
          << (unsigned int)some_member_convertible_to_unsigned_int;
    }
 }}}
 The file that I will upload shortly, I compiled with
 {{{
    # Does not segfault (does not use boost)
    g++ -o er -I/var/src/boost-trunk er.cxx

    # Does segfault
    g++ -o er -I/var/src/boost-trunk -Dsegfault er.cxx

    # Does not segfault ("Workaround" sort of)
    g++ -o er -I/var/src/boost-trunk -Dsegfault -Dsurvive_bug er.cxx
 }}}
 My configuration: [[BR]]

 Compiler: g++ (Ubuntu 4.4.1-4ubuntu8) 4.4.1[[BR]]
 Boost: svn co boost-trunk at 2010-01-02 01:39 UTC[[BR]]
 libc6: 2.10.1-0ubuntu15

 processor: (from /proc/cpuinfo)[[BR]]
 {{{
   vendor_id : AuthenticAMD
   cpu family : 15
   model : 72
   model name : AMD Turion(tm) 64 X2 Mobile Technology TL-50
   stepping : 2
   wp : yes
   flags : fpu vme de pse tsc msr pae mce cx8 apic sep
                   mtrr pge mca cmov pat pse36 clflush mmx fxsr
                   sse sse2 ht syscall nx mmxext fxsr_opt rdtscp
                   lm 3dnowext 3dnow rep_good extd_apicid pni
                   cx16 lahf_lm cmp_legacy svm extapic cr8_legacy
 }}}
 Regards,
 Enrique Perez_Terron

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3808>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:02 UTC