Skip to content

CLang sanitizer support - #574

Merged
rafie merged 18 commits into
masterfrom
rafi-san1
Dec 22, 2021
Merged

rafie merged 18 commits into
masterfrom
rafi-san1

Conversation

@rafie

@rafie rafie commented Dec 13, 2021

Copy link
Copy Markdown
Contributor

No description provided.

@rafie
rafie requested a review from oshadmi December 13, 2021 16:47
oshadmi
oshadmi previously approved these changes Dec 14, 2021
Comment thread Makefile Resolved
@rafie
rafie requested a review from gkorland December 19, 2021 11:12
@rafie

rafie commented Dec 19, 2021

Copy link
Copy Markdown
Contributor Author

@gkorland Memory sanitizer disabled: all tests pass now.

@gkorland
gkorland requested a review from oshadmi December 21, 2021 12:51
Comment thread Makefile

pytest:
$(SHOW)MODULE=$(abspath $(TARGET)) ./tests/pytest/tests.sh
$(SHOW)MODULE=$(abspath $(TARGET)) $(realpath ./tests/pytest/tests.sh)

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.

realpath (sadly) still isn't completely portable. Can you use realink -f?

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.

This in gnu make's realpath, not /bin/realpath. This fortunately works properly.

@rafie rafie Dec 22, 2021 •

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.

@chayim BTW the reason we require realpath here in the first place is because using a relative path causing test.sh not to print program name properly when it detects an error. So this needs to be fixed to (probably something like PROGNAME="$0" at the top).

Comment thread tests/pytest/tests.sh
if ! command -v redis-server > /dev/null; then
echo "Cannot find redis-server. Aborting."
setup_redis_server() {
if [[ -n $SAN ]]; then

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.

${SAN} (etc) makes for safer shell scripts

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.

So you'd like to wrap any variable reference with {}, even when it's clear we're on the safe side? Wouldn't that hurt readability a bit? BTW I'm more concerned with quoting (in this case bash handles this ok so it can be omited, but in too many cases you do see A=$B).

Comment thread tests/pytest/tests.sh Resolved
Comment thread tests/pytest/tests.sh Resolved
Comment thread tests/pytest/tests.sh

TEST=test Run specific test (e.g. test.py:test_name)
VALGRIND|VG=1 Run with Valgrind
SAN=type Use LLVM sanitizer (type=address|memory|leak|thread)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we want to remove leak and thread from the help string in the meantime?

@oshadmi oshadmi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍🏼

@rafie
rafie merged commit 1538bd2 into master Dec 22, 2021
@rafie
rafie deleted the rafi-san1 branch December 22, 2021 18:18
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.

3 participants