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

core/xfa: disable asan on llvm #19271

Merged
merged 1 commit into from
Feb 15, 2023
Merged

Conversation

Teufelchen1
Copy link
Contributor

Contribution description

Hi! 🦎

When using llvm and address sanitation, the XFA trip the sanitizer.
This PR attempts to fix this by adding the no_sanitize attribute to the XFA macros. Sadly, this attribute is not known by gnu, a guard is hence needed. I'm open for alternatives as I dislike this solution but it is the best I could come up with.

Testing procedure

Before this patch:

Go to examples/gnrc_minimal and run TOOLCHAIN=llvm make all-asan and then make term.
You should see an error similar to this:

==3374719==ERROR: AddressSanitizer: global-buffer-overflow on address 0x080774e0 at pc 0x0804af5e bp 0x0808eb88 sp 0x0808eb78
READ of size 4 at 0x080774e0 thread T0
    #0 0x804af5d in _auto_init_module /RIOT/sys/auto_init/auto_init.c:40
    #1 0x804af5d in auto_init /RIOT/sys/auto_init/auto_init.c:339
    #2 0x804b375 in main_trampoline /RIOT/core/lib/init.c:56
    #3 0xf76bc7b8 in makecontext (/lib32/libc.so.6+0x4a7b8)
...

After applying this PR, the example can be build and run with llvm or gcc, with or without asan.

@github-actions github-actions bot added the Area: core Area: RIOT kernel. Handle PRs marked with this with care! label Feb 13, 2023
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 13, 2023
core/lib/include/xfa.h Outdated Show resolved Hide resolved
@riot-ci
Copy link

riot-ci commented Feb 13, 2023

Murdock results

✔️ PASSED

a8c9af9 core/xfa: disable asan on llvm

Success Failures Total Runtime
6865 0 6865 15m:25s

Artifacts

@Teufelchen1 Teufelchen1 force-pushed the chore/asan/xfa branch 2 times, most recently from c61d503 to 805aa42 Compare February 15, 2023 13:11
Copy link
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@bors
Copy link
Contributor

bors bot commented Feb 15, 2023

🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.

@benpicco
Copy link
Contributor

bors merge

@bors
Copy link
Contributor

bors bot commented Feb 15, 2023

Stopped waiting for PR status (GitHub check) without running due to duplicate requests to run. You may check Bors to see that this PR is included in a batch by one of the other requests.

@bors
Copy link
Contributor

bors bot commented Feb 15, 2023

Build succeeded:

@bors bors bot merged commit 5667814 into RIOT-OS:master Feb 15, 2023
@MrKevinWeiss MrKevinWeiss added this to the Release 2023.04 milestone Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: core Area: RIOT kernel. Handle PRs marked with this with care! CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants