-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Segfault (during precompilation) with map(zip(a, b)) do (a, b)
inside a macro
#50538
Comments
I don't see a segfault, I just get a regular error. Could you post what you see so I can investigate that? Meanwhile, I will look into what triggered this error.
|
To some extent, this is just your run-of-the-mill typical bug in macroexpand.scm hygiene pass not understanding that parameters can be grouped in argument lists so it converts those into globals: julia> @macroexpand @map_test
quote
#= REPL[11]:3 =#
((Main.x1, Main.x2),)->begin
#= REPL[11]:3 =#
return
end
end |
Usually this is caught by use of `eval`, but we should try to move away from that broad rule to specific functions such as this one, such that eventually we can remove that rule from `eval`. Fix #50538
Sure, thank you for investigating that error.
|
Ah, right, we only added this error in v1.10, but it just crashes in v1.9 |
I have encountered segmentation faults in Julia 1.9 in the following specific test case: a module
MWE2
makes a call to a macro that's defined in another module,MWE1
, where the macro features a construct of the formmap(zip(a, b)) do (a, b)
.Interestingly, the same construct works as expected when wrapped as a function (defined in
MWE1
) or when the exact same macro, but defined inMWE2
, is called. It also works fine in Julia 1.8; or if you disable precompilation in 1.9 using__precompile__(false)
.Minimal Reproducible Example
Version
It fails in Julia 1.9, but works in Julia 1.8.
Modules Setup
For local setup of the module structure, you may use the following convenience script:
The text was updated successfully, but these errors were encountered: