Opened 5 years ago

Last modified 5 years ago

#13147 new Bugs

Crash in boost::asio::basic_streambuf

Reported by: luliu@… Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.63.0 Severity: Problem
Keywords: Cc:

Description

Hi All,

Our program crashed in boost::asio::streambuf while streambuf was reserving more spaces.

The related codes using boost::asio::streambuf is like this:

boost::asio::streambuf send_buffer; 

std::ostream send_stream(&send_buffer);
send_stream << "MESSAGE...";
send_stream << flush();

...
boost::asio::async_write(ssl_stream, send_buffer, ...);

Change History (2)

comment:1 by luliu@…, 5 years ago

The crash happened when boost::asio::streambuf were reserving more space after streambuf exceeded 512 bytes.

Here is the crash stack.

0:011> k
 # Child-SP          RetAddr           Call Site
00 00000000`02c0b098 00007ffc`b48a13ed ntdll!NtWaitForMultipleObjects+0xa
01 00000000`02c0b0a0 00007ffc`b7637d51 KERNELBASE!WaitForMultipleObjectsEx+0xe1
02 00000000`02c0b380 00007ffc`b7637773 kernel32!WerpReportFaultInternal+0x581
03 00000000`02c0b8f0 00007ffc`b4981fff kernel32!WerpReportFault+0x83
04 00000000`02c0b920 00007ffc`b774f133 KERNELBASE!UnhandledExceptionFilter+0x23f
05 00000000`02c0ba10 00007ffc`b7731d86 ntdll!RtlUserThreadStart$filt$0+0x3e
06 00000000`02c0ba50 00007ffc`b77433fd ntdll!_C_specific_handler+0x96
07 00000000`02c0bac0 00007ffc`b7704847 ntdll!RtlpExecuteHandlerForException+0xd
08 00000000`02c0baf0 00007ffc`b774258a ntdll!RtlDispatchException+0x197
09 00000000`02c0c1c0 00000000`5080e4ff ntdll!KiUserExceptionDispatch+0x3a
0a 00000000`02c0c8f8 00007ff7`135eb415 msvcr90!memcpy+0x2cf
0b 00000000`02c0c900 00007ff7`135eaf1a SecurityGateway!boost::asio::basic_streambuf<std::allocator<char> >::reserve+0x105 
0c 00000000`02c0cac0 00000000`508ab8bf SecurityGateway!boost::asio::basic_streambuf<std::allocator<char> >::overflow+0x5a 
0d 00000000`02c0caf0 00007ff7`135b3d31 msvcp90!std::basic_streambuf<char,std::char_traits<char> >::xsputn+0x87 
0e 00000000`02c0cb20 00007ff7`1364a78f SecurityGateway!std::operator<<<std::char_traits<char> >+0x111 
0f 00000000`02c0cb90 00007ff7`13648161 SecurityGateway!send_message

comment:2 by luliu, 5 years ago

Hi Boost experts,

Please share your comment on this issue. Any help will be appreciated. Thanks.

Note: See TracTickets for help on using tickets.