Boost C++ Libraries: Ticket #5380: Windows has triggered a breakpoint in my code https://svn.boost.org/trac10/ticket/5380 <p> this is the code i used to test (from your website's examples) <strong><a href="http://www.boost.org/doc/libs/1_46_0/doc/html/boost_asio/example/echo/async_tcp_echo_server.cpp">http://www.boost.org/doc/libs/1_46_0/doc/html/boost_asio/example/echo/async_tcp_echo_server.cpp</a></strong> </p> <p> When i used "step into" to debug, i got the following error message: <strong>HEAP[test.exe]: HEAP: Free Heap block c46ce8 modified at c46de0 after it was freed Windows has triggered a breakpoint in test.exe. </strong></p> <p> 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. </p> <p> This may also be due to the user pressing F12 while test.exe has focus. </p> <p> The output window may have more diagnostic information. <strong> </strong></p> <p> <em>This is the file it stopped:</em> <strong>\boost\asio\detail\impl\win_iocp_socket_service_base.ipp</strong> <em>line stopped: 334</em> </p> <p> <em>line 334 is in function: </em> <strong>void win_iocp_socket_service_base::start_receive_op( </strong></p> <blockquote> <p> win_iocp_socket_service_base::base_implementation_type&amp; impl, WSABUF* buffers, std::size_t buffer_count, socket_base::message_flags flags, bool noop, operation* op)<strong> </strong></p> </blockquote> <p> <em>This is line 334:</em> <strong>int result = ::WSARecv(impl.socket_, buffers, </strong></p> <blockquote> <p> static_cast&lt;DWORD&gt;(buffer_count), &amp;bytes_transferred, &amp;recv_flags, op, 0);<strong> </strong></p> </blockquote> <p> This problem occurs while i send a simple message to the test server, 128 bytes in each request. </p> <p> Version of Boost: 1.46.1 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5380 Trac 1.4.3 chris_kohlhoff Mon, 28 Mar 2011 07:06:22 GMT component changed; owner set https://svn.boost.org/trac10/ticket/5380#comment:1 https://svn.boost.org/trac10/ticket/5380#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">chris_kohlhoff</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">asio</span> </li> </ul> <p> 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. </p> Ticket anonymous Thu, 31 Mar 2011 03:40:42 GMT <link>https://svn.boost.org/trac10/ticket/5380#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5380#comment:2</guid> <description> <p> Sorry, i didnt include the OS and compiler version </p> <blockquote> <p> 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 </p> </blockquote> <blockquote> <p> after i copied i use debug -&gt; step into (with command line arguement "8474" &lt;&lt; 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) </p> </blockquote> <blockquote> <p> When i build the binary, and run it, it works perfectly fine when i used the exact same client to connect to it </p> </blockquote> <blockquote> <p> This problem is annoying if i tried to debug the problem in my future projects. </p> </blockquote> <p> I used Visual C++ 2008 professional Windows xp SP3 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Thu, 31 Mar 2011 05:29:57 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5380#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5380#comment:3</guid> <description> <p> Thanks for the additional info, however I am still unable to reproduce any issue using MSVC 2008 on XP SP3. </p> <p> I need to know the <strong>exact steps</strong> used to compile the example. If necessary, please attach the .vcproj file you use. </p> <p> Please also clarify what you do after "debug -&gt; 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. </p> </description> <category>Ticket</category> </item> <item> <author>greatstar00@…</author> <pubDate>Sat, 02 Apr 2011 04:35:59 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/5380 https://svn.boost.org/trac10/ticket/5380 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test.rar</span> </li> </ul> <p> The project files, and the test source code </p> Ticket anonymous Sat, 02 Apr 2011 04:37:07 GMT <link>https://svn.boost.org/trac10/ticket/5380#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5380#comment:4</guid> <description> <p> yes, you debug-&gt; step into then u see a dos mod window waiting for connection </p> <p> YOu need a client program to connect to it, and then it will trigger the error. </p> <p> I attacked the files containing my project setup </p> <p> I deleted the library to make it less in size I also deleted test.ncb (the intellisense database file) </p> <p> 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 </p> <p> The client folder, that is the c# client i used to test. </p> <p> You should include the boost main library source code. </p> </description> <category>Ticket</category> </item> </channel> </rss>