You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by GitBox <gi...@apache.org> on 2020/10/29 19:19:07 UTC

[GitHub] [trafficserver] GeorgeHahn opened a new issue #7304: 9.0.x Leaks memory when origin returns 404

GeorgeHahn opened a new issue #7304:
URL: https://github.com/apache/trafficserver/issues/7304


   trafficserver 9 leaks memory when reverse proxying to an origin that returns 404.
   
   trafficserver commit: 294723fdefd86c11153b297c88bcabca7cceb7aa
   
   After 1000 requests:
   
   ```
   ==15820== 172,032 bytes in 6 blocks are definitely lost in loss record 1,668 of 1,693
   ==15820==    at 0x483E0F0: memalign (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
   ==15820==    by 0x483E212: posix_memalign (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
   ==15820==    by 0x4976BEF: ats_memalign (ink_memory.cc:102)
   ==15820==    by 0x4977D92: freelist_new(_InkFreeList*) (ink_queue.cc:216)
   ==15820==    by 0x49774D2: ink_freelist_new (ink_queue.cc:187)
   ==15820==    by 0x6A46F1: ClassAllocator<Http1ServerSession>::alloc() (Allocator.h:131)
   ==15820==    by 0x6A46A9: Http1ServerSession* thread_alloc_init<Http1ServerSession>(ClassAllocator<Http1ServerSession>&, ProxyAllocator&) (iocore/eventsystem/I_ProxyAllocator.h:73)
   ==15820==    by 0x6963F0: HttpSM::state_http_server_open(int, void*) (HttpSM.cc:1744)
   ==15820==    by 0x68E216: HttpSM::main_handler(int, void*) (HttpSM.cc:0)
   ==15820==    by 0x62D359: Continuation::handleEvent(int, void*) (I_Continuation.h:190)
   ==15820==    by 0x81223E: UnixNetVConnection::connectUp(EThread*, int) (UnixNetVConnection.cc:1306)
   ==15820==    by 0x80E198: UnixNetProcessor::connect_re_internal(Continuation*, sockaddr const*, NetVCOptions*) (UnixNetProcessor.cc:245)
   
   ...
   
   ==15820== LEAK SUMMARY:
   ==15820==    definitely lost: 172,032 bytes in 6 blocks
   ==15820==    indirectly lost: 0 bytes in 0 blocks
   ==15820==      possibly lost: 31,673,648 bytes in 120 blocks
   ==15820==    still reachable: 79,054,028 bytes in 6,973 blocks
   ==15820==                       of which reachable via heuristic:
   ==15820==                         newarray           : 11,960 bytes in 5 blocks
   ==15820==                         multipleinheritance: 8,192 bytes in 1 blocks
   ==15820==         suppressed: 0 bytes in 0 blocks
   ```
   
   ### Reproduction
   Origin: minimal server that returns 404 to all requests
   ATS remap config: `map / http://127.0.0.1:8080`. I can share other configs if they would be helpful.
   client: `for i in {1..1000}; do curl -s -i --resolve "example.com:80:127.0.0.1" http://example.com/does-not-exist; done`


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] bryancall closed issue #7304: 9.0.x Leaks memory when origin returns 404

Posted by GitBox <gi...@apache.org>.
bryancall closed issue #7304:
URL: https://github.com/apache/trafficserver/issues/7304


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] bryancall edited a comment on issue #7304: 9.0.x Leaks memory when origin returns 404

Posted by GitBox <gi...@apache.org>.
bryancall edited a comment on issue #7304:
URL: https://github.com/apache/trafficserver/issues/7304#issuecomment-726858294


   Closing for now.  I ran some benchmarks on HTTP/1.1 (with and without TLS) and HTTP/2 doing millions of requests and only saw the memory leak that I added to traffic_server's main function.
   
   Please reopen if you can still reproduce and please give details on how to reproduce it.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] bryancall commented on issue #7304: 9.0.x Leaks memory when origin returns 404

Posted by GitBox <gi...@apache.org>.
bryancall commented on issue #7304:
URL: https://github.com/apache/trafficserver/issues/7304#issuecomment-726858294


   Closing for now.  I ran some benchmarks on HTTP/1.1 (with and without TLS) and HTTP/2 doing millions of requests and only saw the memory leak that I added to traffic_server's main function.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] bryancall commented on issue #7304: 9.0.x Leaks memory when origin returns 404

Posted by GitBox <gi...@apache.org>.
bryancall commented on issue #7304:
URL: https://github.com/apache/trafficserver/issues/7304#issuecomment-725635340


   The only leak I am seeing in ATS is the one I am creating in main:
   
   ```
   12:07:11 bart:((294723fde...))~/dev/apache/trafficserver/build-Linux$ ts
   Traffic Server 9.0.0 Nov 11 2020 12:02:26 bart.bryancall.com
   traffic_server: using root directory '/opt/ats'
   ^C
   =================================================================
   ==1924225==ERROR: LeakSanitizer: detected memory leaks
   
   Direct leak of 1000 byte(s) in 1 object(s) allocated from:
       #0 0x7f70725bd3cf in __interceptor_malloc (/lib64/libasan.so.6+0xab3cf)
       #1 0x725643 in main ../../src/traffic_server/traffic_server.cc:1675
       #2 0x7f70717531a1 in __libc_start_main (/lib64/libc.so.6+0x281a1)
   
   SUMMARY: AddressSanitizer: 1000 byte(s) leaked in 1 allocation(s).
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] zwoop commented on issue #7304: 9.0.x Leaks memory when origin returns 404

Posted by GitBox <gi...@apache.org>.
zwoop commented on issue #7304:
URL: https://github.com/apache/trafficserver/issues/7304#issuecomment-725635832


   It's also dubious that the leak is in 6 blocks with 1000 requests. If it leaked on every 40x, wouldn't there be 1000 leaks?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] bryancall commented on issue #7304: 9.0.x Leaks memory when origin returns 404

Posted by GitBox <gi...@apache.org>.
bryancall commented on issue #7304:
URL: https://github.com/apache/trafficserver/issues/7304#issuecomment-725628423


   @GeorgeHahn How are you building ATS?  I am having a hard time reproducing the issue.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] zwoop edited a comment on issue #7304: 9.0.x Leaks memory when origin returns 404

Posted by GitBox <gi...@apache.org>.
zwoop edited a comment on issue #7304:
URL: https://github.com/apache/trafficserver/issues/7304#issuecomment-725635832


   It's also dubious that the leak is in 6 blocks with 1000 requests. If it leaked on every 40x, wouldn't there be 1000 leaks? This sounds more like memory being put back on the freelist, and we're not properly excluding it from ASAN ?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org