Skip to content

test: do not consider warning from Sanitizer as fatal#56644

Merged
tchaikov merged 1 commit intoceph:mainfrom
tchaikov:wip-warning-not-fatal
Apr 24, 2024
Merged

test: do not consider warning from Sanitizer as fatal#56644
tchaikov merged 1 commit intoceph:mainfrom
tchaikov:wip-warning-not-fatal

Conversation

@tchaikov
Copy link
Contributor

@tchaikov tchaikov commented Apr 3, 2024

with sanitizer enabled, unittest_ceph_crypto fails like

[ RUN      ] ForkDeathTest.MD5

[WARNING] /home/jenkins-build/build/workspace/ceph-pull-requests/src/googletest/googletest/src/gtest-death-test.cc:1121:: Death tests use fork(), which is unsafe particularly in a threaded context. For this test, Google Test detected 3 threads. See https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#death-tests-and-threads for more explanation and suggested solutions, especially if this is the last message you see before your test times out.
/home/jenkins-build/build/workspace/ceph-pull-requests/src/test/ceph_crypto.cc:273: Failure
Death test: do_simple_crypto()
    Result: died but not with expected error.
  Expected: contains regular expression "^$"
Actual msg:
[  DEATH   ] ==3798016==Running thread 3797882 was not suspended. False leaks are possible.
[  DEATH   ] ==3798016==Running thread 3797885 was not suspended. False leaks are possible.
[  DEATH   ]
[  FAILED  ] ForkDeathTest.MD5 (119 ms)

but this error message should not considered as an indication of fatal error. so, in this change, instead of matching the output with a regex of "^$", we use a matcher to match with the error message if sanitizer is enabled.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

with sanitizer enabled, unittest_ceph_crypto fails like

```
[ RUN      ] ForkDeathTest.MD5

[WARNING] /home/jenkins-build/build/workspace/ceph-pull-requests/src/googletest/googletest/src/gtest-death-test.cc:1121:: Death tests use fork(), which is unsafe particularly in a threaded context. For this test, Google Test detected 3 threads. See https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#death-tests-and-threads for more explanation and suggested solutions, especially if this is the last message you see before your test times out.
/home/jenkins-build/build/workspace/ceph-pull-requests/src/test/ceph_crypto.cc:273: Failure
Death test: do_simple_crypto()
    Result: died but not with expected error.
  Expected: contains regular expression "^$"
Actual msg:
[  DEATH   ] ==3798016==Running thread 3797882 was not suspended. False leaks are possible.
[  DEATH   ] ==3798016==Running thread 3797885 was not suspended. False leaks are possible.
[  DEATH   ]
[  FAILED  ] ForkDeathTest.MD5 (119 ms)
```

but this error message should not considered as an indication of
fatal error. so, in this change, instead of matching the output with
a regex of "^$", we use a matcher to match with the error message if
sanitizer is enabled.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
@tchaikov tchaikov force-pushed the wip-warning-not-fatal branch from 56316e6 to fbbb336 Compare April 3, 2024 05:29
@tchaikov tchaikov requested a review from rzarzynski April 12, 2024 19:13
@tchaikov
Copy link
Contributor Author

tchaikov commented Apr 12, 2024

@rzarzynski hi Radek, could you please help review this change? it helps to get us closer to an ASan-clean make check, with which, we could identify the genuine memory related issues.

@tchaikov
Copy link
Contributor Author

tchaikov commented Apr 18, 2024

@cbodley hi Casey, seems Radek does not have enough bandwidth looking at this, do you mind taking a look? i tested it locally.

@rzarzynski
Copy link
Contributor

Hi Kefu! Sorry, I missed the notification last week :-/. Looking.

// sanitizer warns like:
// ==3798016==Running thread 3797882 was not suspended. False leaks are possible.
// but we should not take it as a fatal error.
const std::string matcher = ".*False leaks are possible.*");
Copy link
Contributor

Choose a reason for hiding this comment

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

ACK.

@rzarzynski
Copy link
Contributor

LGTM. As this change is restricted solely to the unit test, I doubt we need full QA – passing make check should be, IMHO, enough.

Anyway, let's give @cbodley some time to take a look as well.

@tchaikov
Copy link
Contributor Author

@rzarzynski hi Radek, thank you for your review and approval!

@tchaikov tchaikov merged commit 12a6933 into ceph:main Apr 24, 2024
@tchaikov tchaikov deleted the wip-warning-not-fatal branch April 24, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants