versatica / mediasoup

Cutting Edge WebRTC Video Conferencing
https://mediasoup.org
ISC License
6.27k stars 1.13k forks source link

CI: Run worker tests with Address Sanitizer (only Linux) #1416

Closed ibc closed 4 months ago

ibc commented 4 months ago

Details

Bonus Tracks

Related PRs this PR replaces

ibc commented 4 months ago

TODO 1 (FIXED)

(Fixed in https://github.com/versatica/mediasoup/pull/1416/commits/ad3817c99110c470ca8734089ccf7555f4d8dc5e)

When running (in Linux Docker) invoke test-asan-address:

cd "/mediasoup/worker" && ASAN_OPTIONS=detect_leaks=1 "/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address" --invisibles
AddressSanitizer:DEADLYSIGNAL
=================================================================
==5092==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0xaaaab187ab30 bp 0xffffdb3cf5d0 sp 0xffffdb3cf5d0 T0)
==5092==The signal is caused by a READ memory access.
==5092==Hint: address points to the zero page.
    #0 0xaaaab187ab30 in void absl::lts_20230802::container_internal::InitializeSlots<std::allocator<char>, 40ul, 8ul>(absl::lts_20230802::container_internal::CommonFields&, std::allocator<char>) (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x21ab30) (BuildId: 6b9fcd5d12bc7c25c379f76e7292ff0692fe990c)
    #1 0xaaaab188d448 in absl::lts_20230802::container_internal::raw_hash_set<absl::lts_20230802::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, LogLevel>, absl::lts_20230802::container_internal::StringHash, absl::lts_20230802::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, LogLevel> > >::raw_hash_set(unsigned long, absl::lts_20230802::container_internal::StringHash const&, absl::lts_20230802::container_internal::StringEq const&, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, LogLevel> > const&) (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x22d448) (BuildId: 6b9fcd5d12bc7c25c379f76e7292ff0692fe990c)
    #2 0xaaaab188d030 in absl::lts_20230802::container_internal::raw_hash_set<absl::lts_20230802::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, LogLevel>, absl::lts_20230802::container_internal::StringHash, absl::lts_20230802::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, LogLevel> > >::raw_hash_set(std::initializer_list<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, LogLevel> >, unsigned long, absl::lts_20230802::container_internal::StringHash const&, absl::lts_20230802::container_internal::StringEq const&, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, LogLevel> > const&) (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x22d030) (BuildId: 6b9fcd5d12bc7c25c379f76e7292ff0692fe990c)
    #3 0xaaaab17b1408 in _GLOBAL__sub_I_Settings.cpp Settings.cpp
    #4 0xffffa43a7548 in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x27548) (BuildId: aa6e122fa39ae02d412afb49d75e33281fcd2805)
    #5 0xaaaab17c7fec in _start (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x167fec) (BuildId: 6b9fcd5d12bc7c25c379f76e7292ff0692fe990c)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x21ab30) (BuildId: 6b9fcd5d12bc7c25c379f76e7292ff0692fe990c) in void absl::lts_20230802::container_internal::InitializeSlots<std::allocator<char>, 40ul, 8ul>(absl::lts_20230802::container_internal::CommonFields&, std::allocator<char>)
==5092==ABORTING
ibc commented 4 months ago

TODO 2

When running (in Linux Docker) invoke test-asan-undefined:

cd "/mediasoup/worker" && ASAN_OPTIONS=detect_leaks=1 "/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-undefined" --invisibles
Randomness seeded to: 3112908262
../../../include/RTC/RtpPacket.hpp:131:14: runtime error: member access within misaligned address 0xaaaab13273a6 for type 'RTC::RtpPacket::Header', which requires 4 byte alignment
0xaaaab13273a6: note: pointer points here
 30 30 00 00 90 6f  5c 41 62 f5 47 da 9f 71  08 e2 be de 00 01 10 a0  00 00 67 42 e0 0d 9a 00  00 00
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../include/RTC/RtpPacket.hpp:131:14 in
../../../src/RTC/RtpPacket.cpp:35:15: runtime error: member access within misaligned address 0xaaaab13273a6 for type 'RTC::RtpPacket::Header', which requires 4 byte alignment
0xaaaab13273a6: note: pointer points here
 30 30 00 00 90 6f  5c 41 62 f5 47 da 9f 71  08 e2 be de 00 01 10 a0  00 00 67 42 e0 0d 9a 00  00 00
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../src/RTC/RtpPacket.cpp:35:15 in
../../../src/RTC/RtpPacket.cpp:53:15: runtime error: member access within misaligned address 0xaaaab13273a6 for type 'RTC::RtpPacket::Header', which requires 4 byte alignment
0xaaaab13273a6: note: pointer points here
 30 30 00 00 90 6f  5c 41 62 f5 47 da 9f 71  08 e2 be de 00 01 10 a0  00 00 67 42 e0 0d 9a 00  00 00
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../src/RTC/RtpPacket.cpp:53:15 in
../../../src/RTC/RtpPacket.cpp:88:15: runtime error: member access within misaligned address 0xaaaab13273a6 for type 'RTC::RtpPacket::Header', which requires 4 byte alignment
0xaaaab13273a6: note: pointer points here
 30 30 00 00 90 6f  5c 41 62 f5 47 da 9f 71  08 e2 be de 00 01 10 a0  00 00 67 42 e0 0d 9a 00  00 00
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../src/RTC/RtpPacket.cpp:88:15 in
../../../src/RTC/RtpPacket.cpp:142:21: runtime error: member access within misaligned address 0xaaaab13273a6 for type 'RTC::RtpPacket::Header', which requires 4 byte alignment
0xaaaab13273a6: note: pointer points here
 30 30 00 00 90 6f  5c 41 62 f5 47 da 9f 71  08 e2 be de 00 01 10 a0  00 00 67 42 e0 0d 9a 00  00 00
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../src/RTC/RtpPacket.cpp:142:21 in
../../../include/RTC/RtpPacket.hpp:175:25: runtime error: member access within misaligned address 0xaaaab13273a6 for type 'RTC::RtpPacket::Header', which requires 4 byte alignment
0xaaaab13273a6: note: pointer points here
 30 30 00 00 90 6f  5c 41 62 f5 47 da 9f 71  08 e2 be de 00 01 10 a0  00 00 67 42 e0 0d 9a 00  00 00
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../include/RTC/RtpPacket.hpp:175:25 in
../../../include/RTC/RtpPacket.hpp:165:25: runtime error: member access within misaligned address 0xaaaab13273a6 for type 'RTC::RtpPacket::Header', which requires 4 byte alignment
0xaaaab13273a6: note: pointer points here
 30 30 00 00 90 6f  5c 41 62 f5 47 da 9f 71  08 e2 be de 00 01 10 a0  00 00 67 42 e0 0d 9a 00  00 00
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../include/RTC/RtpPacket.hpp:165:25 in
../../../include/RTC/RtpPacket.hpp:190:21: runtime error: member access within misaligned address 0xaaaab13273a6 for type 'RTC::RtpPacket::Header', which requires 4 byte alignment
0xaaaab13273a6: note: pointer points here
 30 30 00 00 90 6f  5c 41 62 f5 47 da 9f 71  08 e2 be de 00 01 10 a0  00 00 67 42 e0 0d 9a 00  00 00
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../include/RTC/RtpPacket.hpp:190:21 in
../../../include/RTC/RtpPacket.hpp:200:21: runtime error: member access within misaligned address 0xaaaab13273a6 for type 'RTC::RtpPacket::Header', which requires 4 byte alignment
0xaaaab13273a6: note: pointer points here
 30 30 00 00 90 6f  5c 41 62 f5 47 da 9f 71  08 e2 be de 00 01 10 a0  00 00 67 42 e0 0d 9a 00  00 00
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../include/RTC/RtpPacket.hpp:200:21 in
../../../include/RTC/RtpPacket.hpp:200:21: runtime error: load of misaligned address 0xaaaab13273aa for type 'uint32_t' (aka 'unsigned int'), which requires 4 byte alignment
0xaaaab13273aa: note: pointer points here
 90 6f  5c 41 62 f5 47 da 9f 71  08 e2 be de 00 01 10 a0  00 00 67 42 e0 0d 9a 00  00 00 00 00 00 00
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../include/RTC/RtpPacket.hpp:200:21 in
../../../include/RTC/RtpPacket.hpp:210:21: runtime error: member access within misaligned address 0xaaaab13273a6 for type 'RTC::RtpPacket::Header', which requires 4 byte alignment
0xaaaab13273a6: note: pointer points here
 30 30 00 00 90 6f  5c 41 62 f5 47 da 9f 71  08 e2 be de 00 01 10 a0  00 00 67 42 e0 0d 9a 00  00 00
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../include/RTC/RtpPacket.hpp:210:21 in
../../../include/RTC/RtpPacket.hpp:210:21: runtime error: load of misaligned address 0xaaaab13273ae for type 'uint32_t' (aka 'unsigned int'), which requires 4 byte alignment
0xaaaab13273ae: note: pointer points here
 62 f5 47 da 9f 71  08 e2 be de 00 01 10 a0  00 00 67 42 e0 0d 9a 00  00 00 00 00 00 00 00 00  00 00
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../include/RTC/RtpPacket.hpp:210:21 in
../../../src/RTC/RTCP/Packet.cpp:220:18: runtime error: member access within misaligned address 0xaaaab1307201 for type 'RTC::RTCP::Packet::CommonHeader', which requires 2 byte alignment
0xaaaab1307201: note: pointer points here
 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../src/RTC/RTCP/Packet.cpp:220:18 in
../../../src/RTC/RTCP/Packet.cpp:221:18: runtime error: member access within misaligned address 0xaaaab1307201 for type 'RTC::RTCP::Packet::CommonHeader', which requires 2 byte alignment
0xaaaab1307201: note: pointer points here
 00 00 00  00 80 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../src/RTC/RTCP/Packet.cpp:221:18 in
../../../src/RTC/RTCP/Packet.cpp:222:18: runtime error: member access within misaligned address 0xaaaab1307201 for type 'RTC::RTCP::Packet::CommonHeader', which requires 2 byte alignment
0xaaaab1307201: note: pointer points here
 00 00 00  00 80 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../src/RTC/RTCP/Packet.cpp:222:18 in
../../../src/RTC/RTCP/Packet.cpp:223:18: runtime error: member access within misaligned address 0xaaaab1307201 for type 'RTC::RTCP::Packet::CommonHeader', which requires 2 byte alignment
0xaaaab1307201: note: pointer points here
 00 00 00  00 81 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../src/RTC/RTCP/Packet.cpp:223:18 in
../../../src/RTC/RTCP/Packet.cpp:224:18: runtime error: member access within misaligned address 0xaaaab1307201 for type 'RTC::RTCP::Packet::CommonHeader', which requires 2 byte alignment
0xaaaab1307201: note: pointer points here
 00 00 00  00 81 cd 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../src/RTC/RTCP/Packet.cpp:224:18 in
../../../src/RTC/RTCP/Packet.cpp:224:18: runtime error: store to misaligned address 0xaaaab1307203 for type 'uint16_t' (aka 'unsigned short'), which requires 2 byte alignment
0xaaaab1307203: note: pointer points here
 00  00 81 cd 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../src/RTC/RTCP/Packet.cpp:224:18 in
===============================================================================
All tests passed (592743 assertions in 47 test cases)
ibc commented 4 months ago

TODO 3

Should we also enable -sanitize='leak' (well, probably included in -satinize=address,leak? Or should ASAN_OPTIONS=detect_leaks=1 already enable it?

NOTE: If I only run -sanitize='leak' I get these errors:

==6700==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 240 byte(s) in 1 object(s) allocated from:
    #0 0xaaaabc54c830 in operator new(unsigned long) (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x1fc830) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #1 0xaaaabc5b24f8 in RTC::RtpPacket::Parse(unsigned char const*, unsigned long) (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x2624f8) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #2 0xaaaabc65a240 in RtpMyRetransmissionBuffer::Insert(unsigned short, unsigned int) (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x30a240) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #3 0xaaaabc659914 in CATCH2_INTERNAL_TEST_0() TestRtpRetransmissionBuffer.cpp
    #4 0xaaaabc942440 in Catch::RunContext::runCurrentTest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x5f2440) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #5 0xaaaabc941ef0 in Catch::RunContext::runTest(Catch::TestCaseHandle const&) (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x5f1ef0) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #6 0xaaaabc94d7fc in Catch::Session::runInternal() (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x5fd7fc) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #7 0xaaaabc94cf80 in Catch::Session::run() (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x5fcf80) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #8 0xaaaabc633750 in main (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x2e3750) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #9 0xffffb27c73f8  (/lib/aarch64-linux-gnu/libc.so.6+0x273f8) (BuildId: aa6e122fa39ae02d412afb49d75e33281fcd2805)
    #10 0xffffb27c74c8 in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x274c8) (BuildId: aa6e122fa39ae02d412afb49d75e33281fcd2805)
    #11 0xaaaabc522b6c in _start (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x1d2b6c) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)

Direct leak of 240 byte(s) in 1 object(s) allocated from:
    #0 0xaaaabc54c830 in operator new(unsigned long) (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x1fc830) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #1 0xaaaabc5b24f8 in RTC::RtpPacket::Parse(unsigned char const*, unsigned long) (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x2624f8) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #2 0xaaaabc65a8d0 in CATCH2_INTERNAL_TEST_0() TestRtpStreamSend.cpp
    #3 0xaaaabc942440 in Catch::RunContext::runCurrentTest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x5f2440) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #4 0xaaaabc941ef0 in Catch::RunContext::runTest(Catch::TestCaseHandle const&) (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x5f1ef0) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #5 0xaaaabc94d7fc in Catch::Session::runInternal() (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x5fd7fc) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #6 0xaaaabc94cf80 in Catch::Session::run() (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x5fcf80) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #7 0xaaaabc633750 in main (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x2e3750) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #8 0xffffb27c73f8  (/lib/aarch64-linux-gnu/libc.so.6+0x273f8) (BuildId: aa6e122fa39ae02d412afb49d75e33281fcd2805)
    #9 0xffffb27c74c8 in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x274c8) (BuildId: aa6e122fa39ae02d412afb49d75e33281fcd2805)
    #10 0xaaaabc522b6c in _start (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x1d2b6c) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)

Direct leak of 240 byte(s) in 1 object(s) allocated from:
    #0 0xaaaabc54c830 in operator new(unsigned long) (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x1fc830) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #1 0xaaaabc5b24f8 in RTC::RtpPacket::Parse(unsigned char const*, unsigned long) (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x2624f8) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #2 0xaaaabc65a240 in RtpMyRetransmissionBuffer::Insert(unsigned short, unsigned int) (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x30a240) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #3 0xaaaabc659d1c in CATCH2_INTERNAL_TEST_0() TestRtpRetransmissionBuffer.cpp
    #4 0xaaaabc942440 in Catch::RunContext::runCurrentTest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x5f2440) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #5 0xaaaabc941ef0 in Catch::RunContext::runTest(Catch::TestCaseHandle const&) (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x5f1ef0) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #6 0xaaaabc94d7fc in Catch::Session::runInternal() (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x5fd7fc) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #7 0xaaaabc94cf80 in Catch::Session::run() (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x5fcf80) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #8 0xaaaabc633750 in main (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x2e3750) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)
    #9 0xffffb27c73f8  (/lib/aarch64-linux-gnu/libc.so.6+0x273f8) (BuildId: aa6e122fa39ae02d412afb49d75e33281fcd2805)
    #10 0xffffb27c74c8 in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x274c8) (BuildId: aa6e122fa39ae02d412afb49d75e33281fcd2805)
    #11 0xaaaabc522b6c in _start (/mediasoup/worker/out/Release/build/mediasoup-worker-test-asan-address+0x1d2b6c) (BuildId: a69bc907dbee65a7a73448abb135fae032af704a)

// many more
jmillan commented 4 months ago

TODO1

We must add asan options to dependencies too. By adding the following lines to meson.build we are doing so. We need to apply this only when running asan, so we may need a new meson option (meson_options.txt) ie: enable_asan_xyz:

diff --git a/worker/meson.build b/worker/meson.build
index 6c94280d9..75489b6cc 100644
--- a/worker/meson.build
+++ b/worker/meson.build
@@ -13,6 +13,9 @@ cpp_args = [
   host_machine.endian() == 'little' ? '-DMS_LITTLE_ENDIAN' : '-DMS_BIG_ENDIAN',
 ]

+add_global_arguments('-fsanitize=address', language: 'cpp')
+add_global_link_arguments('-fsanitize=address', language: 'cpp')
+

By adding that patch the TODO1 error does not appear. A new one is present though, but anyway abseil must be also given those compile and link options.

ibc commented 4 months ago

By adding that patch the TODO1 error does not appear. A new one is present though, but anyway abseil must be also given those compile and link options.

Isn't this better? In tasks.py:

-@task(pre=[setup, flatc])
+@task(pre=[call(setup, meson_args=MESON_ARGS + ' -Db_sanitize=address'), flatc])
 def test_asan_address(ctx):
     """
     Run worker test with Address Sanitizer with '-fsanitize=address'
ibc commented 4 months ago

We will fix ASAN issues in a separate tickets. This PR has disabled those CI tasks until they are fixed.

So let's continue fixing ASAN things in here: https://github.com/versatica/mediasoup/issues/1417