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

Segfault (use-after-free?) due to interaction between FunctionWrappers and Julia 1.10 #235

Closed
pablosanjose opened this issue Jan 19, 2024 · 1 comment · Fixed by #260
Closed

Comments

@pablosanjose
Copy link
Owner

pablosanjose commented Jan 19, 2024

Reproducer:

using Quantica
h = HP.graphene();
b = bands(h, showprogress = false);
using Makie
b = bands(h, showprogress = false);

error: ERROR: BoundsError: attempt to access 0-element Vector{Int64} at index [140631932973185]

The issue seems to be that in apply(solver::AbstractEigenSolver, h::AbstractHamiltonian, ::Type{S}, mapping, transform) (in apply.jl) gets freed after exiting the function, despite the closure on it.

If we add a call sfunc(zero(S)) at the linked line (just after defining sfunc) the segfault disappears.

The issue is only observed under Linux, starting on 1.10.0-beta1 till at least 1.10.0

EDIT: The issue is not specific to using Makie. Using some other large enough package (e.g. Symbolics) also triggers the issue.

@pablosanjose
Copy link
Owner Author

pablosanjose commented Jan 22, 2024

We have a workaround in #234, but this should probably be left open to remember to remove it when things are fixed upstream. At that point, the workaround should be removed

pablosanjose added a commit that referenced this issue Apr 4, 2024
pablosanjose added a commit that referenced this issue Apr 4, 2024
constrain version range

tighten version range
pablosanjose added a commit that referenced this issue Apr 4, 2024
* @static on #235 workaround

constrain version range

tighten version range

* constrain operating system for workaround

* refine check
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 a pull request may close this issue.

1 participant