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

win32: Fix SEH frame sentinel #43570

Merged
merged 1 commit into from
Dec 28, 2021
Merged

win32: Fix SEH frame sentinel #43570

merged 1 commit into from
Dec 28, 2021

Conversation

Keno
Copy link
Member

@Keno Keno commented Dec 27, 2021

The last entry sentinel for Win64 SEH is ~0L not NULL. Apparently
this doesn't cause issues on windows proper, but does crash wine.
Arguably if Windows doesn't have issues then we should just fix
this in wine, but since we control the source and nobody else
ever seems to have run into this, let's just fix it and save
the good Wine folks some headache. Fixes #43569.

The last entry sentinel for Win64 SEH is `~0L` not NULL. Apparently
this doesn't cause issues on windows proper, but does crash wine.
Arguably if Windows doesn't have issues then we should just fix
this in wine, but since we control the source and nobody else
ever seems to have run into this, let's just fix it and save
the good Wine folks some headache. Fixes #43569.
@Keno Keno requested a review from vtjnash December 27, 2021 20:15
@Keno Keno added system:wine Building Julia under Wine system:windows Affects only Windows backport 1.6 Change should be backported to release-1.6 backport 1.7 labels Dec 27, 2021
@Keno Keno mentioned this pull request Dec 27, 2021
24 tasks
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

SGTM. It was supposed to follow this line, which now your fix does:

https://github.com/dlang/druntime/blob/master/src/core/thread/fiber.d#L1269

@Keno Keno merged commit 722f9d4 into master Dec 28, 2021
@Keno Keno deleted the kf/sehsentinel branch December 28, 2021 14:28
@DilumAluthge
Copy link
Member

I noticed that tester_win32 has now started to fail on master. Could the failures be related to this PR?

Example failure: https://build.julialang.org/#/builders/42/builds/697/steps/5/logs/stdio

@Keno
Copy link
Member Author

Keno commented Dec 28, 2021

No, this is win64 only

@@ -71,7 +71,7 @@ void jl_makecontext(win32_ucontext_t *ucp, void (*func)(void))
jmpbuf->Rip = (unsigned long long)func;
jmpbuf->Rsp = (unsigned long long)stack_top;
jmpbuf->Rbp = 0;
jmpbuf->Frame = 0; // SEH frame
jmpbuf->Frame = ~0L; // SEH frame
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't long 32bit on windows?

Copy link
Member Author

Choose a reason for hiding this comment

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

L is long long in recent standards versions, but I guess we should just spell this out as ~(uint64_t)0.

KristofferC pushed a commit that referenced this pull request Jan 5, 2022
The last entry sentinel for Win64 SEH is `~0L` not NULL. Apparently
this doesn't cause issues on windows proper, but does crash wine.
Arguably if Windows doesn't have issues then we should just fix
this in wine, but since we control the source and nobody else
ever seems to have run into this, let's just fix it and save
the good Wine folks some headache. Fixes #43569.

(cherry picked from commit 722f9d4)
@KristofferC KristofferC mentioned this pull request Jan 5, 2022
23 tasks
KristofferC pushed a commit that referenced this pull request Jan 10, 2022
The last entry sentinel for Win64 SEH is `~0L` not NULL. Apparently
this doesn't cause issues on windows proper, but does crash wine.
Arguably if Windows doesn't have issues then we should just fix
this in wine, but since we control the source and nobody else
ever seems to have run into this, let's just fix it and save
the good Wine folks some headache. Fixes #43569.

(cherry picked from commit 722f9d4)
@KristofferC KristofferC mentioned this pull request Jan 10, 2022
50 tasks
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
The last entry sentinel for Win64 SEH is `~0L` not NULL. Apparently
this doesn't cause issues on windows proper, but does crash wine.
Arguably if Windows doesn't have issues then we should just fix
this in wine, but since we control the source and nobody else
ever seems to have run into this, let's just fix it and save
the good Wine folks some headache. Fixes JuliaLang#43569.
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
The last entry sentinel for Win64 SEH is `~0L` not NULL. Apparently
this doesn't cause issues on windows proper, but does crash wine.
Arguably if Windows doesn't have issues then we should just fix
this in wine, but since we control the source and nobody else
ever seems to have run into this, let's just fix it and save
the good Wine folks some headache. Fixes JuliaLang#43569.
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label May 16, 2022
staticfloat pushed a commit that referenced this pull request Dec 23, 2022
The last entry sentinel for Win64 SEH is `~0L` not NULL. Apparently
this doesn't cause issues on windows proper, but does crash wine.
Arguably if Windows doesn't have issues then we should just fix
this in wine, but since we control the source and nobody else
ever seems to have run into this, let's just fix it and save
the good Wine folks some headache. Fixes #43569.

(cherry picked from commit 722f9d4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
system:windows Affects only Windows system:wine Building Julia under Wine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

numbers test crashes under wine
5 participants