[Boost-bugs] [Boost C++ Libraries] #10947: serialization singleton & sanitizer : null reference

Subject: [Boost-bugs] [Boost C++ Libraries] #10947: serialization singleton & sanitizer : null reference
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-01-21 09:50:14


#10947: serialization singleton & sanitizer : null reference
------------------------------------------------+--------------------------
 Reporter: vincent.dabir@… | Owner: ramey
     Type: Bugs | Status: new
Milestone: To Be Determined | Component:
  Version: Boost 1.56.0 | serialization
 Keywords: singleton sanitizer null reference | Severity: Problem
------------------------------------------------+--------------------------
 Hi all,

 I ran clang (3.5.1) sanitizer on my program and got the following error:
 {{{
 boost/1_56_0/gcc-4.8.2/include/boost/serialization/singleton.hpp:132:13:
 runtime error: reference binding to null pointer of type 'const Foo'
 }}}

 the program is :
 {{{
 #include<boost/serialization/singleton.hpp>
 #include <string>
 #include <iostream>
 class Foo{
 private:
   std::string bar = "Hello World";
 public:
   void print() const{
     std::cout << bar << std::endl;
   }
 };

 int main(){
   boost::serialization::singleton<Foo> test;
   test.get_const_instance().print();
 }
 }}}


 http://stackoverflow.com/questions/28063066/boost-serialization-singleton-
 and-sanitizer-null-reference

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10947>
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:17 UTC