Opened 12 years ago

Last modified 12 years ago

#5380 new Bugs

Windows has triggered a breakpoint in my code

Reported by: greatstar00@… Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost Release Branch Severity: Problem
Keywords: Cc:

Description

this is the code i used to test (from your website's examples) http://www.boost.org/doc/libs/1_46_0/doc/html/boost_asio/example/echo/async_tcp_echo_server.cpp

When i used "step into" to debug, i got the following error message: HEAP[test.exe]: HEAP: Free Heap block c46ce8 modified at c46de0 after it was freed Windows has triggered a breakpoint in test.exe.

This may be due to a corruption of the heap, which indicates a bug in test.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while test.exe has focus.

The output window may have more diagnostic information.

This is the file it stopped: \boost\asio\detail\impl\win_iocp_socket_service_base.ipp line stopped: 334

line 334 is in function: void win_iocp_socket_service_base::start_receive_op(

win_iocp_socket_service_base::base_implementation_type& impl, WSABUF* buffers, std::size_t buffer_count, socket_base::message_flags flags, bool noop, operation* op)

This is line 334: int result = ::WSARecv(impl.socket_, buffers,

static_cast<DWORD>(buffer_count), &bytes_transferred, &recv_flags, op, 0);

This problem occurs while i send a simple message to the test server, 128 bytes in each request.

Version of Boost: 1.46.1

Attachments (1)

test.rar (21.1 KB ) - added by greatstar00@… 12 years ago.
The project files, and the test source code

Download all attachments as: .zip

Change History (5)

comment:1 by chris_kohlhoff, 12 years ago

Component: Noneasio
Owner: set to chris_kohlhoff

Cannot reproduce with MSVC10, Windows XP SP 3, using bjam to compile the examples. Please indicate OS and compiler version, and exact steps used to compile the example.

comment:2 by anonymous, 12 years ago

Sorry, i didnt include the OS and compiler version

I used bjam to compile all the libraries first, then i cut the necessary library to the test project's folder. I set all addition libraries option, and include path correctly. (that is why it can compile) These 3 lib i copied to my test project folder libboost_system-vc90-mt-gd-1_46_1.lib libboost_date_time-vc90-mt-gd-1_46_1.lib libboost_regex-vc90-mt-gd-1_46_1.lib

after i copied i use debug -> step into (with command line arguement "8474" << this is the port i test) The dos window came up indicating it is running Then i used my c# client program try to connect to 127.0.0.1:8474 via tcp Then this server program immediately throw into the error mentioned in the previous reply (window trigged a break point)

When i build the binary, and run it, it works perfectly fine when i used the exact same client to connect to it

This problem is annoying if i tried to debug the problem in my future projects.

I used Visual C++ 2008 professional Windows xp SP3

comment:3 by chris_kohlhoff, 12 years ago

Thanks for the additional info, however I am still unable to reproduce any issue using MSVC 2008 on XP SP3.

I need to know the exact steps used to compile the example. If necessary, please attach the .vcproj file you use.

Please also clarify what you do after "debug -> step into" because if I just do that I cannot connect a client. I need to press F5 or similar to allow the program to run.

by greatstar00@…, 12 years ago

Attachment: test.rar added

The project files, and the test source code

comment:4 by anonymous, 12 years ago

yes, you debug-> step into then u see a dos mod window waiting for connection

YOu need a client program to connect to it, and then it will trigger the error.

I attacked the files containing my project setup

I deleted the library to make it less in size I also deleted test.ncb (the intellisense database file)

There is a folder named "lib" you should place 3 libraries into it libboost_system-vc90-mt-gd-1_46_1.lib libboost_date_time-vc90-mt-gd-1_46_1.lib libboost_regex-vc90-mt-gd-1_46_1.lib

The client folder, that is the c# client i used to test.

You should include the boost main library source code.

Note: See TracTickets for help on using tickets.