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

Add a test for shadow stack allocation before an external call. #1499

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

vext01
Copy link
Contributor

@vext01 vext01 commented Dec 9, 2024

An external call can "call-back" to interpreter code, so we still need to allocate shadow space.

Requires ykjit/ykllvm#217

@vext01
Copy link
Contributor Author

vext01 commented Dec 9, 2024

hold off on this for this and the companion for a moment actually.

@vext01 vext01 force-pushed the fix-shadow-alloc-external branch from 6fbb445 to 83c6d9f Compare December 9, 2024 10:39
@vext01
Copy link
Contributor Author

vext01 commented Dec 9, 2024

Force pushed test fixes that I didn't anticipate. Go ahead.

@vext01
Copy link
Contributor Author

vext01 commented Dec 9, 2024

Oh this will need a ykllvm sync once the compiler PR is merged.

@ltratt
Copy link
Contributor

ltratt commented Dec 9, 2024

Please force push when that's ready.

An external call can "call-back" to interpreter code, so we still need
to allocate shadow space.

Co-authored-by: Lukas Diekmann <[email protected]>
@vext01 vext01 force-pushed the fix-shadow-alloc-external branch from 83c6d9f to db0391a Compare December 9, 2024 11:33
@vext01
Copy link
Contributor Author

vext01 commented Dec 9, 2024

synced and ready.

(I note that the ykllvm sync also pulled in some SWT-related stuff)

@ltratt
Copy link
Contributor

ltratt commented Dec 9, 2024

Yes the SWT parts are expected.

@vext01
Copy link
Contributor Author

vext01 commented Dec 9, 2024

Ready when you are then.

@ltratt ltratt added this pull request to the merge queue Dec 9, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 9, 2024
@ltratt
Copy link
Contributor

ltratt commented Dec 9, 2024

11:58:56 ***** FILE 'events.lua'*****
11:58:56 testing metatables
11:58:56 ..Segmentation fault (core dumped)
11:58:59 + status=139
11:58:59 + [ 1 -eq 1 ]

Do we think that's a non-deterministic failure, or perhaps evidence of a problem caused the ykllvm change?

@vext01
Copy link
Contributor Author

vext01 commented Dec 9, 2024

Hrm, hard to say. I have a try_repeat going to see if I can repro it locally.

Maybe retry it?

@ltratt
Copy link
Contributor

ltratt commented Dec 9, 2024

Let's give it a minute: if you can get to 100 without crashes (or if you believe any crashes you do see are unrelated), we can retry.

@vext01
Copy link
Contributor Author

vext01 commented Dec 9, 2024

My run of 100 serialised debug runs just finished without hitting this seg 🤔

@ltratt
Copy link
Contributor

ltratt commented Dec 9, 2024

OK, well let's retry, and see what happens.

@ltratt ltratt added this pull request to the merge queue Dec 9, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 9, 2024
@ltratt
Copy link
Contributor

ltratt commented Dec 9, 2024

OK, it's crashed in the same place, so I think we can assume we've hit an actual problem.

@vext01
Copy link
Contributor Author

vext01 commented Dec 9, 2024

OK, i'll try harder to repro.

@vext01
Copy link
Contributor Author

vext01 commented Dec 12, 2024

I've pushed an assertion that may save us some debugging effort in the future.

With ykjit/ykllvm#219 I think this should merge (if the benchmarks turn out to be ok).

@vext01
Copy link
Contributor Author

vext01 commented Dec 12, 2024

This will need an llvm sync after ykjit/ykllvm#219 is in.

A bug in ykllvm's spillmap implementation meant that we were deopting
the same location with different values. This change adds a debug
assertion that checks that this doesn't happen.

Co-authored-by: Lukas Diekmann <[email protected]>
@vext01 vext01 force-pushed the fix-shadow-alloc-external branch from f7982a1 to 74e9c0a Compare December 13, 2024 10:35
@vext01
Copy link
Contributor Author

vext01 commented Dec 13, 2024

synced llvm.

@ptersilie ptersilie added this pull request to the merge queue Dec 13, 2024
Merged via the queue into ykjit:master with commit de035a6 Dec 13, 2024
2 checks passed
@vext01 vext01 deleted the fix-shadow-alloc-external branch December 13, 2024 12:45
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