[ 
https://issues.apache.org/jira/browse/TS-3130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14218131#comment-14218131
 ] 

Alan M. Carroll commented on TS-3130:
-------------------------------------

I think we want to delay setting the buffer to NULL until the end of the 
function. I think decrementing the buffer in the {{LB_BUFFER_TOO_SMALL}} case 
is correct but we will need to return a fail to the caller. {{result_code}} 
should be still valid just before the {{return}}.

> Core dump in Logging
> --------------------
>
>                 Key: TS-3130
>                 URL: https://issues.apache.org/jira/browse/TS-3130
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Logging
>    Affects Versions: 5.0.1
>            Reporter: Sudheer Vinukonda
>            Assignee: Sudheer Vinukonda
>             Fix For: 5.2.0
>
>
> Seeing a core dump in logging when the configured log buffer is not 
> sufficient to print a log.
> Here's the gdb back trace and some useful info:
> {code}
> (gdb) bt
> #0  0x0000000000665fed in ink_atomic_increment<int, int> (mem=0x68, count=-1) 
> at ../../lib/ts/ink_atomic.h:89
> #1  0x0000000000662c8e in LogObject::_checkout_write (this=0x264b6f0, 
> write_offset=0x2ba25de4b508, bytes_needed=25376) at LogObject.cc:501
> #2  0x00000000006632aa in LogObject::log (this=0x264b6f0, lad=0x2ba25de4b650, 
> text_entry=0x0) at LogObject.cc:618
> #3  0x00000000006659f6 in LogObjectManager::log (this=0x263c0e8, 
> lad=0x2ba25de4b650) at LogObject.cc:1353
> #4  0x0000000000641a74 in Log::access (lad=0x2ba25de4b650) at Log.cc:1096
> #5  0x00000000005bab9b in HttpBodyTemplate::build_instantiated_buffer 
> (this=0x2a1ccc0, context=0x2ba4540c4a78, buflen_return=0x2ba25de4c1c8) at 
> HttpBodyFactory.cc:1011
> #6  0x00000000005b92a0 in HttpBodyFactory::fabricate (this=0x29f8820, 
> acpt_language_list=0x2ba25de4bd60, acpt_charset_list=0x2ba25de4bc00, 
> type=0x78c323 "urlrouting#no_mapping", context=0x2ba4540c4a78, 
>     buffer_length_return=0x2ba25de4c1c8, 
> content_language_return=0x2ba25de4bed8, 
> content_charset_return=0x2ba25de4bed0, set_return=0x2ba25de4bec8) at 
> HttpBodyFactory.cc:448
> #7  0x00000000005b8422 in HttpBodyFactory::fabricate_with_old_api(const char 
> *, HttpTransact::State *, int64_t, int64_t *, char *, size_t, char *, size_t, 
> const char *, typedef __va_list_tag __va_list_tag *) (
>     this=0x29f8820, type=0x78c323 "urlrouting#no_mapping", 
> context=0x2ba4540c4a78, max_buffer_length=8192, 
> resulting_buffer_length=0x2ba25de4c1c8, 
> content_language_out_buf=0x2ba25de4c090 "en", 
>     content_language_buf_size=256, content_type_out_buf=0x2ba25de4bf90 
> "text/html", content_type_buf_size=256, format=0x0, ap=0x2ba25de4c1d0) at 
> HttpBodyFactory.cc:138
> #8  0x00000000006091fe in HttpTransact::build_error_response 
> (s=0x2ba4540c4a78, status_code=HTTP_STATUS_NOT_FOUND, 
> reason_phrase_or_null=0x78c339 "Not Found on Accelerator", 
>     error_body_type=0x78c323 "urlrouting#no_mapping", format=0x0) at 
> HttpTransact.cc:8071
> #9  0x00000000005eab76 in HttpTransact::EndRemapRequest (s=0x2ba4540c4a78) at 
> HttpTransact.cc:925
> #10 0x00000000005ddbfd in HttpSM::call_transact_and_set_next_state 
> (this=0x2ba4540c4a10, f=0) at HttpSM.cc:6834
> #11 0x00000000005ddee4 in HttpSM::set_next_state (this=0x2ba4540c4a10) at 
> HttpSM.cc:6892
> #12 0x00000000005ddd3a in HttpSM::call_transact_and_set_next_state 
> (this=0x2ba4540c4a10, f=0) at HttpSM.cc:6842
> #13 0x00000000005cc2b3 in HttpSM::handle_api_return (this=0x2ba4540c4a10) at 
> HttpSM.cc:1507
> #14 0x00000000005cc110 in HttpSM::state_api_callout (this=0x2ba4540c4a10, 
> event=0, data=0x0) at HttpSM.cc:1439
> #15 0x00000000005d7605 in HttpSM::do_api_callout_internal 
> (this=0x2ba4540c4a10) at HttpSM.cc:4800
> #16 0x00000000005e4010 in HttpSM::do_api_callout (this=0x2ba4540c4a10) at 
> HttpSM.cc:445
> #17 0x00000000005ddda0 in HttpSM::set_next_state (this=0x2ba4540c4a10) at 
> HttpSM.cc:6876
> #18 0x00000000005ddd3a in HttpSM::call_transact_and_set_next_state 
> (this=0x2ba4540c4a10, f=0) at HttpSM.cc:6842
> #19 0x00000000005cc2b3 in HttpSM::handle_api_return (this=0x2ba4540c4a10) at 
> HttpSM.cc:1507
> #20 0x00000000005cc110 in HttpSM::state_api_callout (this=0x2ba4540c4a10, 
> event=0, data=0x0) at HttpSM.cc:1439
> #21 0x00000000005d7605 in HttpSM::do_api_callout_internal 
> (this=0x2ba4540c4a10) at HttpSM.cc:4800
> #22 0x00000000005e4010 in HttpSM::do_api_callout (this=0x2ba4540c4a10) at 
> HttpSM.cc:445
> #23 0x00000000005ddda0 in HttpSM::set_next_state (this=0x2ba4540c4a10) at 
> HttpSM.cc:6876
> #24 0x00000000005ddd3a in HttpSM::call_transact_and_set_next_state 
> (this=0x2ba4540c4a10, f=0x5ec2ce 
> <HttpTransact::ModifyRequest(HttpTransact::State*)>) at HttpSM.cc:6842
> #25 0x00000000005ca241 in HttpSM::state_read_client_request_header 
> (this=0x2ba4540c4a10, event=100, data=0x2ba2e54a5e80) at HttpSM.cc:763
> #26 0x00000000005cf652 in HttpSM::main_handler (this=0x2ba4540c4a10, 
> event=100, data=0x2ba2e54a5e80) at HttpSM.cc:2500
> #27 0x00000000004f4f18 in Continuation::handleEvent (this=0x2ba4540c4a10, 
> event=100, data=0x2ba2e54a5e80) at ../iocore/eventsystem/I_Continuation.h:146
> #28 0x0000000000732faf in read_signal_and_update (event=100, 
> vc=0x2ba2e54a5d70) at UnixNetVConnection.cc:138
> #29 0x000000000073570a in UnixNetVConnection::readSignalAndUpdate 
> (this=0x2ba2e54a5d70, event=100) at UnixNetVConnection.cc:914
> #30 0x0000000000720970 in SSLNetVConnection::net_read_io 
> (this=0x2ba2e54a5d70, nh=0x2ba25c538bc0, lthread=0x2ba25c535010) at 
> SSLNetVConnection.cc:298
> #31 0x000000000072d02e in NetHandler::mainNetEvent (this=0x2ba25c538bc0, 
> event=5, e=0x24269d0) at UnixNet.cc:399
> #32 0x00000000004f4f18 in Continuation::handleEvent (this=0x2ba25c538bc0, 
> event=5, data=0x24269d0) at ../iocore/eventsystem/I_Continuation.h:146
> #33 0x0000000000753d62 in EThread::process_event (this=0x2ba25c535010, 
> e=0x24269d0, calling_code=5) at UnixEThread.cc:145
> #34 0x000000000075426c in EThread::execute (this=0x2ba25c535010) at 
> UnixEThread.cc:269
> #35 0x00000000007532c0 in spawn_thread_internal (a=0x270e390) at Thread.cc:88
> #36 0x00002ba1a9163851 in start_thread () from /lib64/libpthread.so.0
> #37 0x0000003804ae890d in clone () from /lib64/libc.so.6
> {code}
> {code}
> (gdb) print buffer
> $1 = (LogBuffer *) 0x0
> (gdb) print decremented
> $2 = false
> (gdb) print old_h
> $3 = {s = {pointer = 0x2ba2f6b0a8d0, version = 0}, data = 
> 0x000000000000000000002ba2f6b0a8d0}
> (gdb) print h
> $4 = {s = {pointer = 0x2ba2e1b2dc10, version = 0}, data = 
> 0x000000000000000000002ba2e1b2dc10}
> (gdb) print m_log_buffer
> $5 = {s = {pointer = 0x2ba328b536d0, version = 0}, data = 
> 0x000000000000000000002ba328b536d0}
> (gdb) print result
> $6 = 1
> (gdb) print result_code
> $7 = LogBuffer::LB_BUFFER_TOO_SMALL
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to