Re: [Boost-bugs] [Boost C++ Libraries] #11204: undefined behavior sanitizer complains about runtime_error thrown in serialization/singleton.hpp before main()

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11204: undefined behavior sanitizer complains about runtime_error thrown in serialization/singleton.hpp before main()
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-12-13 14:57:26


#11204: undefined behavior sanitizer complains about runtime_error thrown in
serialization/singleton.hpp before main()
--------------------------------------+---------------------------
  Reporter: Georg Sauthoff <mail@…> | Owner: Robert Ramey
      Type: Bugs | Status: reopened
 Milestone: To Be Determined | Component: serialization
   Version: Boost Development Trunk | Severity: Problem
Resolution: | Keywords:
--------------------------------------+---------------------------

Comment (by davidlt):

 I am using boost 1.63.0, GCC 7.2.1, bintutils 2.29.1 and trying to compile
 software using boost with Undefined Behavior Sanitizer (UBSan). I think,
 am hitting the same issue.

 Compile generates: {{{mov (%r12),%rax }}} and registers are:
 {{{
 rax 0x8 8
 r12 0x8 8
 }}}

 Here is a full picture:
 {{{
    â”Œâ”€â”€/cvmfs/cms-
 ib.cern.ch/nweek-02500/slc6_amd64_gcc700/external/boost/1.63.0-mmelna2/include/boost/serialization/void_cast.hpp──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
    â”‚184 // note:I wanted to displace from 0 here, but at least
 one compiler
 â”‚
    â”‚185 // treated 0 by not shifting it at all.
 â”‚
    â”‚186 reinterpret_cast<std::ptrdiff_t>(
 â”‚
>│187 static_cast<Derived *>(
 â”‚
    â”‚188 reinterpret_cast<Base *>(8)
 â”‚
    â”‚189 )
 â”‚
    â”‚190 ) - 8
 â”‚
    â”‚191 )
 â”‚
    â”‚192 {
 â”‚
    â”‚193 recursive_register();
 â”‚
    â”‚194 }
 â”‚
    â”‚195
 â”‚
    â”‚196 template <class Derived, class Base>
 â”‚
    â”‚197 void_caster_primitive<Derived,
 Base>::~void_caster_primitive(){
 â”‚
    â”‚198 recursive_unregister();
 â”‚
    â”‚199 }
 â”‚
    â”‚200
 â”‚
    â”‚201 template <class Derived, class Base>
 â”‚
    â”‚202 class BOOST_SYMBOL_VISIBLE void_caster_virtual_base :
 â”‚
    â”‚203 public void_caster
 â”‚
    â”‚204 {
 â”‚
 â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
    â”‚0x7fffe6c4461c
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+138> mov $0x8,%r12d
 â”‚
    â”‚0x7fffe6c44622
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+144> mov %r12,%rax
 â”‚
    â”‚0x7fffe6c44625
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+147> test %r12,%r12
 â”‚
    â”‚0x7fffe6c44628
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+150> je 0x7fffe6c44635
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Su│
    â”‚0x7fffe6c4462a
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+152> mov %rax,%rdx
 â”‚
    â”‚0x7fffe6c4462d
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+155> and $0x7,%edx
 â”‚
    â”‚0x7fffe6c44630
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+158> test %rdx,%rdx
 â”‚
    â”‚0x7fffe6c44633
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+161> je 0x7fffe6c44644
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Su│
    â”‚0x7fffe6c44635
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+163> mov %rax,%rsi
 â”‚
    â”‚0x7fffe6c44638
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+166> lea
 0x15f221(%rip),%rdi # 0x7fffe6da3860
 â”‚
    â”‚0x7fffe6c4463f
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+173> callq 0x7fffe6bd73a0
 <__ubsan_handle_type_mismatch_at_plt>
 â”‚
>│0x7fffe6c44644
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+178> mov (%r12),%rax
 â”‚
    â”‚0x7fffe6c44648
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+182> mov %rax,%rdx
 â”‚
    â”‚0x7fffe6c4464b
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+185> movabs
 $0xd36d9746bc2d02eb,%rax
 â”‚
    â”‚0x7fffe6c44655
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+195> xor %rdx,%rax
 â”‚
    â”‚0x7fffe6c44658
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+198> mov %rax,%rcx
 â”‚
    â”‚0x7fffe6c4465b
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+201> movabs
 $0x9ddfea08eb382d69,%rax
 â”‚
    â”‚0x7fffe6c44665
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+211> imul %rcx,%rax
 â”‚
    â”‚0x7fffe6c44669
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+215> mov %rax,%rcx
 â”‚
    â”‚0x7fffe6c4466c
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+218> shl $0x2f,%rcx
 â”‚
    â”‚0x7fffe6c44670
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+222> xor %rdx,%rax
 â”‚
 â””───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
 multi-thre Thread 0x7ffff7dc97 In:
 boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive
 L187 PC: 0x7fffe6c44644
 Starting program: /cvmfs/cms-
 ib.cern.ch/nweek-02500/slc6_amd64_gcc700/cms/cmssw/CMSSW_10_0_UBSAN_X_2017-11-27-2300/external/slc6_amd64_gcc700/bin/python
 /cvmfs/cms-
 ib.cern.ch/week0/slc6_amd64_gcc700/cms/cmssw/CMSSW_10_0_UBSAN_X_2017-11-27-2300/src/FWCore/Utilities/scripts
 /edmCheckClassVersion -l
 tmp/slc6_amd64_gcc700/src/CondFormats/Common/src/CondFormatsCommon/libCondFormatsCommon.so
 -x src/CondFormats/Common/src/classes_def.xml
 [Thread debugging using libthread_db enabled]
 Using host libthread_db library "/lib64/libthread_db.so.1".
 warning: File "/cvmfs/cms-
 ib.cern.ch/nweek-02500/slc6_amd64_gcc700/external/gcc/7.0.0-mmelna2/lib64/libstdc++.so.6.0.24-gdb.py"
 auto-loading has been declined by your `auto-load safe-path' set to
 "$debugdir:$datadir/auto-load".

 Program received signal SIGSEGV, Segmentation fault.
 0x00007fffe6c44644 in
 boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive (
     this=0x7fffe6e18a40
 <boost::serialization::singleton<boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary> >::get_instance()::t>)
     at /cvmfs/cms-
 ib.cern.ch/nweek-02500/slc6_amd64_gcc700/external/boost/1.63.0-mmelna2/include/boost/serialization/void_cast.hpp:187
 (gdb) p $_siginfo._sifields._sigfault.si_addr
 $1 = (void *) 0x8
 (gdb)

 rax 0x8 8
 rbx 0x7fffe6e18a40 140737066928704
 rcx 0x14 20
 rdx 0x0 0
 rsi 0x12 18
 rdi 0x7fffe6e18a40 140737066928704
 rbp 0x7fffffff2660 0x7fffffff2660
 rsp 0x7fffffff2640 0x7fffffff2640
 r8 0x24ebc30 38714416
 r9 0x6 6
 r10 0x7fffffff23f0 140737488298992
 r11 0x7fffe6c44592 140737065010578
 r12 0x8 8
 r13 0x7fffe6d02a98 140737065790104
 r14 0x7fffffff3a20 140737488304672
 r15 0x0 0
 rip 0x7fffe6c44644 0x7fffe6c44644
 <boost::serialization::void_cast_detail::void_caster_primitive<cond::GenericSummary,
 cond::Summary>::void_caster_primitive()+178>
 eflags 0x10246 [ PF ZF IF RF ]
 cs 0x33 51
 ss 0x2b 43
 ds 0x0 0
 es 0x0 0
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac10/boost/ticket/11204#comment:10>
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-12-13 15:03:41 UTC