Skip to content

Crash on MIMEScanner::append() #5587

@masaori335

Description

@masaori335

AUTest(on Fedora 30) for #5585 crashed. The test is injecting over 16KB header in response.
FWIW, I didn't see this crash on CentOS 7.

#0  0x00007f5a1bdffeb5 in raise () from /lib64/libc.so.6
#1  0x00007f5a1bdea895 in abort () from /lib64/libc.so.6
#2  0x00007f5a1be42ee7 in __libc_message () from /lib64/libc.so.6
#3  0x00007f5a1be497bc in malloc_printerr () from /lib64/libc.so.6
#4  0x00007f5a1be4af2c in _int_free () from /lib64/libc.so.6
#5  0x00007f5a1c235cef in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_mutate(unsigned long, unsigned long, char const*, unsigned long) ()
   from /lib64/libstdc++.so.6
#6  0x00007f5a1c237553 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_append(char const*, unsigned long) () from /lib64/libstdc++.so.6
#7  0x000000000079960c in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append<ts::TextView> (this=0x7f59e1e4bf18, __svt=...)
    at /usr/include/c++/9/bits/basic_string.h:1323
#8  0x0000000000799595 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=<ts::TextView> (this=0x7f59e1e4bf18, __svt=...)
    at /usr/include/c++/9/bits/basic_string.h:1212
#9  0x0000000000793b87 in MIMEScanner::append (this=0x7f59e1e4bf18, text=...) at MIME.cc:2324
#10 0x0000000000793f95 in MIMEScanner::get (this=0x7f59e1e4bf18, input=..., output=..., output_shares_input=@0x7f5a198eb92f: true, eof_p=false, scan_type=MIMEScanner::FIELD)
    at MIME.cc:2432
#11 0x00000000007941d9 in mime_parser_parse (parser=0x7f59e1e4bf18, heap=0x7f5a18087000, mh=0x7f5a180870b8, real_s=0x7f5a198ebad0,
    real_e=0x7f59e1ab4000 <error: Cannot access memory at address 0x7f59e1ab4000>, must_copy_strings=false, eof=false) at MIME.cc:2508
#12 0x0000000000785644 in http_parser_parse_resp (parser=0x7f59e1e4bf10, heap=0x7f5a18087000, hh=0x7f5a18087088, start=0x7f5a198ebad0,
    end=0x7f59e1ab4000 <error: Cannot access memory at address 0x7f59e1ab4000>, must_copy_strings=false, eof=false) at HTTP.cc:1297
#13 0x000000000078bfbe in HTTPHdr::parse_resp (this=0x7f59e1e4bdd0, parser=0x7f59e1e4bf10, r=0x11eeb30, bytes_used=0x7f5a198ebb6c, eof=false) at HdrTSOnly.cc:122
#14 0x0000000000725c5d in Http2Stream::update_write_request (this=0x7f59e1e4bd00, buf_reader=0x11eeb30, write_len=28716, call_update=false) at Http2Stream.cc:592
#15 0x0000000000724364 in Http2Stream::do_io_write (this=0x7f59e1e4bd00, c=0x7f59e1dc9390, nbytes=28716, abuffer=0x11eeb30, owner=false) at Http2Stream.cc:318
#16 0x0000000000700884 in HttpTunnel::producer_run (this=0x7f59e1dc9390, p=0x7f59e1dc95a0) at HttpTunnel.cc:882
#17 0x0000000000700027 in HttpTunnel::tunnel_run (this=0x7f59e1dc9390, p_arg=0x7f59e1dc95a0) at HttpTunnel.cc:699
#18 0x000000000069ce61 in HttpSM::handle_api_return (this=0x7f59e1dc8470) at HttpSM.cc:1658
#19 0x000000000069c5ad in HttpSM::state_api_callout (this=0x7f59e1dc8470, event=60000, data=0x0) at HttpSM.cc:1522
#20 0x000000000069b804 in HttpSM::state_api_callback (this=0x7f59e1dc8470, event=60000, data=0x0) at HttpSM.cc:1310
#21 0x000000000062c5ca in TSHttpTxnReenable (txnp=0x7f59e1dc8470, event=TS_EVENT_HTTP_CONTINUE) at traffic_server/InkAPI.cc:5926
#22 0x00007f59e2e74893 in cont_rewrite_headers (contp=0x11c9f60, event=TS_EVENT_HTTP_SEND_RESPONSE_HDR, edata=0x7f59e1dc8470) at header_rewrite/header_rewrite.cc:310
#23 0x000000000061fc22 in INKContInternal::handle_event (this=0x11c9f60, event=60007, edata=0x7f59e1dc8470) at traffic_server/InkAPI.cc:1074
#24 0x000000000061694b in Continuation::handleEvent (this=0x11c9f60, event=60007, data=0x7f59e1dc8470) at /usr/local/src/trafficserver/iocore/eventsystem/I_Continuation.h:190
#25 0x00000000006205c9 in APIHook::invoke (this=0x7f5a00039fe0, event=60007, edata=0x7f59e1dc8470) at traffic_server/InkAPI.cc:1299
#26 0x000000000069c325 in HttpSM::state_api_callout (this=0x7f59e1dc8470, event=0, data=0x0) at HttpSM.cc:1454
#27 0x00000000006ac070 in HttpSM::do_api_callout_internal (this=0x7f59e1dc8470) at HttpSM.cc:5137
#28 0x00000000006b5349 in HttpSM::set_next_state (this=0x7f59e1dc8470) at HttpSM.cc:7398
#29 0x00000000006b42ee in HttpSM::call_transact_and_set_next_state (this=0x7f59e1dc8470, f=0x0) at HttpSM.cc:7167
#30 0x000000000069c89c in HttpSM::handle_api_return (this=0x7f59e1dc8470) at HttpSM.cc:1590
#31 0x000000000069c5ad in HttpSM::state_api_callout (this=0x7f59e1dc8470, event=0, data=0x0) at HttpSM.cc:1522
#32 0x00000000006ac070 in HttpSM::do_api_callout_internal (this=0x7f59e1dc8470) at HttpSM.cc:5137
#33 0x00000000006bc8cf in HttpSM::do_api_callout (this=0x7f59e1dc8470) at HttpSM.cc:365
#34 0x000000000069e595 in HttpSM::state_read_server_response_header (this=0x7f59e1dc8470, event=100, data=0x7f5a14066468) at HttpSM.cc:1979

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions