Boost C++ Libraries: Ticket #4247: boost::asio access violation on mingw32 https://svn.boost.org/trac10/ticket/4247 <p> On a mingw32 build of libs/asio/example/http/async_client.cpp using gcc 4.5, an access violation is created when the HTTP client is pointed to an address which refuses the connection. When adding a <code>LoadLibrary("exchndl.dll");</code> (stack dump tool from mingw-utils), I get the following stack trace: </p> <p> Z:\tmp\a.exe caused an Access Violation at location 004277d1 in module Z:\tmp\a.exe Reading from location 00000200. </p> <p> Registers: eax=00000051 ebx=00123df0 ecx=00a4faa0 edx=00000200 esi=00a4f9e4 edi=00a4faac eip=004277d1 esp=00a4f960 ebp=00a4f9f8 iopl=0 nv up ei pl nz na pe nc cs=0073 ss=007b ds=007b es=007b fs=0033 gs=003b efl=00010202 </p> <p> Call stack: 004277D1 Z:\tmp\a.exe:004277D1 boost::system::error_code::message /opt/boost-mingw32/include/boost/system/error_code.hpp:350 004233EF Z:\tmp\a.exe:004233EF boost::_mfi::mf1&lt;void, client, boost::system::error_code const&amp;&gt;::operator() /opt/boost-mingw32/include/boost/bind/mem_fn_template.hpp:165 004205A2 Z:\tmp\a.exe:004205A2 error_code /opt/boost-mingw32/include/boost/system/error_code.hpp:315 0041FBA9 Z:\tmp\a.exe:0041FBA9 00401978 Z:\tmp\a.exe:00401978 boost::system::error_code::operator void (*)() /opt/boost-mingw32/include/boost/system/error_code.hpp:357 004010A5 Z:\tmp\a.exe:004010A5 </p> <p> When compiling with -DBOOST_ASIO_DISABLE_THREADS, I get the following error message instead: </p> <p> Exception: thread: Unknown error </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4247 Trac 1.4.3 boost@… Sat, 22 May 2010 21:29:33 GMT <link>https://svn.boost.org/trac10/ticket/4247#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4247#comment:1</guid> <description> <p> The offending commit is this one: <a class="ext-link" href="https://svn.boost.org/trac/boost/changeset/60380/trunk"><span class="icon">​</span>https://svn.boost.org/trac/boost/changeset/60380/trunk</a> </p> </description> <category>Ticket</category> </item> <item> <author>boost@…</author> <pubDate>Sun, 23 May 2010 00:00:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4247#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4247#comment:2</guid> <description> <p> The problem doesn't occur when compiling with -DBOOST_ASIO_DISABLE_IOCP=1. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Mon, 07 Jun 2010 13:53:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4247#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4247#comment:3</guid> <description> <p> I cannot reproduce any problem. Using mingw / g++ 4.5 obtained from <a class="ext-link" href="http://nuwen.net/mingw.html"><span class="icon">​</span>http://nuwen.net/mingw.html</a>, I ran: </p> <pre class="wiki">C:&gt; g++ -O2 -Wall -mthreads -D_WIN32_WINNT=0x501 async_client.cpp -lws2_32 -lmswsock -lboost_system C:&gt; a.exe 192.168.1.1 / Error: No connection could be made because the target machine actively refused it </pre><p> Perhaps your crash is due to a build configuration error? What compiler command line is being used? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Sun, 13 Jun 2010 13:52:03 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4247#comment:4 https://svn.boost.org/trac10/ticket/4247#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">worksforme</span> </li> </ul> <p> Please reopen if you can supply more specific information on how to reproduce the issue. </p> Ticket