-
Notifications
You must be signed in to change notification settings - Fork 46
Add AddressSanitizer
to DEBUG
builds
#1279
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Open
JackPGreen
wants to merge
6
commits into
master
Choose a base branch
from
add-`AddressSanitizer`-3
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+44
−68
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1276 addressed a `Segementation fault`, but from the error alone, the root cause was not obvious: ``` 31168 Segmentation fault: 11 build/cpp_client ``` By adding [`asan`](https://learn.microsoft.com/en-us/cpp/sanitizers/asan) to the `DEBUG` builds, the CI job would've failed with a much more helpful error message: ``` ================================================================= ==37978==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000040 (pc 0x7eff21446d48 bp 0x7efeff67fce0 sp 0x7efeff67fcd0 T22) ==37978==The signal is caused by a READ memory access. ==37978==Hint: address points to the zero page. #0 0x7eff21446d48 in hazelcast::logger::enabled(hazelcast::logger::level) /home/runner/work/hazelcast-cpp-client/hazelcast-cpp-client/hazelcast/src/hazelcast/logger.cpp:71 #1 0x7eff20a05b1d in hazelcast::client::protocol::codec::client_addclusterviewlistener_handler::handle(hazelcast::client::protocol::ClientMessage&) /home/runner/work/hazelcast-cpp-client/hazelcast-cpp-client/hazelcast/generated-sources/src/hazelcast/client/protocol/codec/codecs.cpp:145 {...} AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /home/runner/work/hazelcast-cpp-client/hazelcast-cpp-client/hazelcast/src/hazelcast/logger.cpp:71 in hazelcast::logger::enabled(hazelcast::logger::level) ``` An _alternative_ implementation would've been to hardcode the flags in the `build-unix`/`build-windows` instead.
ihsandemir
requested changes
May 16, 2025
Co-authored-by: ihsan demir <ihsandemir@gmail.com>
Co-authored-by: ihsan demir <ihsandemir@gmail.com>
@ihsandemir thanks for your feedback. I was actually waiting for a green PR builder before un-drafting this PR but it seems GitHub gave you a heads-up. The good news is that
...the bad news is that these failures are actually blocking this PR from being merged. What do you think the next steps should be?
|
b7cef7f
to
573b430
Compare
JackPGreen
added a commit
to JackPGreen/hazelcast-cpp-client
that referenced
this pull request
May 17, 2025
The change in hazelcast#1279 made it obvious that adding configuration for `Debug` builds (e.g. "add an extra compilation argument") was very tedious as it needs to be declared in _each_ workflow and then passed all the way down to the actual scripts that build the code. Instead, it'd be much cleaner if the jobs _only_ declare a release type, and the build scripts react to that with the appropriate actions (e.g. adding some extra debug or whatever). Changes: - migrate the _implementation_ of the `DEBUG` builds into the `build-` scripts - e.g. `WARN_AS_ERROR` can be assumed when `DEBUG` is enabled, rather than being duplicated in each job configuration - remove the architecture to pass these redundant params down - pass `BUILD_TYPE` into the `build-` scripts as an environment variable, as used for other parameters - rename `BUILD_CONFIGURATION` to `BUILD_TYPE` in Windows scripts for consistency - enable `WARN_AS_ERROR` on Windows for consistency This PR also helps to make hazelcast#1279 smaller.
JackPGreen
added a commit
to JackPGreen/hazelcast-cpp-client
that referenced
this pull request
May 17, 2025
The change in hazelcast#1279 made it obvious that adding configuration for `Debug` builds (e.g. "add an extra compilation argument") was very tedious as it needs to be declared in _each_ workflow and then passed all the way down to the actual scripts that build the code. Instead, it'd be much cleaner if the jobs _only_ declare a release type, and the build scripts react to that with the appropriate actions (e.g. adding some extra debug or whatever). Changes: - migrate the _implementation_ of the `DEBUG` builds into the `build-` scripts - e.g. `WARN_AS_ERROR` can be assumed when `DEBUG` is enabled, rather than being duplicated in each job configuration - remove the architecture to pass these redundant params down - pass `BUILD_TYPE` into the `build-` scripts as an environment variable, as used for other parameters - rename `BUILD_CONFIGURATION` to `BUILD_TYPE` in Windows scripts for consistency - enable `WARN_AS_ERROR` on Windows for consistency This PR also helps to make hazelcast#1279 smaller.
7dfca18
to
7d23115
Compare
7d23115
to
e1a6f1e
Compare
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#1276 addressed a
Segementation fault
, but from the error alone, the root cause was not obvious:By adding
asan
to theDEBUG
builds, the CI job would've failed with a much more helpful error message:Changes:
DEBUG
builds into thebuild-
scriptsWARN_AS_ERROR
can be assumed whenDEBUG
is enabled, rather than being duplicated in each job configurationBUILD_TYPE
into thebuild-
scripts as an environment variable, as used for other parametersbuild-
scripts are run inDEBUG
, also add theasan
arguments