Boost C++ Libraries: Ticket #9006: read_xml segfaults if run from boost::asio::spawn https://svn.boost.org/trac10/ticket/9006 <p> I've noticed that if read_xml is run through a boost::asio::spawn then read_xml encounters a segmentation violation. </p> <pre class="wiki">#include &lt;boost/property_tree/ptree.hpp&gt; #include &lt;iostream&gt; #include &lt;boost/property_tree/xml_parser.hpp&gt; #include &lt;string&gt; #include &lt;sstream&gt; #include &lt;boost/asio.hpp&gt; #include &lt;boost/asio/spawn.hpp&gt; void read() { std::cout&lt;&lt;"starting read()"&lt;&lt;std::endl; std::string xml = R"phi(&lt;?xml version="1.0"?&gt; &lt;start&gt;&lt;/start&gt;)phi"; std::stringstream ss(std::move(xml)); boost::property_tree::ptree pt; boost::property_tree::read_xml(ss, pt); std::cout&lt;&lt;"ending read()"&lt;&lt;std::endl; } int main() { boost::asio::io_service ios; boost::asio::strand mystrand{ios}; read(); boost::asio::spawn(mystrand, [](boost::asio::yield_context){read();}); ios.run(); } </pre><p> The code above produces </p> <pre class="wiki">starting read() ending read() starting read() Segmentation fault </pre><p> Compiled with gcc-4.8.1 and clang-3.3 (release) on Suse Linux 11 x86_64. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9006 Trac 1.4.3