Opened 12 years ago

Closed 12 years ago

#4247 closed Bugs (worksforme)

boost::asio access violation on mingw32

Reported by: boost@… Owned by: chris_kohlhoff
Milestone: Boost 1.43.0 Component: asio
Version: Boost 1.44.0 Severity: Problem
Keywords: Cc:

Description

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 LoadLibrary("exchndl.dll"); (stack dump tool from mingw-utils), I get the following stack trace:

Z:\tmp\a.exe caused an Access Violation at location 004277d1 in module Z:\tmp\a.exe Reading from location 00000200.

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

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<void, client, boost::system::error_code const&>::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

When compiling with -DBOOST_ASIO_DISABLE_THREADS, I get the following error message instead:

Exception: thread: Unknown error

Change History (4)

comment:1 by boost@…, 12 years ago

comment:2 by boost@…, 12 years ago

The problem doesn't occur when compiling with -DBOOST_ASIO_DISABLE_IOCP=1.

comment:3 by chris_kohlhoff, 12 years ago

I cannot reproduce any problem. Using mingw / g++ 4.5 obtained from http://nuwen.net/mingw.html, I ran:

C:> g++ -O2 -Wall -mthreads -D_WIN32_WINNT=0x501 async_client.cpp -lws2_32 -lmswsock -lboost_system

C:> a.exe 192.168.1.1 /
Error: No connection could be made because the target machine actively refused it

Perhaps your crash is due to a build configuration error? What compiler command line is being used?

comment:4 by chris_kohlhoff, 12 years ago

Resolution: worksforme
Status: newclosed

Please reopen if you can supply more specific information on how to reproduce the issue.

Note: See TracTickets for help on using tickets.