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

Shaun McGinnity commented on TS-2497:
-------------------------------------

I've applied this patch to 3.2.X but I am seeing memory growth from unreleased 
IO Buffers. Is there another patch that needs to be applied along with this?

I am running a test against a server that deliberately closes the connection 
before reading the full post content. Polling the memory statistics every 30s:

Apr 28 17:41:10 - INFO -                   0 |                  0 |      32768 
| memory/ioBufAllocator[8]
Apr 28 17:41:40 - INFO -             6291456 |            5472256 |      32768 
| memory/ioBufAllocator[8]
Apr 28 17:42:10 - INFO -            11534336 |           10616832 |      32768 
| memory/ioBufAllocator[8]
Apr 28 17:42:39 - INFO -            18874368 |           18022400 |      32768 
| memory/ioBufAllocator[8]
Apr 28 17:43:10 - INFO -            24117248 |           22970368 |      32768 
| memory/ioBufAllocator[8]
Apr 28 17:43:40 - INFO -            30408704 |           30048256 |      32768 
| memory/ioBufAllocator[8]
Apr 28 17:44:10 - INFO -            36700160 |           35454976 |      32768 
| memory/ioBufAllocator[8]
Apr 28 17:44:40 - INFO -            42991616 |           41451520 |      32768 
| memory/ioBufAllocator[8]
Apr 28 17:45:10 - INFO -            49283072 |           48103424 |      32768 
| memory/ioBufAllocator[8]
Apr 28 17:45:40 - INFO -            54525952 |           53444608 |      32768 
| memory/ioBufAllocator[8]
Apr 28 17:46:09 - INFO -            61865984 |           60358656 |      32768 
| memory/ioBufAllocator[8]
Apr 28 17:46:40 - INFO -            61865984 |           61472768 |      32768 
| memory/ioBufAllocator[8]


> Failed post results in tunnel buffers being returned to freelist prematurely
> ----------------------------------------------------------------------------
>
>                 Key: TS-2497
>                 URL: https://issues.apache.org/jira/browse/TS-2497
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>            Reporter: Brian Geffon
>            Assignee: Brian Geffon
>             Fix For: 4.2.0
>
>
> When a post fails to an origin server either the server died or the server 
> returned a response without reading all of the post data, in either case, TS 
> will destroy buffers too early. This normally does not result in a crash 
> because the MIOBuffers are returned to the freelist and only with sufficient 
> load will the race happen causing a crash. Additionally, even if a crash 
> doesn't happen you might have data corruption across post requests from the 
> buffers being used after being returned to the freelist.
> Thanks to Thomas Jackson for help reproducing and resolving this bug.
> An example stack trace, while we've seen other crashes in write_avail too.
> #0  0x00000000004eff14 in IOBufferBlock::read_avail (this=0x0) at 
> ../iocore/eventsystem/I_IOBuffer.h:362
> #1  0x000000000050d151 in MIOBuffer::append_block_internal 
> (this=0x2aab38001130, b=0x2aab0c037200) at 
> ../iocore/eventsystem/P_IOBuffer.h:946
> #2  0x000000000050d39b in MIOBuffer::append_block (this=0x2aab38001130, 
> asize_index=15) at ../iocore/eventsystem/P_IOBuffer.h:986
> #3  0x000000000050d49b in MIOBuffer::add_block (this=0x2aab38001130) at 
> ../iocore/eventsystem/P_IOBuffer.h:994
> #4  0x000000000055cee2 in MIOBuffer::check_add_block (this=0x2aab38001130) at 
> ../iocore/eventsystem/P_IOBuffer.h:1002
> #5  0x000000000055d115 in MIOBuffer::write_avail (this=0x2aab38001130) at 
> ../iocore/eventsystem/P_IOBuffer.h:1048
> #6  0x00000000006c18f3 in read_from_net (nh=0x2aaafca0d208, 
> vc=0x2aab1c009140, thread=0x2aaafca0a010) at UnixNetVConnection.cc:234
> #7  0x00000000006c37bf in UnixNetVConnection::net_read_io 
> (this=0x2aab1c009140, nh=0x2aaafca0d208, lthread=0x2aaafca0a010) at 
> UnixNetVConnection.cc:816
> #8  0x00000000006be392 in NetHandler::mainNetEvent (this=0x2aaafca0d208, 
> event=5, e=0x271d8e0) at UnixNet.cc:380
> #9  0x00000000004f05c4 in Continuation::handleEvent (this=0x2aaafca0d208, 
> event=5, data=0x271d8e0) at ../iocore/eventsystem/I_Continuation.h:146
> #10 0x00000000006e361e in EThread::process_event (this=0x2aaafca0a010, 
> e=0x271d8e0, calling_code=5) at UnixEThread.cc:142
> #11 0x00000000006e3b13 in EThread::execute (this=0x2aaafca0a010) at 
> UnixEThread.cc:264
> #12 0x00000000006e290b in spawn_thread_internal (a=0x2716400) at Thread.cc:88
> #13 0x0000003372c077e1 in start_thread () from /lib64/libpthread.so.0
> #14 0x00000033728e68ed in clone () from /lib64/libc.so.6



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to