github / github/codeql

LeakSanitizer detects memory leak from CodeQL `x86_64-linux-gnu_x86_64_trace.so` when executing Rust fuzzing test in OneBranch pipeline

オープン
#20,976 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
question
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
141

説明

Hi - I am seeing a memory leak being flagged during the execution of a Rust fuzzing test, on Azure Linux 3, within a OneBranch pipeline. I have been unable to reproduce the memory leak in local testing with the same set of Rust code; I think this may be a leak that is being caused by the CodeQL 3000 tracing library.

## Error Signature

Specifically, I am seeing this error signature:

(Click to expand)

```
2025-11-26T20:04:07.5343825Z ==109898==ERROR: LeakSanitizer: detected memory leaks
2025-11-26T20:04:07.5343887Z
2025-11-26T20:04:07.5344108Z Direct leak of 160 byte(s) in 1 object(s) allocated from:
2025-11-26T20:04:07.5344428Z #0 0x57a7ca86e6eb (/__w/1/s/MY_PROJECT/target/x86_64-unknown-linux-gnu/release/MY_FUZZ_TEST+0x4136eb) (BuildId: b6870f4ceac1ea4791814963416eff9d7e3b719b)
2025-11-26T20:04:07.5345092Z #1 0x7f7df75e33f3 (/__w/_temp/codeql3000/distribution/codeql/tools/linux64/lib/x86_64-linux-gnu_haswell_trace.so+0xdc3f3)
2025-11-26T20:04:07.5345174Z
2025-11-26T20:04:07.5345360Z Objects leaked above:
2025-11-26T20:04:07.5345555Z 0x7c5df5fe0040 (160 bytes)
2025-11-26T20:04:07.5345615Z
2025-11-26T20:04:07.5345832Z Indirect leak of 560 byte(s) in 7 object(s) allocated from:
2025-11-26T20:04:07.5346157Z #0 0x57a7ca86e6eb (/__w/1/s/MY_PROJECT/target/x86_64-unknown-linux-gnu/release/MY_FUZZ_TEST+0x4136eb) (BuildId: b6870f4ceac1ea4791814963416eff9d7e3b719b)
2025-11-26T20:04:07.5346463Z #1 0x7f7df75e33f3 (/__w/_temp/codeql3000/distribution/codeql/tools/linux64/lib/x86_64-linux-gnu_haswell_trace.so+0xdc3f3)
2025-11-26T20:04:07.5346523Z
2025-11-26T20:04:07.5346705Z Objects leaked above:
2025-11-26T20:04:07.5346893Z 0x7bbdf5fe0b10 (48 bytes)
2025-11-26T20:04:07.5347081Z 0x7bbdf5fe0d10 (48 bytes)
2025-11-26T20:04:07.5347271Z 0x7bbdf5fe0d50 (48 bytes)
2025-11-26T20:04:07.5347459Z 0x7bddf5fe0c20 (64 bytes)
2025-11-26T20:04:07.5347850Z 0x7bedf5fe0f00 (80 bytes)
2025-11-26T20:04:07.5348044Z 0x7bedf5fe0f70 (80 bytes)
2025-11-26T20:04:07.5348236Z 0x7c7df5fe0540 (192 bytes)
2025-11-26T20:04:07.5348312Z
2025-11-26T20:04:07.5348537Z SUMMARY: AddressSanitizer: 720 byte(s) leaked in 8 allocation(s).
```

Based on the stack trace being displayed by LeakSanitizer, I believe it may be the source of the memory leak. Or, I suspect the extra tracing being done is interfering with LeakSanitizer's ability to detect memory leaks, and it may be a false positive.

## Other Details

Our code is written in Rust; we are using the [cargo-fuzz](https://github.com/rust-fuzz/cargo-fuzz) crate, which is a wrapper around LLVM's [LibFuzzer](https://llvm.org/docs/LibFuzzer.html), to fuzz our Rust code. As part of the fuzzing, we've enabled detection of memory leaks, which is what resulted in the above error being spat out.

## Questions

* Is this a known issue with CodeQL 3000 in regard to Rust code or LibFuzzer, or perhaps both?
* If need be, is there a way we can disable CodeQL 3000 when executing our fuzzing tests?

There are more specific details I can share about this internally; please reach out to me at [connorshugg@microsoft.com](mailto:connorshugg@microsoft.com) or on Teams and I would be happy to share more.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start with the reported LeakSanitizer signature and the CodeQL 3000 tracing library path in the OneBranch pipeline, then review how cargo-fuzz and LibFuzzer run the Rust test. Compare the pipeline setup with local testing to determine whether the 720-byte leak is caused by CodeQL tracing or is a false positive, and document whether CodeQL can be disabled for these tests.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust
領域
security, testing-qa
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。