Skip to content

Add more Python-related leak suppressions.#6370

Open
JanuszL wants to merge 3 commits into
NVIDIA:mainfrom
JanuszL:more_lsan_supres
Open

Add more Python-related leak suppressions.#6370
JanuszL wants to merge 3 commits into
NVIDIA:mainfrom
JanuszL:more_lsan_supres

Conversation

@JanuszL
Copy link
Copy Markdown
Contributor

@JanuszL JanuszL commented May 26, 2026

  • After moving to Python 3.12 for the sanitized build,
    new false positives have started appearing. This requires
    adding additional suppression entries and modifies sanitizer
    options.

Category:

Other (e.g. Documentation, Tests, Configuration)

Description:

  • After moving to Python 3.12 for the sanitized build,
    new false positives have started appearing. This requires
    adding additional suppression entries.

Additional information:

Affected modules and functionalities:

  • sanitizer suppression list
  • sanitizer options

Key points relevant for the review:

  • NA

Tests:

  • Existing tests apply
    • all tests with sanitizers on
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A

Checklist

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: N/A

@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [52651772]: BUILD STARTED

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 26, 2026

Greptile Summary

This PR updates the sanitizer configuration for the Python 3.12 build, adding new leak suppressions for false positives and fixing the LD_LIBRARY_PATH setup order to ensure nvimgcodec's dependencies (nvjpeg2k, nvtiff) are discoverable before nvimgcodec itself is loaded.

  • qa/leak.sup: Adds Python 3.12 false-positive suppressions (_PyImport_*, _PyObject_GC_*, PyRun_*, compiler path entries, etc.) and removes two entries now covered by the new _PyObject_GC_* wildcard.
  • qa/test_template_impl.sh: Moves ASAN_OPTIONS/ASAN_SYMBOLIZER_PATH export after the LD_LIBRARY_PATH setup, and flips start_deactivated from true to false so ASAN tracks allocations from program start when sanitizers are enabled.
  • qa/TL0_cpu_only/test_nofw.sh and test_pytorch.sh: Apply the same LD_LIBRARY_PATH ordering fix and now preserve the pre-existing path instead of overwriting it.

Confidence Score: 5/5

Safe to merge — changes are isolated to CI sanitizer configuration and suppression lists with no impact on DALI runtime code.

All changes are confined to QA scripts and the LSAN suppression file. The logic is straightforward: add suppressions for new Python 3.12 false positives, fix library path ordering for nvimgcodec deps, and enable full ASAN coverage from startup. The only open question is whether the bare yyparse symbol suppression could be made more specific, but even if left as-is it poses negligible risk given DALI does not contain any yacc/bison-generated parsers.

qa/leak.sup — the new yyparse entry lacks a path filter; worth confirming which binary triggers it.

Important Files Changed

Filename Overview
qa/leak.sup Adds Python 3.12 false-positive suppressions, compiler/toolchain path suppressions, and removes two now-covered entries (_PyObject_GC_NewVar/New); yyparse is a bare symbol suppression without a path filter
qa/test_template_impl.sh LD_LIBRARY_PATH now prepends nvjpeg2k and nvtiff deps before nvimgcodec; ASAN_OPTIONS moved after LD_LIBRARY_PATH setup and start_deactivated changed from true to false for full coverage when sanitizers are enabled
qa/TL0_cpu_only/test_nofw.sh Mirrors the test_template_impl.sh LD_LIBRARY_PATH fix: adds nvjpeg2k and nvtiff dep paths before nvimgcodec, and preserves the existing LD_LIBRARY_PATH instead of overwriting it
qa/TL0_cpu_only/test_pytorch.sh Same LD_LIBRARY_PATH fix as test_nofw.sh — consistent with the broader change

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[test_body_wrapper] -->|DALI_ENABLE_SANITIZERS set| B[enable_sanitizer]
    B --> C[Set PYTHONMALLOC=malloc]
    C --> D[Build libfakeclose.so]
    D --> E[Set LD_PRELOAD with libasan]
    E --> F[Append nvjpeg2k /lib to LD_LIBRARY_PATH]
    F --> G[Append nvtiff /lib to LD_LIBRARY_PATH]
    G --> H[Append nvimgcodec dir to LD_LIBRARY_PATH]
    H --> I[Export ASAN_OPTIONS start_deactivated=false]
    I --> J[Export ASAN_SYMBOLIZER_PATH]
    J --> K[test_body runs with full ASAN coverage]
    K --> L[disable_sanitizer restore LD_LIBRARY_PATH]
    A -->|no sanitizers| M[test_body runs normally]
Loading

Fix All in Claude Code

Reviews (9): Last reviewed commit: "Suppress notebook toolchain sanitizer le..." | Re-trigger Greptile

Comment thread qa/test_template_impl.sh Outdated
Comment on lines +79 to +81
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:"$(python -c 'import nvidia.nvjpeg2k as n, os; print(os.path.dirname(n.__file__) + "/lib")' 2>/dev/null)"
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:"$(python -c 'import nvidia.nvtiff as n, os; print(os.path.dirname(n.__file__) + "/lib")' 2>/dev/null)"
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:"$(python -c 'import nvidia.nvimgcodec as n, os; print(os.path.dirname(n.__file__))' 2>/dev/null)"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 [Nit] The two new lines in enable_sanitizer() use 2>/dev/null without || echo '', while the equivalent lines in test_nofw.sh and test_pytorch.sh use 2>/dev/null || echo ''. Both produce an empty string on failure, so the behaviour is identical, but the inconsistency may surprise a future reader. Consider aligning the style.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@JanuszL JanuszL force-pushed the more_lsan_supres branch from 44bf62a to 5bd9383 Compare May 26, 2026 15:17
@rostan-t rostan-t self-assigned this May 26, 2026
@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [52651772]: BUILD FAILED

@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [52687092]: BUILD STARTED

@JanuszL JanuszL force-pushed the more_lsan_supres branch from 5bd9383 to 853a10c Compare May 26, 2026 22:28
@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [52701305]: BUILD FAILED

@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [52702362]: BUILD STARTED

@JanuszL JanuszL force-pushed the more_lsan_supres branch from 853a10c to daf565c Compare May 27, 2026 08:23
@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [52752780]: BUILD STARTED

@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [52702362]: BUILD FAILED

- After moving to Python 3.12 for the sanitized build,
  new false positives have started appearing. This requires
  adding additional suppression entries and modifies sanitizer
  options.

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@JanuszL JanuszL force-pushed the more_lsan_supres branch from daf565c to fbc6629 Compare May 27, 2026 09:37
@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [52760946]: BUILD STARTED

@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [52687092]: BUILD FAILED

@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [52760946]: BUILD FAILED

@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [52953311]: BUILD STARTED

@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [52953745]: BUILD STARTED

@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [52953745]: BUILD FAILED

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [53052736]: BUILD FAILED

@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [53053372]: BUILD STARTED

@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [53053372]: BUILD FAILED

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@JanuszL JanuszL force-pushed the more_lsan_supres branch from c1d8914 to 2666125 Compare May 30, 2026 18:39
@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [53173151]: BUILD STARTED

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.

4 participants