fix: certain macos sdks set symbols to NULL, resulting in segfaults#363
fix: certain macos sdks set symbols to NULL, resulting in segfaults#363bgamari merged 5 commits intohaskell:masterfrom
Conversation
|
Looks like
|
|
@tomjaguarpaw I'm experimenting here b/c I need to know where a segfault comes from on macos, so nvm this MR for now ^^ |
yeah that's #362 |
e53f040 to
a256e89
Compare
abb7f2c to
352dba4
Compare
|
I hope I didn't run us out of actions budget. |
afe6266 to
c84ac5a
Compare
ah no just typo |
|
This fixes the issue. Unfortunately the tests we're running wouldn't be able to confirm it because their toolchain version is too old. I don't know how to fix this weird custom setup non-sense for ghc version 9.12 though. Seems like it's just bugged. On another note. It's interesting that this wasn't happening on uploads to hackage done by you @tomjaguarpaw -- I assume this is the case because the configure script you uploaded doesn't even correctly configure with posix_spawnp using fork in all cases, see #356. The configure script uploaded by you gives the following output: `./configure`crucially, all the checks for posix_spawnp related symbols are missing: Could you check whether you could upgrade your Thank you! |
|
There's another thing worth noting here. I tried to keep the change as localized to this one bug as possible. The cleanest solution here would probably be to move this check entirely to runtime, since apparently some platforms won't actually make symbols available, even if they configure with that symbol. Please tell me if you want to do that instead and get rid of all the CPP. |
I think this one is the correct way. It still not even clear to me why the system of the uploader (or rather, probably the one who runs |
For sure. It should be. It’s weird as well in the sense that
I found this all very obscure. I think both the workflow for hackage uploads (which requires „extra steps“ instead of uploading the same thing that is on GitHub) and the fact that different distributions of autotools don’t seem to do the same thing even if they’re the same version, are at fault here. |
c84ac5a to
9e54be9
Compare
|
Another thing worth noting is that other languages (like rust) prefer the |
Would you mind moving anything that is not dependent on this PR to its own PR? I can merge changes to CI very quickly but looking at code changes takes longer. |
|
The content of this change looks reasonable. I do think we should try to understand the Beyond that, I believe we should improve the traceability of our release process. The fact that we have multiple maintainers putting out releases with different |
|
Yes, I already proposed an am willing to implement outputting release ready artifacts (including the configure script) via github actions. I think this would improve reproducibility of the releases. |
In certain toolchain versions, apple will act as if symbols exist because the toolchain *can be used* for targets that have them. At runtime, however, they will be NULL. This resulted in a segfault trying to use the posix_spawn_file_actions_addchidr symbol. The resultion is as follows: If both symbols are available, first check if the _np version *should* be available, if it is, add a runtime check whether the non-_np version is NULL and fallback to the _np version if it is. The easiest and safest fix here would be to move both checks entirely to the runtime, but for conservativity reasons this was not done. Resolves haskell#356.
The pragma for the changes needs to be applied for cabal version 3.14 and upwards, not 3.16
9e54be9 to
786f829
Compare
|
Yes, I think adding a workflow which produces a ready-to-upload source distribution would be a good improvement. |
Also a couple changes to ci
Resolves #356.