Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable sanitizers in regular CI runs #3422

Merged
merged 4 commits into from
Oct 21, 2021
Merged

Enable sanitizers in regular CI runs #3422

merged 4 commits into from
Oct 21, 2021

Conversation

JanuszL
Copy link
Contributor

@JanuszL JanuszL commented Oct 13, 2021

  • adds a suppression list that should disable all detected
    and not DALI originated errors
  • makes all leaks to fail the test job
  • turns off fast_unwind_on_malloc to make the stack trace
    more accurate (but slower) and allow more accurate suppressions,
    when the frame pointer is not preserved (python binary)

Signed-off-by: Janusz Lisiecki jlisiecki@nvidia.com

Description

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (Redesign of existing code that doesn't affect functionality)
  • Other (e.g. Documentation, Tests, Configuration)

What happened in this PR

  • adds a suppression list that should disable all detected
    and not DALI originated errors
  • makes all leaks to fail the test job
  • turns off fast_unwind_on_malloc to make the stack trace
    more accurate (but slower) and allow more accurate suppressions,
    when the frame pointer is not preserved (python binary)

Additional information

  • Affected modules and functionalities:
    • leak suppression list
    • test teamplate
  • Key points relevant for the review:
    • suppression list
    • ideas for testing

Checklist

Tests

  • Existing tests apply
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A

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: DALI-2403

@JanuszL JanuszL marked this pull request as draft October 13, 2021 18:30
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [3180966]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [3180966]: BUILD PASSED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [3182601]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [3182601]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [3182601]: BUILD PASSED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [3188789]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [3188789]: BUILD FAILED

@JanuszL JanuszL force-pushed the asan_runs branch 2 times, most recently from 7216f50 to 5a41464 Compare October 15, 2021 18:34
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [3197785]: BUILD STARTED

@JanuszL JanuszL changed the title Enable sanitizers Enable sanitizers in regular CI runs Oct 15, 2021
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [3197785]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [3213035]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [3213035]: BUILD PASSED

@JanuszL JanuszL marked this pull request as ready for review October 18, 2021 18:41
- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
export ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer)
# avoid python false positives
export PYTHONMALLOC=malloc
# if something calls dlclose on a module that leaks and it happens before asan can extract symbols we get "unknown module"
# in the stack trace, to prevent this provide dlclose that does nothing
echo "int dlclose(void* a) { return 0; }" > /tmp/fake_dlclost.c && gcc -shared -o /tmp/libfakeclose.so /tmp/fake_dlclost.c
Copy link
Contributor

@mzient mzient Oct 19, 2021

Choose a reason for hiding this comment

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

Suggested change
echo "int dlclose(void* a) { return 0; }" > /tmp/fake_dlclost.c && gcc -shared -o /tmp/libfakeclose.so /tmp/fake_dlclost.c
echo "int dlclose(void* a) { return 0; }" > /tmp/fake_dlclose.c && gcc -shared -o /tmp/libfakeclose.so /tmp/fake_dlclose.c

Copy link
Contributor

Choose a reason for hiding this comment

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

Q: Wouldn't fake_dlclose simply hide leaks in some cases? Or will it run regardless at process teardown?
Also, how does it affect module unloading order?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a broader problem described and discussed google/sanitizers#89.

Wouldn't fake_dlclose simply hide leaks in some cases? Or will it run regardless at process teardown?

Yes, this trick would hide leaks of memory allocated in dlopen however in DALI we don't dlclose libs (except one), so the only leaks we would miss are from other libraries we won't fix anyway.

Also, how does it affect module unloading order?

I think there is no module unload in that case, the process is just closed and the whole memory is freed, But modules are not unloaded properly.

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

CI MESSAGE: [3223110]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [3223110]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [3226633]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [3226633]: BUILD FAILED

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

CI MESSAGE: [3231412]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [3231412]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [3231412]: BUILD PASSED

@JanuszL JanuszL merged commit d60738f into NVIDIA:main Oct 21, 2021
@JanuszL JanuszL deleted the asan_runs branch October 21, 2021 14:52
00max09 pushed a commit to szkarpinski/DALI that referenced this pull request Dec 1, 2021
* Enable sanitizers in regular CI runs

- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)
- shortens tests TF based L0 test and excludes numpy_reader test when sanitizers are on

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
Signed-off-by: Maksymilian Grochowski <mg417883@students.mimuw.edu.pl>
00max09 pushed a commit to szkarpinski/DALI that referenced this pull request Dec 1, 2021
* Enable sanitizers in regular CI runs

- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)
- shortens tests TF based L0 test and excludes numpy_reader test when sanitizers are on

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
Signed-off-by: Maksymilian Grochowski <mg417883@students.mimuw.edu.pl>
cyyever pushed a commit to cyyever/DALI that referenced this pull request Jan 23, 2022
* Enable sanitizers in regular CI runs

- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)
- shortens tests TF based L0 test and excludes numpy_reader test when sanitizers are on

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
cyyever pushed a commit to cyyever/DALI that referenced this pull request Jan 23, 2022
* Enable sanitizers in regular CI runs

- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)
- shortens tests TF based L0 test and excludes numpy_reader test when sanitizers are on

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
cyyever pushed a commit to cyyever/DALI that referenced this pull request Jan 23, 2022
* Enable sanitizers in regular CI runs

- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)
- shortens tests TF based L0 test and excludes numpy_reader test when sanitizers are on

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
cyyever pushed a commit to cyyever/DALI that referenced this pull request Jan 23, 2022
* Enable sanitizers in regular CI runs

- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)
- shortens tests TF based L0 test and excludes numpy_reader test when sanitizers are on

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
cyyever pushed a commit to cyyever/DALI that referenced this pull request Jan 23, 2022
* Enable sanitizers in regular CI runs

- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)
- shortens tests TF based L0 test and excludes numpy_reader test when sanitizers are on

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
cyyever pushed a commit to cyyever/DALI that referenced this pull request Jan 23, 2022
* Enable sanitizers in regular CI runs

- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)
- shortens tests TF based L0 test and excludes numpy_reader test when sanitizers are on

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
cyyever pushed a commit to cyyever/DALI that referenced this pull request Jan 23, 2022
* Enable sanitizers in regular CI runs

- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)
- shortens tests TF based L0 test and excludes numpy_reader test when sanitizers are on

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
cyyever pushed a commit to cyyever/DALI that referenced this pull request Jan 23, 2022
* Enable sanitizers in regular CI runs

- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)
- shortens tests TF based L0 test and excludes numpy_reader test when sanitizers are on

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
cyyever pushed a commit to cyyever/DALI that referenced this pull request Jan 23, 2022
* Enable sanitizers in regular CI runs

- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)
- shortens tests TF based L0 test and excludes numpy_reader test when sanitizers are on

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
cyyever pushed a commit to cyyever/DALI that referenced this pull request Jan 23, 2022
* Enable sanitizers in regular CI runs

- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)
- shortens tests TF based L0 test and excludes numpy_reader test when sanitizers are on

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
cyyever pushed a commit to cyyever/DALI that referenced this pull request Jan 23, 2022
* Enable sanitizers in regular CI runs

- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)
- shortens tests TF based L0 test and excludes numpy_reader test when sanitizers are on

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
cyyever pushed a commit to cyyever/DALI that referenced this pull request Jan 23, 2022
* Enable sanitizers in regular CI runs

- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)
- shortens tests TF based L0 test and excludes numpy_reader test when sanitizers are on

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
cyyever pushed a commit to cyyever/DALI that referenced this pull request Jan 23, 2022
* Enable sanitizers in regular CI runs

- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)
- shortens tests TF based L0 test and excludes numpy_reader test when sanitizers are on

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
cyyever pushed a commit to cyyever/DALI that referenced this pull request Feb 21, 2022
* Enable sanitizers in regular CI runs

- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)
- shortens tests TF based L0 test and excludes numpy_reader test when sanitizers are on

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
cyyever pushed a commit to cyyever/DALI that referenced this pull request May 13, 2022
* Enable sanitizers in regular CI runs

- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)
- shortens tests TF based L0 test and excludes numpy_reader test when sanitizers are on

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
cyyever pushed a commit to cyyever/DALI that referenced this pull request Jun 7, 2022
* Enable sanitizers in regular CI runs

- adds a suppression list that should disable all detected
  and not DALI originated errors
- makes all leaks to fail the test job
- turns off `fast_unwind_on_malloc` to make the stack trace
  more accurate (but slower) and allow more accurate suppressions,
  when the frame pointer is not preserved (python binary)
- shortens tests TF based L0 test and excludes numpy_reader test when sanitizers are on

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
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.

5 participants