Skip to content

Conversation

@maskit
Copy link
Member

@maskit maskit commented Nov 9, 2013

We are translating documents and we need this hack to host the translated documents on Read the Docs.

We are doing translation in this way however RTD doesn't generate .mo files from .po files. So we have to generate it ourselves. (Or we can add .mo binary files to repo but it's nonsense.)
http://sphinx-doc.org/latest/intl.html

After merging, you need to configure settings of RTD.

  • Enable Use virtualenv
  • Enable Use system packages
  • Specify Requirements file doc/pip_requirements.txt

That's it.

Also, I sent some pull-request to RTD and it's merged. It enables hosting documents in multiple language on same domain, means we can access both of below:
http://trafficserver.readthedocs.org/en/latest/
http://trafficserver.readthedocs.org/ja/latest/

To use this feature, you can set this project as one of translations on RTD.
https://readthedocs.org/projects/trafficserver-ja/

@jpeach
Copy link
Contributor

jpeach commented Nov 9, 2013

Merged. Thanks!

@asfgit asfgit merged commit b7da73d into apache:master Nov 9, 2013
@maskit maskit deleted the doc-i18n branch November 10, 2013 22:20
asfgit pushed a commit that referenced this pull request Feb 26, 2014
We need 'sphinx-intl' and sphinx 1.2 or higher.
- sphinx-intl: https://pypi.python.org/pypi/sphinx-intl

The build commands are following:
  $ cd doc
  $ sphinx-intl build -p locale/ -l ja
  $ sphinx-build -b html -D language=ja . ./build

On the ReadTheDocs, we need only 'polib'. This settings has already
been proposed and merged in the apache/trafficserver #13.
But this works only in the ReadTheDocs environment. So, using sphinx-intl
is easier.

Authors: Masaori Koshiba <masaori335@gmail.com>
         Masakazu Kitajo <m4sk17@gmail.com>
         syucream <syucream1031@gmail.com>
asfgit pushed a commit that referenced this pull request Mar 2, 2014
We need 'sphinx-intl' and sphinx 1.2 or higher.
- sphinx-intl: https://pypi.python.org/pypi/sphinx-intl

The build commands are following:
  $ cd doc
  $ sphinx-intl build -p locale/ -l ja
  $ sphinx-build -b html -D language=ja . ./build

On the ReadTheDocs, we need only 'polib'. This settings has already
been proposed and merged in the apache/trafficserver #13.
But this works only in the ReadTheDocs environment. So, using sphinx-intl
is easier.

Authors: Masaori Koshiba <masaori335@gmail.com>
         Masakazu Kitajo <m4sk17@gmail.com>
         syucream <syucream1031@gmail.com>

(cherry picked from commit 461008e)

Conflicts:
	CHANGES
hnakamur pushed a commit to hnakamur/trafficserver that referenced this pull request Jan 1, 2016
…ation_remap.config

Translate configuration/remap.config
iake123 added a commit to iake123/trafficserver that referenced this pull request Mar 8, 2017
(gdb) bt
#0  0x000000000058e4db in _acquire_session (bucket=0x11c0, ip=0x2ae24f9006d0, hostname_hash=..., sm=0x2ae24f900000) at HttpSessionManager.cc:234
apache#1  0x000000000058e97b in HttpSessionManager::acquire_session (this=0xc77b60 <httpSessionManager>, cont=0x2ae24f900000, ip=0x2ae24f9006d0, hostname=0x2ae24fa80019 "127.0.0.1", ua_session=0x2ae243e60000, sm=0x2ae24f900000)
    at HttpSessionManager.cc:317
apache#2  0x000000000059d960 in HttpSM::do_http_server_open (this=0x2ae24f900000, raw=false) at HttpSM.cc:4587
apache#3  0x00000000005a5421 in HttpSM::set_next_state (this=0x2ae24f900000) at HttpSM.cc:7091
apache#4  0x00000000005a4941 in HttpSM::call_transact_and_set_next_state (this=0x2ae24f900000, f=0x0) at HttpSM.cc:6925
apache#5  0x00000000005969f3 in HttpSM::state_cache_open_write (this=0x2ae24f900000, event=1108, data=0x2ae243ee0000) at HttpSM.cc:2564
apache#6  0x0000000000597228 in HttpSM::main_handler (this=0x2ae24f900000, event=1108, data=0x2ae243ee0000) at HttpSM.cc:2683
apache#7  0x000000000050a288 in Continuation::handleEvent (this=0x2ae24f900000, event=1108, data=0x2ae243ee0000) at ../iocore/eventsystem/I_Continuation.h:146
apache#8  0x000000000057f7e6 in HttpCacheSM::state_cache_open_write (this=0x2ae24f901808, event=1108, data=0x2ae243ee0000) at HttpCacheSM.cc:180
apache#9  0x000000000050a288 in Continuation::handleEvent (this=0x2ae24f901808, event=1108, data=0x2ae243ee0000) at ../iocore/eventsystem/I_Continuation.h:146
apache#10 0x00000000006fdf28 in CacheVC::callcont (this=0x2ae243ee0000, event=1108) at P_CacheInternal.h:837
apache#11 0x00000000007058b3 in Cache::open_write (this=0x835e160, cont=0x2ae24f901808, key=0x2ae1bf337ea0, info=0x0, apin_in_cache=0, key1=0x0, type=CACHE_FRAG_TYPE_HTTP,
    hostname=0x2ae24f88000b "127.0.0.1:57890/synthetic.txt HTTP/1.0\r\n\r\n", host_len=9) at CacheWrite.cc:1823
apache#12 0x00000000006df28a in Cache::open_write (this=0x835e160, cont=0x2ae24f901808, url=0x2ae24f900750, request=0x2ae24f900738, old_info=0x0, pin_in_cache=0, type=CACHE_FRAG_TYPE_HTTP) at P_CacheInternal.h:1281
apache#13 0x00000000006db86c in CacheProcessor::open_write (this=0x11b56e0 <cacheProcessor>, cont=0x2ae24f901808, expected_size=0, url=0x2ae24f900750, cluster_cache_local=true, request=0x2ae24f900738, old_info=0x0, pin_in_cache=0,
    type=CACHE_FRAG_TYPE_HTTP) at Cache.cc:3991
apache#14 0x000000000057fc9b in HttpCacheSM::open_write (this=0x2ae24f901808, url=0x2ae24f900750, request=0x2ae24f900738, old_info=0x0, pin_in_cache=0, retry=true, allow_multiple=false) at HttpCacheSM.cc:335
apache#15 0x000000000059d2d9 in HttpSM::do_cache_prepare_action (this=0x2ae24f900000, c_sm=0x2ae24f901808, object_read_info=0x0, retry=true, allow_multiple=false) at HttpSM.cc:4490
apache#16 0x00000000005ab9da in HttpSM::do_cache_prepare_write (this=0x2ae24f900000) at HttpSM.cc:4404
apache#17 0x00000000005a57d5 in HttpSM::set_next_state (this=0x2ae24f900000) at HttpSM.cc:7179
apache#18 0x00000000005a4941 in HttpSM::call_transact_and_set_next_state (this=0x2ae24f900000, f=0x0) at HttpSM.cc:6925
apache#19 0x0000000000593e8f in HttpSM::handle_api_return (this=0x2ae24f900000) at HttpSM.cc:1611
apache#20 0x000000000059e298 in HttpSM::do_api_callout_internal (this=0x2ae24f900000) at HttpSM.cc:4783
apache#21 0x00000000005ab93c in HttpSM::do_api_callout (this=0x2ae24f900000) at HttpSM.cc:576
apache#22 0x00000000005ab97e in HttpSM::setup_cache_lookup_complete_api (this=0x2ae24f900000) at HttpSM.cc:2573
apache#23 0x0000000000596e95 in HttpSM::state_cache_open_read (this=0x2ae24f900000, event=1103, data=0xffffffffffffb050) at HttpSM.cc:2630
apache#24 0x0000000000597228 in HttpSM::main_handler (this=0x2ae24f900000, event=1103, data=0xffffffffffffb050) at HttpSM.cc:2683
apache#25 0x000000000050a288 in Continuation::handleEvent (this=0x2ae24f900000, event=1103, data=0xffffffffffffb050) at ../iocore/eventsystem/I_Continuation.h:146
apache#26 0x000000000057f61d in HttpCacheSM::state_cache_open_read (this=0x2ae24f901808, event=1103, data=0xffffffffffffb050) at HttpCacheSM.cc:145
apache#27 0x000000000050a288 in Continuation::handleEvent (this=0x2ae24f901808, event=1103, data=0xffffffffffffb050) at ../iocore/eventsystem/I_Continuation.h:146
apache#28 0x00000000006f8415 in Cache::open_read (this=0x835e160, cont=0x2ae24f901808, key=0x2ae1bf3385b0, request=0x2ae24f900738, params=0x2ae24f900108, type=CACHE_FRAG_TYPE_HTTP,
    hostname=0x2ae24f88000b "127.0.0.1:57890/synthetic.txt HTTP/1.0\r\n\r\n", host_len=9) at CacheRead.cc:162
apache#29 0x00000000006df1f9 in Cache::open_read (this=0x835e160, cont=0x2ae24f901808, url=0x2ae24f900750, request=0x2ae24f900738, params=0x2ae24f900108, type=CACHE_FRAG_TYPE_HTTP) at P_CacheInternal.h:1262
apache#30 0x00000000006db738 in CacheProcessor::open_read (this=0x11b56e0 <cacheProcessor>, cont=0x2ae24f901808, url=0x2ae24f900750, cluster_cache_local=1, request=0x2ae24f900738, params=0x2ae24f900108, pin_in_cache=0,
    type=CACHE_FRAG_TYPE_HTTP) at Cache.cc:3967
apache#31 0x000000000057f969 in HttpCacheSM::do_cache_open_read (this=0x2ae24f901808) at HttpCacheSM.cc:233
apache#32 0x000000000057fa55 in HttpCacheSM::open_read (this=0x2ae24f901808, url=0x2ae24f900750, hdr=0x2ae24f900738, params=0x2ae24f900108, pin_in_cache=0) at HttpCacheSM.cc:265
apache#33 0x000000000059ccf2 in HttpSM::do_cache_lookup_and_read (this=0x2ae24f900000) at HttpSM.cc:4349
apache#34 0x00000000005a5264 in HttpSM::set_next_state (this=0x2ae24f900000) at HttpSM.cc:7055
apache#35 0x00000000005a4941 in HttpSM::call_transact_and_set_next_state (this=0x2ae24f900000, f=0x0) at HttpSM.cc:6925
apache#36 0x0000000000593e8f in HttpSM::handle_api_return (this=0x2ae24f900000) at HttpSM.cc:1611
apache#37 0x000000000059e298 in HttpSM::do_api_callout_internal (this=0x2ae24f900000) at HttpSM.cc:4783
apache#38 0x00000000005ab93c in HttpSM::do_api_callout (this=0x2ae24f900000) at HttpSM.cc:576
apache#39 0x00000000005a49b0 in HttpSM::set_next_state (this=0x2ae24f900000) at HttpSM.cc:6959
apache#40 0x00000000005a4941 in HttpSM::call_transact_and_set_next_state (this=0x2ae24f900000, f=0x0) at HttpSM.cc:6925
apache#41 0x0000000000595ff6 in HttpSM::state_hostdb_reverse_lookup (this=0x2ae24f900000, event=500, data=0x0) at HttpSM.cc:2313
apache#42 0x0000000000597228 in HttpSM::main_handler (this=0x2ae24f900000, event=500, data=0x0) at HttpSM.cc:2683
apache#43 0x000000000050a288 in Continuation::handleEvent (this=0x2ae24f900000, event=500, data=0x0) at ../iocore/eventsystem/I_Continuation.h:146
apache#44 0x000000000067399e in HostDBContinuation::probeEvent (this=0x2ae24fb48000, event=1, e=0x2ae1bff5bf60) at HostDB.cc:2018
apache#45 0x000000000050a288 in Continuation::handleEvent (this=0x2ae24fb48000, event=1, data=0x2ae1bff5bf60) at ../iocore/eventsystem/I_Continuation.h:146
apache#46 0x000000000074758d in EThread::process_event (this=0x2ae1bf13a010, e=0x2ae1bff5bf60, calling_code=1) at UnixEThread.cc:142
apache#47 0x000000000074775e in EThread::execute (this=0x2ae1bf13a010) at UnixEThread.cc:193
apache#48 0x0000000000746820 in spawn_thread_internal (a=0x2a168d0) at Thread.cc:88
apache#49 0x00002ae1a6ab7df5 in start_thread () from /lib64/libpthread.so.0
apache#50 0x00002ae1a96d71ad in clone () from /lib64/libc.so.6
iake123 added a commit to iake123/trafficserver that referenced this pull request Mar 8, 2017
#0  0x00002b2b2524d5d7 in raise () from /lib64/libc.so.6
apache#1  0x00002b2b2524ecc8 in abort () from /lib64/libc.so.6
apache#2  0x00002b2b226fd5e8 in ink_die_die_die (retval=1) at ink_error.cc:43
apache#3  0x00002b2b226fd6c9 in ink_fatal_va(int, const char *, typedef __va_list_tag __va_list_tag *) (return_code=1, message_format=0x2b2b2271aee0 "%s:%d: failed assert `%s`", ap=0x2b2b32547ee8) at ink_error.cc:65
apache#4  0x00002b2b226fd76e in ink_fatal (return_code=1, message_format=0x2b2b2271aee0 "%s:%d: failed assert `%s`") at ink_error.cc:73
apache#5  0x00002b2b226fc4c0 in _ink_assert (expression=0x74e1b8 "sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS", file=0x74df7d "InkAPI.cc", line=3872) at ink_assert.cc:38
apache#6  0x00000000005116c7 in _TSReleaseAssert (text=0x74e1b8 "sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS", file=0x74df7d "InkAPI.cc", line=3872) at InkAPI.cc:413
apache#7  0x000000000051a04d in TSHttpHdrStatusGet (bufp=0x2b2b58280450, obj=0x2b2b6c10c088) at InkAPI.cc:3872
apache#8  0x00002b2b500025ce in TSInvalidUrlCache (pstArray=0x2ecf8a0, txnp=0x2b2b5b680e40) at cachestatus.cc:342
apache#9  0x00002b2b50002824 in status_hook (contp=0x2b2b226671e0, event=TS_EVENT_HTTP_CACHE_LOOKUP_COMPLETE, edata=0x2b2b5b680e40) at cachestatus.cc:388
apache#10 0x0000000000512557 in INKContInternal::handle_event (this=0x2b2b226671e0, event=60015, edata=0x2b2b5b680e40) at InkAPI.cc:1009
apache#11 0x000000000050a018 in Continuation::handleEvent (this=0x2b2b226671e0, event=60015, data=0x2b2b5b680e40) at ../iocore/eventsystem/I_Continuation.h:146
apache#12 0x0000000000512d71 in APIHook::invoke (this=0x2b2b226bdf40, event=60015, edata=0x2b2b5b680e40) at InkAPI.cc:1228
apache#13 0x0000000000593071 in HttpSM::state_api_callout (this=0x2b2b5b680e40, event=0, data=0x0) at HttpSM.cc:1469
apache#14 0x000000000059da01 in HttpSM::do_api_callout_internal (this=0x2b2b5b680e40) at HttpSM.cc:4833
apache#15 0x00000000005aaf2c in HttpSM::do_api_callout (this=0x2b2b5b680e40) at HttpSM.cc:576
apache#16 0x00000000005a3fa0 in HttpSM::set_next_state (this=0x2b2b5b680e40) at HttpSM.cc:6955
apache#17 0x00000000005a3f31 in HttpSM::call_transact_and_set_next_state (this=0x2b2b5b680e40, f=0x0) at HttpSM.cc:6921
apache#18 0x00000000005934af in HttpSM::handle_api_return (this=0x2b2b5b680e40) at HttpSM.cc:1611
apache#19 0x00000000005932e1 in HttpSM::state_api_callout (this=0x2b2b5b680e40, event=0, data=0x0) at HttpSM.cc:1543
apache#20 0x000000000059da01 in HttpSM::do_api_callout_internal (this=0x2b2b5b680e40) at HttpSM.cc:4833
apache#21 0x00000000005aaf2c in HttpSM::do_api_callout (this=0x2b2b5b680e40) at HttpSM.cc:576
apache#22 0x00000000005a3fa0 in HttpSM::set_next_state (this=0x2b2b5b680e40) at HttpSM.cc:6955
apache#23 0x00000000005a3f31 in HttpSM::call_transact_and_set_next_state (this=0x2b2b5b680e40, f=0x5b94b8 <HttpTransact::HandleCacheOpenRead(HttpTransact::State*)>) at HttpSM.cc:6921
apache#24 0x00000000005962f6 in HttpSM::state_cache_open_read (this=0x2b2b5b680e40, event=1102, data=0x2b2b52acf800) at HttpSM.cc:2612
apache#25 0x0000000000596838 in HttpSM::main_handler (this=0x2b2b5b680e40, event=1102, data=0x2b2b52acf800) at HttpSM.cc:2682
apache#26 0x000000000050a018 in Continuation::handleEvent (this=0x2b2b5b680e40, event=1102, data=0x2b2b52acf800) at ../iocore/eventsystem/I_Continuation.h:146
apache#27 0x000000000057ec8f in HttpCacheSM::state_cache_open_read (this=0x2b2b5b682648, event=1102, data=0x2b2b52acf800) at HttpCacheSM.cc:121
apache#28 0x000000000050a018 in Continuation::handleEvent (this=0x2b2b5b682648, event=1102, data=0x2b2b52acf800) at ../iocore/eventsystem/I_Continuation.h:146
apache#29 0x00000000006fcb5a in CacheVC::callcont (this=0x2b2b52acf800, event=1102) at P_CacheInternal.h:839
apache#30 0x00000000006fb300 in CacheVC::openReadStartEarliest (this=0x2b2b52acf800, event=3900, e=0x0) at CacheRead.cc:1020
apache#31 0x000000000050a018 in Continuation::handleEvent (this=0x2b2b52acf800, event=3900, data=0x0) at ../iocore/eventsystem/I_Continuation.h:146
apache#32 0x00000000006fb245 in CacheVC::openReadStartEarliest (this=0x2b2b52acf800, event=1182, e=0x2b2b226d40c0) at CacheRead.cc:1015
apache#33 0x00000000006f7ac5 in CacheVC::openReadFromWriterHead (this=0x2b2b52acf800, event=1182, e=0x2b2b226d40c0) at CacheRead.cc:342
apache#34 0x000000000050a018 in Continuation::handleEvent (this=0x2b2b52acf800, event=1182, data=0x2b2b226d40c0) at ../iocore/eventsystem/I_Continuation.h:146
apache#35 0x00000000006f7e3a in CacheVC::handleReadFromWriter (this=0x2b2b52acf800, event=1182, e=0x2b2b226d40c0) at CacheRead.cc:390
apache#36 0x000000000050a018 in Continuation::handleEvent (this=0x2b2b52acf800, event=1182, data=0x2b2b226d40c0) at ../iocore/eventsystem/I_Continuation.h:146
apache#37 0x0000000000745c7d in EThread::process_event (this=0x2b2b3234a010, e=0x2b2b226d40c0, calling_code=1182) at UnixEThread.cc:142
apache#38 0x0000000000745e4e in EThread::execute (this=0x2b2b3234a010) at UnixEThread.cc:193
apache#39 0x0000000000744f10 in spawn_thread_internal (a=0x2d84f30) at Thread.cc:88
apache#40 0x00002b2b22934df5 in start_thread () from /lib64/libpthread.so.0
apache#41 0x00002b2b2530e1ad in clone () from /lib64/libc.so.6
@scw00 scw00 mentioned this pull request Jun 16, 2017
chassell pushed a commit to chassell/trafficserver that referenced this pull request Sep 25, 2017
Changes HttpSM for debugging HttpSM crashes in Seattle
@SolidWallOfCode SolidWallOfCode added this to the Docs milestone Jan 7, 2019
@hankai17 hankai17 mentioned this pull request Nov 22, 2019
@traeak traeak mentioned this pull request May 9, 2023
bneradt added a commit to bneradt/trafficserver that referenced this pull request Feb 15, 2024
ATS seems to not be able to keep up with this. Killing ATS after the
dropped messages also triggers ASan to report the following leak:

=================================================================
==37422==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 19 byte(s) in 2 object(s) allocated from:
    #0 0xffff956a57b0 in malloc (/lib64/libasan.so.8+0xc57b0) (BuildId: 3109905b64795755dad05d7bb29ad23633a06660)
    #1 0x9218e4 in ats_malloc(unsigned long) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/tscore/ink_memory.cc:65
    #2 0xc215d4 in Http2ConnectionState::rcv_headers_frame(Http2Frame const&) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2ConnectionState.cc:421
    #3 0xc2d5d0 in Http2ConnectionState::rcv_frame(Http2Frame const*) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2ConnectionState.cc:1392
    #4 0xc1841c in Http2CommonSession::do_complete_frame_read() /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2CommonSession.cc:325
    #5 0xc19434 in Http2CommonSession::do_process_frame_read(int, VIO*, bool) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2CommonSession.cc:387
    #6 0xc16dec in Http2CommonSession::state_start_frame_read(int, void*) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2CommonSession.cc:237
    #7 0xc6819c in Http2ServerSession::main_event_handler(int, void*) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2ServerSession.cc:184
    #8 0x8a436c in Continuation::handleEvent(int, void*) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/include/iocore/eventsystem/Continuation.h:228
    #9 0x1233998 in EThread::process_event(Event*, int) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/iocore/eventsystem/UnixEThread.cc:162
    #10 0x12346c4 in EThread::execute_regular() /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/iocore/eventsystem/UnixEThread.cc:269
    apache#11 0x1234ffc in EThread::execute() /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/iocore/eventsystem/UnixEThread.cc:348
    apache#12 0x1231824 in spawn_thread_internal /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/iocore/eventsystem/Thread.cc:68
    apache#13 0xffff94470580 in start_thread (/lib64/libc.so.6+0x90580) (BuildId: 9a495e6bf2a1c83898b8251394ab94c8ad2d15d4)
    apache#14 0xffff944dfc48 in thread_start (/lib64/libc.so.6+0xffc48) (BuildId: 9a495e6bf2a1c83898b8251394ab94c8ad2d15d4)
bneradt added a commit to bneradt/trafficserver that referenced this pull request Feb 15, 2024
ATS seems to not be able to keep up with this. Killing ATS after the
dropped messages also triggers ASan to report the following leak:

=================================================================
==37422==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 19 byte(s) in 2 object(s) allocated from:
    #0 0xffff956a57b0 in malloc (/lib64/libasan.so.8+0xc57b0) (BuildId: 3109905b64795755dad05d7bb29ad23633a06660)
    #1 0x9218e4 in ats_malloc(unsigned long) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/tscore/ink_memory.cc:65
    #2 0xc215d4 in Http2ConnectionState::rcv_headers_frame(Http2Frame const&) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2ConnectionState.cc:421
    #3 0xc2d5d0 in Http2ConnectionState::rcv_frame(Http2Frame const*) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2ConnectionState.cc:1392
    #4 0xc1841c in Http2CommonSession::do_complete_frame_read() /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2CommonSession.cc:325
    #5 0xc19434 in Http2CommonSession::do_process_frame_read(int, VIO*, bool) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2CommonSession.cc:387
    #6 0xc16dec in Http2CommonSession::state_start_frame_read(int, void*) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2CommonSession.cc:237
    #7 0xc6819c in Http2ServerSession::main_event_handler(int, void*) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2ServerSession.cc:184
    #8 0x8a436c in Continuation::handleEvent(int, void*) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/include/iocore/eventsystem/Continuation.h:228
    #9 0x1233998 in EThread::process_event(Event*, int) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/iocore/eventsystem/UnixEThread.cc:162
    #10 0x12346c4 in EThread::execute_regular() /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/iocore/eventsystem/UnixEThread.cc:269
    apache#11 0x1234ffc in EThread::execute() /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/iocore/eventsystem/UnixEThread.cc:348
    apache#12 0x1231824 in spawn_thread_internal /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/iocore/eventsystem/Thread.cc:68
    apache#13 0xffff94470580 in start_thread (/lib64/libc.so.6+0x90580) (BuildId: 9a495e6bf2a1c83898b8251394ab94c8ad2d15d4)
    apache#14 0xffff944dfc48 in thread_start (/lib64/libc.so.6+0xffc48) (BuildId: 9a495e6bf2a1c83898b8251394ab94c8ad2d15d4)
bneradt added a commit to bneradt/trafficserver that referenced this pull request Feb 15, 2024
ATS seems to not be able to keep up with this. Killing ATS after the
dropped messages also triggers ASan to report the following leak:

=================================================================
==37422==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 19 byte(s) in 2 object(s) allocated from:
    #0 0xffff956a57b0 in malloc (/lib64/libasan.so.8+0xc57b0) (BuildId: 3109905b64795755dad05d7bb29ad23633a06660)
    #1 0x9218e4 in ats_malloc(unsigned long) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/tscore/ink_memory.cc:65
    #2 0xc215d4 in Http2ConnectionState::rcv_headers_frame(Http2Frame const&) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2ConnectionState.cc:421
    #3 0xc2d5d0 in Http2ConnectionState::rcv_frame(Http2Frame const*) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2ConnectionState.cc:1392
    #4 0xc1841c in Http2CommonSession::do_complete_frame_read() /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2CommonSession.cc:325
    #5 0xc19434 in Http2CommonSession::do_process_frame_read(int, VIO*, bool) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2CommonSession.cc:387
    #6 0xc16dec in Http2CommonSession::state_start_frame_read(int, void*) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2CommonSession.cc:237
    #7 0xc6819c in Http2ServerSession::main_event_handler(int, void*) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2ServerSession.cc:184
    #8 0x8a436c in Continuation::handleEvent(int, void*) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/include/iocore/eventsystem/Continuation.h:228
    #9 0x1233998 in EThread::process_event(Event*, int) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/iocore/eventsystem/UnixEThread.cc:162
    #10 0x12346c4 in EThread::execute_regular() /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/iocore/eventsystem/UnixEThread.cc:269
    apache#11 0x1234ffc in EThread::execute() /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/iocore/eventsystem/UnixEThread.cc:348
    apache#12 0x1231824 in spawn_thread_internal /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/iocore/eventsystem/Thread.cc:68
    apache#13 0xffff94470580 in start_thread (/lib64/libc.so.6+0x90580) (BuildId: 9a495e6bf2a1c83898b8251394ab94c8ad2d15d4)
    apache#14 0xffff944dfc48 in thread_start (/lib64/libc.so.6+0xffc48) (BuildId: 9a495e6bf2a1c83898b8251394ab94c8ad2d15d4)
bneradt added a commit to bneradt/trafficserver that referenced this pull request Feb 23, 2024
ATS seems to not be able to keep up with this. Killing ATS after the
dropped messages also triggers ASan to report the following leak:

=================================================================
==37422==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 19 byte(s) in 2 object(s) allocated from:
    #0 0xffff956a57b0 in malloc (/lib64/libasan.so.8+0xc57b0) (BuildId: 3109905b64795755dad05d7bb29ad23633a06660)
    #1 0x9218e4 in ats_malloc(unsigned long) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/tscore/ink_memory.cc:65
    #2 0xc215d4 in Http2ConnectionState::rcv_headers_frame(Http2Frame const&) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2ConnectionState.cc:421
    #3 0xc2d5d0 in Http2ConnectionState::rcv_frame(Http2Frame const*) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2ConnectionState.cc:1392
    #4 0xc1841c in Http2CommonSession::do_complete_frame_read() /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2CommonSession.cc:325
    #5 0xc19434 in Http2CommonSession::do_process_frame_read(int, VIO*, bool) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2CommonSession.cc:387
    #6 0xc16dec in Http2CommonSession::state_start_frame_read(int, void*) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2CommonSession.cc:237
    #7 0xc6819c in Http2ServerSession::main_event_handler(int, void*) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/proxy/http2/Http2ServerSession.cc:184
    #8 0x8a436c in Continuation::handleEvent(int, void*) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/include/iocore/eventsystem/Continuation.h:228
    #9 0x1233998 in EThread::process_event(Event*, int) /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/iocore/eventsystem/UnixEThread.cc:162
    #10 0x12346c4 in EThread::execute_regular() /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/iocore/eventsystem/UnixEThread.cc:269
    apache#11 0x1234ffc in EThread::execute() /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/iocore/eventsystem/UnixEThread.cc:348
    apache#12 0x1231824 in spawn_thread_internal /home/bneradt/src/ts_asf_master_fix_grpc_memory_leak/src/iocore/eventsystem/Thread.cc:68
    apache#13 0xffff94470580 in start_thread (/lib64/libc.so.6+0x90580) (BuildId: 9a495e6bf2a1c83898b8251394ab94c8ad2d15d4)
    apache#14 0xffff944dfc48 in thread_start (/lib64/libc.so.6+0xffc48) (BuildId: 9a495e6bf2a1c83898b8251394ab94c8ad2d15d4)
bneradt added a commit to bneradt/trafficserver that referenced this pull request Apr 23, 2024
ASan reports a leak concerning the ImageMagick library for plugins that
link against it. The leak is associated with the ImageMagick library
itself as commenting everything out from the ATS plugin, leaving a bare
TSPluginInit, still results in the leak report. This patch suppresses
the leak report for the library we do not own and for a leak that has
not been seen to be any larger than the initialization bytes associated
with the library.

Here's the leak report this suppression file addresses:

  =================================================================
  ==18362==ERROR: LeakSanitizer: detected memory leaks

  Direct leak of 96 byte(s) in 1 object(s) allocated from:
      #0 0xffff9cf05218 in calloc (/lib64/libasan.so.8+0xc5218) (BuildId: f2ca9839b9f761d63a77efcab29bcdd4b221f3a9)
      #1 0xffff8db8273c  (<unknown module>)
      #2 0xffff8db81108  (<unknown module>)
      #3 0xffff8db811d0  (<unknown module>)
      #4 0xffff9d53fee8 in call_init /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-init.c:74
      #5 0xffff9d53fee8 in call_init /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-init.c:26
      #6 0xffff9d540008 in _dl_init /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-init.c:121
      #7 0xffff9d53c68c in __GI__dl_catch_exception /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:211
      #8 0xffff9d5461c0 in dl_open_worker /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-open.c:829
      #9 0xffff9d53c614 in __GI__dl_catch_exception /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:237
      #10 0xffff9d5465fc in _dl_open /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-open.c:905
      apache#11 0xffff9bbfbef4 in dlopen_doit (/lib64/libc.so.6+0x8bef4) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      apache#12 0xffff9d53c614 in __GI__dl_catch_exception /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:237
      apache#13 0xffff9d53c73c in _dl_catch_error /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:256
      apache#14 0xffff9bbfb924 in _dlerror_run (/lib64/libc.so.6+0x8b924) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      apache#15 0xffff9bbfbfec in dlopen@GLIBC_2.17 (/lib64/libc.so.6+0x8bfec) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      apache#16 0xffff9cea7bc4 in __interceptor_dlopen.part.0 (/lib64/libasan.so.8+0x67bc4) (BuildId: f2ca9839b9f761d63a77efcab29bcdd4b221f3a9)
      apache#17 0xfdcc88 in plugin_dso_load(char const*, void*&, void*&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/proxy/Plugin.cc:104
      apache#18 0x8bdab4 in try_loading_plugin /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1019
      apache#19 0x8be954 in verify_plugin_helper /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1078
      apache#20 0x8beac8 in cmd_verify_global_plugin /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1097
      apache#21 0x8bf354 in cmd_mode /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1270
      apache#22 0x8c57e0 in main /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:2122
      apache#23 0xffff9bba09d8 in __libc_start_call_main (/lib64/libc.so.6+0x309d8) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      apache#24 0xffff9bba0aac in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x30aac) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      apache#25 0x89346c in _start (/home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/build/src/traffic_server/traffic_server+0x89346c) (BuildId: d86c4e46554f342afeb32ab378ad7f99940d848a)

  Direct leak of 8 byte(s) in 1 object(s) allocated from:
      #0 0xffff9cf057b0 in malloc (/lib64/libasan.so.8+0xc57b0) (BuildId: f2ca9839b9f761d63a77efcab29bcdd4b221f3a9)
      #1 0xffff8db826f4  (<unknown module>)
      #2 0xffff8db96758  (<unknown module>)
      #3 0xffff8db811b0  (<unknown module>)
      #4 0xffff9d53fee8 in call_init /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-init.c:74
      #5 0xffff9d53fee8 in call_init /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-init.c:26
      #6 0xffff9d540008 in _dl_init /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-init.c:121
      #7 0xffff9d53c68c in __GI__dl_catch_exception /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:211
      #8 0xffff9d5461c0 in dl_open_worker /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-open.c:829
      #9 0xffff9d53c614 in __GI__dl_catch_exception /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:237
      #10 0xffff9d5465fc in _dl_open /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-open.c:905
      apache#11 0xffff9bbfbef4 in dlopen_doit (/lib64/libc.so.6+0x8bef4) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      apache#12 0xffff9d53c614 in __GI__dl_catch_exception /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:237
      apache#13 0xffff9d53c73c in _dl_catch_error /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:256
      apache#14 0xffff9bbfb924 in _dlerror_run (/lib64/libc.so.6+0x8b924) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      apache#15 0xffff9bbfbfec in dlopen@GLIBC_2.17 (/lib64/libc.so.6+0x8bfec) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      apache#16 0xffff9cea7bc4 in __interceptor_dlopen.part.0 (/lib64/libasan.so.8+0x67bc4) (BuildId: f2ca9839b9f761d63a77efcab29bcdd4b221f3a9)
      apache#17 0xfdcc88 in plugin_dso_load(char const*, void*&, void*&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/proxy/Plugin.cc:104
      apache#18 0x8bdab4 in try_loading_plugin /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1019
      apache#19 0x8be954 in verify_plugin_helper /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1078
      apache#20 0x8beac8 in cmd_verify_global_plugin /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1097
      apache#21 0x8bf354 in cmd_mode /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1270
      apache#22 0x8c57e0 in main /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:2122
      apache#23 0xffff9bba09d8 in __libc_start_call_main (/lib64/libc.so.6+0x309d8) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      apache#24 0xffff9bba0aac in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x30aac) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      apache#25 0x89346c in _start (/home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/build/src/traffic_server/traffic_server+0x89346c) (BuildId: d86c4e46554f342afeb32ab378ad7f99940d848a)

  SUMMARY: AddressSanitizer: 104 byte(s) leaked in 2 allocation(s).
bneradt added a commit that referenced this pull request Apr 23, 2024
ASan reports a leak concerning the ImageMagick library for plugins that
link against it. The leak is associated with the ImageMagick library
itself as commenting everything out from the ATS plugin, leaving a bare
TSPluginInit, still results in the leak report. This patch suppresses
the leak report for the library we do not own and for a leak that has
not been seen to be any larger than the initialization bytes associated
with the library.

Here's the leak report this suppression file addresses:

  =================================================================
  ==18362==ERROR: LeakSanitizer: detected memory leaks

  Direct leak of 96 byte(s) in 1 object(s) allocated from:
      #0 0xffff9cf05218 in calloc (/lib64/libasan.so.8+0xc5218) (BuildId: f2ca9839b9f761d63a77efcab29bcdd4b221f3a9)
      #1 0xffff8db8273c  (<unknown module>)
      #2 0xffff8db81108  (<unknown module>)
      #3 0xffff8db811d0  (<unknown module>)
      #4 0xffff9d53fee8 in call_init /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-init.c:74
      #5 0xffff9d53fee8 in call_init /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-init.c:26
      #6 0xffff9d540008 in _dl_init /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-init.c:121
      #7 0xffff9d53c68c in __GI__dl_catch_exception /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:211
      #8 0xffff9d5461c0 in dl_open_worker /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-open.c:829
      #9 0xffff9d53c614 in __GI__dl_catch_exception /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:237
      #10 0xffff9d5465fc in _dl_open /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-open.c:905
      #11 0xffff9bbfbef4 in dlopen_doit (/lib64/libc.so.6+0x8bef4) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #12 0xffff9d53c614 in __GI__dl_catch_exception /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:237
      #13 0xffff9d53c73c in _dl_catch_error /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:256
      #14 0xffff9bbfb924 in _dlerror_run (/lib64/libc.so.6+0x8b924) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #15 0xffff9bbfbfec in dlopen@GLIBC_2.17 (/lib64/libc.so.6+0x8bfec) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #16 0xffff9cea7bc4 in __interceptor_dlopen.part.0 (/lib64/libasan.so.8+0x67bc4) (BuildId: f2ca9839b9f761d63a77efcab29bcdd4b221f3a9)
      #17 0xfdcc88 in plugin_dso_load(char const*, void*&, void*&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/proxy/Plugin.cc:104
      #18 0x8bdab4 in try_loading_plugin /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1019
      #19 0x8be954 in verify_plugin_helper /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1078
      #20 0x8beac8 in cmd_verify_global_plugin /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1097
      #21 0x8bf354 in cmd_mode /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1270
      #22 0x8c57e0 in main /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:2122
      #23 0xffff9bba09d8 in __libc_start_call_main (/lib64/libc.so.6+0x309d8) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #24 0xffff9bba0aac in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x30aac) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #25 0x89346c in _start (/home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/build/src/traffic_server/traffic_server+0x89346c) (BuildId: d86c4e46554f342afeb32ab378ad7f99940d848a)

  Direct leak of 8 byte(s) in 1 object(s) allocated from:
      #0 0xffff9cf057b0 in malloc (/lib64/libasan.so.8+0xc57b0) (BuildId: f2ca9839b9f761d63a77efcab29bcdd4b221f3a9)
      #1 0xffff8db826f4  (<unknown module>)
      #2 0xffff8db96758  (<unknown module>)
      #3 0xffff8db811b0  (<unknown module>)
      #4 0xffff9d53fee8 in call_init /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-init.c:74
      #5 0xffff9d53fee8 in call_init /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-init.c:26
      #6 0xffff9d540008 in _dl_init /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-init.c:121
      #7 0xffff9d53c68c in __GI__dl_catch_exception /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:211
      #8 0xffff9d5461c0 in dl_open_worker /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-open.c:829
      #9 0xffff9d53c614 in __GI__dl_catch_exception /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:237
      #10 0xffff9d5465fc in _dl_open /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-open.c:905
      #11 0xffff9bbfbef4 in dlopen_doit (/lib64/libc.so.6+0x8bef4) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #12 0xffff9d53c614 in __GI__dl_catch_exception /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:237
      #13 0xffff9d53c73c in _dl_catch_error /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:256
      #14 0xffff9bbfb924 in _dlerror_run (/lib64/libc.so.6+0x8b924) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #15 0xffff9bbfbfec in dlopen@GLIBC_2.17 (/lib64/libc.so.6+0x8bfec) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #16 0xffff9cea7bc4 in __interceptor_dlopen.part.0 (/lib64/libasan.so.8+0x67bc4) (BuildId: f2ca9839b9f761d63a77efcab29bcdd4b221f3a9)
      #17 0xfdcc88 in plugin_dso_load(char const*, void*&, void*&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/proxy/Plugin.cc:104
      #18 0x8bdab4 in try_loading_plugin /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1019
      #19 0x8be954 in verify_plugin_helper /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1078
      #20 0x8beac8 in cmd_verify_global_plugin /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1097
      #21 0x8bf354 in cmd_mode /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1270
      #22 0x8c57e0 in main /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:2122
      #23 0xffff9bba09d8 in __libc_start_call_main (/lib64/libc.so.6+0x309d8) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #24 0xffff9bba0aac in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x30aac) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #25 0x89346c in _start (/home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/build/src/traffic_server/traffic_server+0x89346c) (BuildId: d86c4e46554f342afeb32ab378ad7f99940d848a)

  SUMMARY: AddressSanitizer: 104 byte(s) leaked in 2 allocation(s).
cmcfarlen pushed a commit that referenced this pull request Apr 26, 2024
ASan reports a leak concerning the ImageMagick library for plugins that
link against it. The leak is associated with the ImageMagick library
itself as commenting everything out from the ATS plugin, leaving a bare
TSPluginInit, still results in the leak report. This patch suppresses
the leak report for the library we do not own and for a leak that has
not been seen to be any larger than the initialization bytes associated
with the library.

Here's the leak report this suppression file addresses:

  =================================================================
  ==18362==ERROR: LeakSanitizer: detected memory leaks

  Direct leak of 96 byte(s) in 1 object(s) allocated from:
      #0 0xffff9cf05218 in calloc (/lib64/libasan.so.8+0xc5218) (BuildId: f2ca9839b9f761d63a77efcab29bcdd4b221f3a9)
      #1 0xffff8db8273c  (<unknown module>)
      #2 0xffff8db81108  (<unknown module>)
      #3 0xffff8db811d0  (<unknown module>)
      #4 0xffff9d53fee8 in call_init /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-init.c:74
      #5 0xffff9d53fee8 in call_init /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-init.c:26
      #6 0xffff9d540008 in _dl_init /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-init.c:121
      #7 0xffff9d53c68c in __GI__dl_catch_exception /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:211
      #8 0xffff9d5461c0 in dl_open_worker /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-open.c:829
      #9 0xffff9d53c614 in __GI__dl_catch_exception /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:237
      #10 0xffff9d5465fc in _dl_open /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-open.c:905
      #11 0xffff9bbfbef4 in dlopen_doit (/lib64/libc.so.6+0x8bef4) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #12 0xffff9d53c614 in __GI__dl_catch_exception /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:237
      #13 0xffff9d53c73c in _dl_catch_error /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:256
      #14 0xffff9bbfb924 in _dlerror_run (/lib64/libc.so.6+0x8b924) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #15 0xffff9bbfbfec in dlopen@GLIBC_2.17 (/lib64/libc.so.6+0x8bfec) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #16 0xffff9cea7bc4 in __interceptor_dlopen.part.0 (/lib64/libasan.so.8+0x67bc4) (BuildId: f2ca9839b9f761d63a77efcab29bcdd4b221f3a9)
      #17 0xfdcc88 in plugin_dso_load(char const*, void*&, void*&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/proxy/Plugin.cc:104
      #18 0x8bdab4 in try_loading_plugin /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1019
      #19 0x8be954 in verify_plugin_helper /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1078
      #20 0x8beac8 in cmd_verify_global_plugin /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1097
      #21 0x8bf354 in cmd_mode /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1270
      #22 0x8c57e0 in main /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:2122
      #23 0xffff9bba09d8 in __libc_start_call_main (/lib64/libc.so.6+0x309d8) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #24 0xffff9bba0aac in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x30aac) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #25 0x89346c in _start (/home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/build/src/traffic_server/traffic_server+0x89346c) (BuildId: d86c4e46554f342afeb32ab378ad7f99940d848a)

  Direct leak of 8 byte(s) in 1 object(s) allocated from:
      #0 0xffff9cf057b0 in malloc (/lib64/libasan.so.8+0xc57b0) (BuildId: f2ca9839b9f761d63a77efcab29bcdd4b221f3a9)
      #1 0xffff8db826f4  (<unknown module>)
      #2 0xffff8db96758  (<unknown module>)
      #3 0xffff8db811b0  (<unknown module>)
      #4 0xffff9d53fee8 in call_init /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-init.c:74
      #5 0xffff9d53fee8 in call_init /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-init.c:26
      #6 0xffff9d540008 in _dl_init /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-init.c:121
      #7 0xffff9d53c68c in __GI__dl_catch_exception /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:211
      #8 0xffff9d5461c0 in dl_open_worker /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-open.c:829
      #9 0xffff9d53c614 in __GI__dl_catch_exception /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:237
      #10 0xffff9d5465fc in _dl_open /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-open.c:905
      #11 0xffff9bbfbef4 in dlopen_doit (/lib64/libc.so.6+0x8bef4) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #12 0xffff9d53c614 in __GI__dl_catch_exception /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:237
      #13 0xffff9d53c73c in _dl_catch_error /usr/src/debug/glibc-2.38-17.fc39.aarch64/elf/dl-catch.c:256
      #14 0xffff9bbfb924 in _dlerror_run (/lib64/libc.so.6+0x8b924) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #15 0xffff9bbfbfec in dlopen@GLIBC_2.17 (/lib64/libc.so.6+0x8bfec) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #16 0xffff9cea7bc4 in __interceptor_dlopen.part.0 (/lib64/libasan.so.8+0x67bc4) (BuildId: f2ca9839b9f761d63a77efcab29bcdd4b221f3a9)
      #17 0xfdcc88 in plugin_dso_load(char const*, void*&, void*&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/proxy/Plugin.cc:104
      #18 0x8bdab4 in try_loading_plugin /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1019
      #19 0x8be954 in verify_plugin_helper /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1078
      #20 0x8beac8 in cmd_verify_global_plugin /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1097
      #21 0x8bf354 in cmd_mode /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:1270
      #22 0x8c57e0 in main /home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/src/traffic_server/traffic_server.cc:2122
      #23 0xffff9bba09d8 in __libc_start_call_main (/lib64/libc.so.6+0x309d8) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #24 0xffff9bba0aac in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x30aac) (BuildId: 4b1e6ff6c35f7fc7bd309e5e5a1f981e2515e4f0)
      #25 0x89346c in _start (/home/bneradt/src/ts_asf_master_address_asan_unit_test_issues/build/src/traffic_server/traffic_server+0x89346c) (BuildId: d86c4e46554f342afeb32ab378ad7f99940d848a)

  SUMMARY: AddressSanitizer: 104 byte(s) leaked in 2 allocation(s).

(cherry picked from commit a2a5cbe)
bneradt added a commit to bneradt/trafficserver that referenced this pull request Dec 10, 2025
Add a destructor to the Stripe class to properly free the directory
memory allocated in _init_directory(). The memory was allocated via
ats_memalign or ats_alloc_hugepage but never freed when Stripe objects
were destroyed. A new private member tracks whether hugepages were used
so the destructor can call the appropriate free function. This was
discovered via an infrequent ASAN failure in the
cache_disk_replacement_stability regression test, which reported a ~27GB
leak from 24 StripeSM objects that went out of scope without releasing
their directory buffers.

```
=================================================================
==5207==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 29272965120 byte(s) in 24 object(s) allocated from:
    #0 0x7f8b9cd1669c in __interceptor_posix_memalign (/lib64/libasan.so.6+0xb569c)
    #1 0xa69d99 in ats_memalign(unsigned long, unsigned long) ../src/tscore/ink_memory.cc:108
    #2 0xfd96e2 in Stripe::_init_directory(unsigned long, int, int) ../src/iocore/cache/Stripe.cc:159
    #3 0xfd905f in Stripe::Stripe(CacheDisk*, long, long, int, int) ../src/iocore/cache/Stripe.cc:97
    #4 0xfdc7ef in StripeSM::StripeSM(CacheDisk*, long, long, int, int) ../src/iocore/cache/StripeSM.cc:120
    #5 0xff8c81 in std::_MakeUniq<StripeSM>::__single_object std::make_unique<StripeSM, CacheDisk*, long, int>(CacheDisk*&&, long&&, int&&) (/tmp/ats-quiche/bin/traffic_server+0xff8c81)
    #6 0xff4797 in RegressionTest_cache_disk_replacement_stability(RegressionTest*, int, int*) ../src/iocore/cache/CacheTest.cc:458
    #7 0xa4c994 in start_test ../src/tscore/Regression.cc:83
    #8 0xa4cd6c in RegressionTest::run(char const*, int) ../src/tscore/Regression.cc:106
    #9 0xa1a2a8 in mainEvent ../src/traffic_server/traffic_server.cc:1570
    #10 0x9fd61a in Continuation::handleEvent(int, void*) ../include/iocore/eventsystem/Continuation.h:228
    apache#11 0x13373e7 in EThread::process_event(Event*, int, long) ../src/iocore/eventsystem/UnixEThread.cc:171
    apache#12 0x133809c in EThread::execute_regular() ../src/iocore/eventsystem/UnixEThread.cc:288
    apache#13 0x1338a7b in EThread::execute() ../src/iocore/eventsystem/UnixEThread.cc:383
    apache#14 0x13356e8 in spawn_thread_internal ../src/iocore/eventsystem/Thread.cc:75
    apache#15 0x7f8b9abeb1c9 in start_thread (/lib64/libpthread.so.0+0x81c9)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants