msquic
msquic copied to clipboard
Sent Packet Metadata Leak
Describe the bug
https://github.com/microsoft/msquic/actions/runs/4647905984/jobs/8225223605
Direct leak of 104 byte(s) in 1 object(s) allocated from:
#0 0x7fe782e58808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
#1 0x7fe781d11f76 in CxPlatAlloc /home/runner/work/msquic/msquic/src/platform/platform_posix.c:285
#2 0x7fe781ccafef in CxPlatPoolAlloc /home/runner/work/msquic/msquic/src/inc/quic_platform_posix.h:520
#3 0x7fe781ccafef in QuicSentPacketPoolGetPacketMetadata /home/runner/work/msquic/msquic/src/core/sent_packet_metadata.c:97
#4 0x7fe781c95ea3 in QuicLossDetectionOnPacketSent /home/runner/work/msquic/msquic/src/core/loss_detection.c:406
#5 0x7fe781cf76ce in QuicPacketBuilderFinalize /home/runner/work/msquic/msquic/src/core/packet_builder.c:941
#6 0x7fe781cc6b04 in QuicSendFlush /home/runner/work/msquic/msquic/src/core/send.c:1446
#7 0x7fe781c2aee2 in QuicConnDrainOperations /home/runner/work/msquic/msquic/src/core/connection.c:7516
#8 0x7fe781bbedf2 in QuicWorkerProcessConnection /home/runner/work/msquic/msquic/src/core/worker.c:510
#9 0x7fe781bc[1019](https://github.com/microsoft/msquic/actions/runs/4647905984/jobs/8225223605#step:7:1020) in QuicWorkerLoop /home/runner/work/msquic/msquic/src/core/worker.c:667
#10 0x7fe781d0f9e9 in CxPlatRunExecutionContexts /home/runner/work/msquic/msquic/src/platform/platform_worker.c:407
#11 0x7fe781d10bb4 in CxPlatWorkerThread /home/runner/work/msquic/msquic/src/platform/platform_worker.c:504
#12 0x7fe78058f608 in start_thread /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477
Looks like one packet metadata was leaked for a total of 104 bytes.
Affected OS
- [ ] Windows
- [X] Linux
- [ ] macOS
- [ ] Other (specify below)
Additional OS information
No response
MsQuic version
main
Steps taken to reproduce bug
Run tests
Expected behavior
All tests pass with no memory leaks
Actual outcome
Small memory leak
Additional details
No response
Latest hit: https://github.com/microsoft/msquic/actions/runs/7234104128/job/19710259684
=================================================================
==6666==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 120 byte(s) in 1 object(s) allocated from:
#0 0x7fdbc38d6808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
#1 0x7fdbc275ab7a in CxPlatAlloc /__w/msquic/msquic/src/platform/platform_posix.c:288
#2 0x7fdbc2710f19 in CxPlatPoolAlloc /__w/msquic/msquic/src/inc/quic_platform_posix.h:531
#3 0x7fdbc2710f19 in QuicSentPacketPoolGetPacketMetadata /__w/msquic/msquic/src/core/sent_packet_metadata.c:100
#4 0x7fdbc26d8e3c in QuicLossDetectionOnPacketSent /__w/msquic/msquic/src/core/loss_detection.c:398
#5 0x7fdbc2741d44 in QuicPacketBuilderFinalize /__w/msquic/msquic/src/core/packet_builder.c:942
#6 0x7fdbc270b30e in QuicSendFlush /__w/msquic/msquic/src/core/send.c:1411
#7 0x7fdbc266804c in QuicConnDrainOperations /__w/msquic/msquic/src/core/connection.c:7662
#8 0x7fdbc25f7e0b in QuicWorkerProcessConnection /__w/msquic/msquic/src/core/worker.c:506
#9 0x7fdbc25fa488 in QuicWorkerLoop /__w/msquic/msquic/src/core/worker.c:658
#10 0x7fdbc2758399 in CxPlatRunExecutionContexts /__w/msquic/msquic/src/platform/platform_worker.c:395
#11 0x7fdbc2759564 in CxPlatWorkerThread /__w/msquic/msquic/src/platform/platform_worker.c:492
#12 0x7fdbc0f96608 in start_thread /build/glibc-wuryBv/glibc-2.31/nptl/pthread_create.c:477
Objects leaked above:
0x60c00047cf80 (120 bytes)
SUMMARY: AddressSanitizer: 120 byte(s) leaked in 1 allocation(s).