Skip to content

Comments

Fix ASAN in combination with throw intrinsic#10974

Merged
cfallin merged 2 commits intobytecodealliance:mainfrom
alexcrichton:asan-new-intrinsic
Jun 7, 2025
Merged

Fix ASAN in combination with throw intrinsic#10974
cfallin merged 2 commits intobytecodealliance:mainfrom
alexcrichton:asan-new-intrinsic

Conversation

@alexcrichton
Copy link
Member

Prior to this commit locally I would see a nondeterministic crash when executing:

RUSTFLAGS=-Zsanitizer=address \
  cargo +nightly run --release test filetests

The crash has a scary-looking internal assertion within the ASAN runtime itself and local debugging seems to show that threads are required to reproduce this and it's nondeterministic. I don't know why CI is currently passing on all PRs when this is failing so frequently for myself locally.

In any case it seems like there's a magical ASAN intrinsic to call before noreturn things which I think is intended for thread-stopping events which isn't a great fit for exceptions here but it seems to resolve the crash.

Basically I have no idea why things crash locally, what this new function does, nor why it fixes things. I am but a slave to the CI gods in an attempt to make it so our CI is more reliable.

Prior to this commit locally I would see a nondeterministic crash when
executing:

    RUSTFLAGS=-Zsanitizer=address \
      cargo +nightly run --release test filetests

The crash has a scary-looking internal assertion within the ASAN runtime
itself and local debugging seems to show that threads are required to
reproduce this and it's nondeterministic. I don't know why CI is
currently passing on all PRs when this is failing so frequently for
myself locally.

In any case it seems like there's a magical ASAN intrinsic to call
before `noreturn` things which I think is intended for thread-stopping
events which isn't a great fit for exceptions here but it seems to
resolve the crash.

Basically I have no idea why things crash locally, what this new
function does, nor why it fixes things. I am but a slave to the CI gods
in an attempt to make it so our CI is more reliable.
@alexcrichton alexcrichton requested a review from a team as a code owner June 7, 2025 00:20
@alexcrichton alexcrichton requested review from pchickey and removed request for a team June 7, 2025 00:20
Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

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

Thanks for catching this!

@cfallin cfallin enabled auto-merge June 7, 2025 00:32
@cfallin cfallin added this pull request to the merge queue Jun 7, 2025
Merged via the queue into bytecodealliance:main with commit 7f8370a Jun 7, 2025
41 checks passed
@alexcrichton alexcrichton deleted the asan-new-intrinsic branch June 7, 2025 01:19
alexcrichton added a commit to alexcrichton/wasmtime that referenced this pull request Jun 9, 2025
This was split out of bytecodealliance#10960 after some CI issues. The simplification of
s390x is split to bytecodealliance#10973 to show its failure but otherwise these changes
aren't expected to cause any issues (yet). Part of enabling this was in bytecodealliance#10974
where ASAN showed some issues as well.

prtest:full
github-merge-queue bot pushed a commit that referenced this pull request Jun 9, 2025
This was split out of #10960 after some CI issues. The simplification of
s390x is split to #10973 to show its failure but otherwise these changes
aren't expected to cause any issues (yet). Part of enabling this was in #10974
where ASAN showed some issues as well.

prtest:full
bongjunj pushed a commit to prosyslab/wasmtime that referenced this pull request Oct 20, 2025
* Fix ASAN in combination with throw intrinsic

Prior to this commit locally I would see a nondeterministic crash when
executing:

    RUSTFLAGS=-Zsanitizer=address \
      cargo +nightly run --release test filetests

The crash has a scary-looking internal assertion within the ASAN runtime
itself and local debugging seems to show that threads are required to
reproduce this and it's nondeterministic. I don't know why CI is
currently passing on all PRs when this is failing so frequently for
myself locally.

In any case it seems like there's a magical ASAN intrinsic to call
before `noreturn` things which I think is intended for thread-stopping
events which isn't a great fit for exceptions here but it seems to
resolve the crash.

Basically I have no idea why things crash locally, what this new
function does, nor why it fixes things. I am but a slave to the CI gods
in an attempt to make it so our CI is more reliable.

* Fix compile warning
bongjunj pushed a commit to prosyslab/wasmtime that referenced this pull request Oct 20, 2025
This was split out of bytecodealliance#10960 after some CI issues. The simplification of
s390x is split to bytecodealliance#10973 to show its failure but otherwise these changes
aren't expected to cause any issues (yet). Part of enabling this was in bytecodealliance#10974
where ASAN showed some issues as well.

prtest:full
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.

2 participants