Boost C++ Libraries: Ticket #11963: Boost function "boost::property_tree::ini_parser::read_ini" causing "EXC_BAD_ACCESS (code=EXC_I386_GPFLT)" https://svn.boost.org/trac10/ticket/11963 <p> I have a simple source like this that build and executes correctly under Windows 10 with Visual Studio 2015 but throws "EXC_BAD_ACCESS (code=EXC_I386_GPFLT)" under OsX 10.11.3 with Xcode 7.2.1: </p> <pre class="wiki">#include &lt;boost/property_tree/ini_parser.hpp&gt; #include &lt;boost/property_tree/ptree.hpp&gt; #include &lt;boost/property_tree/json_parser.hpp&gt; #include &lt;iostream&gt; using namespace std; int main(int argc, char* argv[]) { if (argc != 3) { std::cerr &lt;&lt; "Usage: program rootPath iniFileName" &lt;&lt; std::endl ; return 1; } string mainPath(argv[1]) ; string iniFileName(argv[2]) ; boost::property_tree::ptree pt; try { boost::property_tree::ini_parser::read_ini(mainPath + iniFileName, pt); } catch(const boost::property_tree::ptree_error &amp;e) { cout &lt;&lt; e.what() &lt;&lt; endl; } return 0; } </pre><p> This is the stack trace: </p> <p> Thread 1Queue : com.apple.main-thread (serial) <a class="missing ticket">#0</a> 0x00000001000a10c0 in std::<span class="underline">1::basic_streambuf&lt;char, std::</span>1::char_traits&lt;char&gt; &gt;::pubimbue(std::<span class="underline">1::locale const&amp;) [inlined] at <a class="missing wiki">/Applications/Xcode</a>.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/streambuf:227 <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1" title="#1: Bugs: boost.build causes ftjam to segfault (closed: Wont Fix)">#1</a> 0x00000001000a10c0 in std::</span>1::basic_ios&lt;char, std::<span class="underline">1::char_traits&lt;char&gt; &gt;::imbue(std::</span>1::locale const&amp;) [inlined] at <a class="missing wiki">/Applications/Xcode</a>.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:717 <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2" title="#2: Bugs: list::size should be const (closed: fixed)">#2</a> 0x00000001000a100b in void boost::property_tree::ini_parser::read_ini&lt;boost::property_tree::basic_ptree&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::<span class="underline">1::allocator&lt;char&gt; &gt;, std::</span>1::basic_string&lt;char, std::<span class="underline">1::char_traits&lt;char&gt;, std::</span>1::allocator&lt;char&gt; &gt;, std::<span class="underline">1::less&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::</span>1::allocator&lt;char&gt; &gt; &gt; &gt; &gt;(std::<span class="underline">1::basic_string&lt;char, std::</span>1::char_traits&lt;char&gt;, std::<span class="underline">1::allocator&lt;char&gt; &gt; const&amp;, boost::property_tree::basic_ptree&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::</span>1::allocator&lt;char&gt; &gt;, std::<span class="underline">1::basic_string&lt;char, std::</span>1::char_traits&lt;char&gt;, std::<span class="underline">1::allocator&lt;char&gt; &gt;, std::</span>1::less&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::<span class="underline">1::allocator&lt;char&gt; &gt; &gt; &gt;&amp;, std::</span>1::locale const&amp;) at /Users/andreagiovacchini/Documents/Sviluppo/boost_1_60_0/boost/property_tree/ini_parser.hpp:167 <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3" title="#3: Bugs: automatic conversion and overload proble (closed: fixed)">#3</a> 0x0000000100124a36 in main at /Users/andreagiovacchini/Documents/Sviluppo/Test/Test/main.cpp:21 <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4" title="#4: Bugs: any_ptr in any library documentation? (closed: Fixed)">#4</a> 0x00007fff857245ad in start () </p> <p> Problem comes from "stream.imbue(loc);" line in ini_parser.php from this function: </p> <pre class="wiki"> template&lt;class Ptree&gt; void read_ini(const std::string &amp;filename, Ptree &amp;pt, const std::locale &amp;loc = std::locale()) { std::basic_ifstream&lt;typename Ptree::key_type::value_type&gt; stream(filename.c_str()); if (!stream) BOOST_PROPERTY_TREE_THROW(ini_parser_error( "cannot open file", filename, 0)); stream.imbue(loc); try { read_ini(stream, pt); } catch (ini_parser_error &amp;e) { BOOST_PROPERTY_TREE_THROW(ini_parser_error( e.message(), filename, e.line())); } } </pre><p> Since I can't see how my code can generate this kind of problem I think it is a Boost bug </p> <p> Andrea </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11963 Trac 1.4.3