Repository: microsoft/ebpf-for-windows

Issue #2251: initialize_async_ioctl_operation leaks 56 bytes of memory when fault injection is enabled
Created: 2023-03-28T18:52:37Z
Memory leaked:
    [0]              : "Leak of 56 bytes at 2553030341184." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [1]              : "    ebpf_allocate + 190 (D:\a\ebpf-for-windows-1\ebpf-for-windows-1\libs\platform\user\ebpf_platform_user.cpp:398)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [2]              : "    initialize_async_ioctl_operation + 56 (D:\a\ebpf-for-windows-1\ebpf-for-windows-1\libs\api_common\device_helper.cpp:171)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [3]              : "    ebpf_ring_buffer_map_subscribe + 2518 (D:\a\ebpf-for-windows-1\ebpf-for-windows-1\libs\api\ebpf_api.cpp:3760)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [4]              : "    ring_buffer__new + 161 (D:\a\ebpf-for-windows-1\ebpf-for-windows-1\libs\api\libbpf_map.cpp:319)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [5]              : "    ring_buffer_api_test_helper + 266 (D:\a\ebpf-for-windows-1\ebpf-for-windows-1\tests\libs\common\common_tests.cpp:188)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [6]              : "    bindmonitor_ring_buffer_test + 2505 (D:\a\ebpf-for-windows-1\ebpf-for-windows-1\tests\end_to_end\end_to_end.cpp:910)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [7]              : "    CATCH2_INTERNAL_TEST_27 + 16 (D:\a\ebpf-for-windows-1\ebpf-for-windows-1\tests\end_to_end\end_to_end.cpp:983)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [8]              : "    Catch::`anonymous namespace'::TestInvokerAsFunction::invoke + 18 (D:\a\ebpf-for-windows-1\ebpf-for-windows-1\external\Catch2\src\catch2\internal\catch_test_registry.cpp:58)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [9]              : "    Catch::TestCaseHandle::invoke + 33 (D:\a\ebpf-for-windows-1\ebpf-for-windows-1\external\Catch2\src\catch2\catch_test_case_info.hpp:116)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [10]             : "    Catch::RunContext::invokeActiveTestCase + 71 (D:\a\ebpf-for-windows-1\ebpf-for-windows-1\external\Catch2\src\catch2\internal\catch_run_context.cpp:544)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [11]             : "    Catch::RunContext::runCurrentTest + 592 (D:\a\ebpf-for-windows-1\ebpf-for-windows-1\external\Catch2\src\catch2\internal\catch_run_context.cpp:509)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [12]             : "    Catch::RunContext::runTest + 738 (D:\a\ebpf-for-windows-1\ebpf-for-windows-1\external\Catch2\src\catch2\internal\catch_run_context.cpp:239)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [13]             : "    Catch::`anonymous namespace'::TestGroup::execute + 243 (D:\a\ebpf-for-windows-1\ebpf-for-windows-1\external\Catch2\src\catch2\catch_session.cpp:111)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [14]             : "    Catch::Session::runInternal + 1008 (D:\a\ebpf-for-windows-1\ebpf-for-windows-1\external\Catch2\src\catch2\catch_session.cpp:336)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [15]             : "    Catch::Session::run + 80 (D:\a\ebpf-for-windows-1\ebpf-for-windows-1\external\Catch2\src\catch2\catch_session.cpp:264)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [16]             : "    Catch::Session::run<char> + 82 (D:\a\ebpf-for-windows-1\ebpf-for-windows-1\external\Catch2\src\catch2\catch_session.hpp:41)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [17]             : "    main + 97 (D:\a\ebpf-for-windows-1\ebpf-for-windows-1\external\Catch2\src\catch2\internal\catch_main.cpp:36)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [18]             : "    invoke_main + 57 (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:79)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [19]             : "    __scrt_common_main_seh + 302 (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [20]             : "    __scrt_common_main + 14 (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:331)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [21]             : "    mainCRTStartup + 14 (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp:17)." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [22]             : "    BaseThreadInitThunk + 16." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [23]             : "    RtlUserThreadStart + 43." [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [24]             : "" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [25]             : "" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [26]             : "" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [27]             : "" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [28]             : "" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [29]             : "" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [30]             : "" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [31]             : "" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [32]             : "" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [33]             : "" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [34]             : "" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]

Fault injection stack:
    [0]              : "ebpf_allocate + 72 D:\a\ebpf-for-windows-1\ebpf-for-windows-1\libs\platform\user\ebpf_platform_user.cpp 384" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [1]              : "ebpf_allocate_with_tag + 24 D:\a\ebpf-for-windows-1\ebpf-for-windows-1\libs\platform\user\ebpf_platform_user.cpp 407" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [2]              : "ebpf_ring_buffer_map_async_query + 334 D:\a\ebpf-for-windows-1\ebpf-for-windows-1\libs\execution_context\ebpf_maps.c 1948" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [3]              : "_ebpf_core_protocol_ring_buffer_map_async_query + 228 D:\a\ebpf-for-windows-1\ebpf-for-windows-1\libs\execution_context\ebpf_core.c 1781" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [4]              : "ebpf_core_invoke_protocol_handler + 848 D:\a\ebpf-for-windows-1\ebpf-for-windows-1\libs\execution_context\ebpf_core.c 2426" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [5]              : "GlueDeviceIoControl + 693 D:\a\ebpf-for-windows-1\ebpf-for-windows-1\tests\end_to_end\test_helper.cpp 448" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [6]              : "std::invoke<bool (__cdecl*&)(void *,unsigned long,void *,unsigned long,void *,unsigned long,unsigned long *,_OVERLAPPED *),void *,unsigned long,void *,unsigned long,void *,unsigned long,unsigned long *,_OVERLAPPED *> + 161 C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\type_traits 1587" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [7]              : "std::_Invoker_ret<int>::_Call<bool (__cdecl*&)(void *,unsigned long,void *,unsigned long,void *,unsigned long,unsigned long *,_OVERLAPPED *),void *,unsigned long,void *,unsigned long,void *,unsigned long,unsigned long *,_OVERLAPPED *> + 115 C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\functional 672" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [8]              : "std::_Func_impl_no_alloc<bool (__cdecl*)(void *,unsigned long,void *,unsigned long,void *,unsigned long,unsigned long *,_OVERLAPPED *),int,void *,unsigned long,void *,unsigned long,void *,unsigned long,unsigned long *,_OVERLAPPED *>::_Do_call + 269 C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\functional 834" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [9]              : "std::_Func_class<int,void *,unsigned long,void *,unsigned long,void *,unsigned long,unsigned long *,_OVERLAPPED *>::operator() + 353 C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\include\functional 875" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [10]             : "Platform::DeviceIoControl + 115 D:\a\ebpf-for-windows-1\ebpf-for-windows-1\libs\thunk\mock\mock.cpp 32" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [11]             : "invoke_ioctl<_ebpf_operation_ring_buffer_map_async_query_request,_ebpf_operation_ring_buffer_map_async_query_reply> + 193 D:\a\ebpf-for-windows-1\ebpf-for-windows-1\libs\api_common\device_helper.hpp 99" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [12]             : "_ebpf_ring_buffer_map_async_query_completion + 2144 D:\a\ebpf-for-windows-1\ebpf-for-windows-1\libs\api\ebpf_api.cpp 3683" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [13]             : "`initialize_async_ioctl_operation'::`2'::<lambda_1>::operator() + 79 D:\a\ebpf-for-windows-1\ebpf-for-windows-1\libs\api_common\device_helper.cpp 193" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [14]             : "`initialize_async_ioctl_operation'::`2'::<lambda_1>::<lambda_invoker_cdecl> + 58 D:\a\ebpf-for-windows-1\ebpf-for-windows-1\libs\api_common\device_helper.cpp 193" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]
    [15]             : "TpAllocTimer + 978" [Type: std::basic_string<char,std::char_traits<char>,std::allocator<char> >]

Duplicate issue #2266: Workflow failed - netebpfext_fuzzer
Created: 2023-04-01T21:42:20Z
Failed Run
Codebase
Test name - netebpfext_fuzzer

Closing comment (2023-04-13T02:04:41Z): There are 3 types of failure - the fault_injection failure is same as #2251. For this one, I have created a PR.
In addition to the above failure, there are netebpfext fuzz test timing out and also user mode multi thread test failures. @shpalani and @dv-msft please look at these issues.