-
Notifications
You must be signed in to change notification settings - Fork 449
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
Lake segmentation fault #2632
Comments
Hi @tydeu , FYI. |
@yangky11 Most segfaults with Lake generally come from an out-of-date When you say edit the |
Yes, it has a similar effect to
I was talking about lean4-example's lean-toolchain. |
Are you saying that deleting the LeanInfer's |
@tydeu Yes, exactly. I'm not sure if this has anything to do with cloud release. |
Just confirming that I can reproduce the segfault per the instructions. |
The segfault in the Reservoir testbed for LeanInfer implies that this bug applies to LeanInfer directly. That means the likely source of this problem is likely the @yangky11 The testbed also flagged a separate problem which is that the |
Yes, I just verified that the bug applies to both LeanInfer itself and its dependencies.
This is just outdated lake-manifest.json. I just fixed this problem, but it seems to have nothing to do with segfaults. |
The problem seems to be LeanInfer's lakefile.olean. When working with LeanInfer directly (instead of its dependencies), removing lakefile.olean will fix the segfault (for one time). |
Since |
@yangky11 Yean. Unfortunately, debugging segfault issues in Lean is rather hard. There are a lot of moving pieces to this one and there is nothing very clearly amiss that is a likely root cause. I have been thinking about it a lot, but I do not have an answer yet. One thing that could help would be to see if we cannot reproduce a segfault like in a toy setup (i.e. a minimal working example for this bug would be great). |
@tydeu Thanks! I'll try to simplify LeanInfer to create a minimal example. |
@tydeu This is a minimal example: https://github.com/lean-dojo/LeanInfer/tree/segfault. This is how to reproduce the error:
It looks like the error is related to how we check arm64 vs. x64 in lakefile.lean. |
@yangky11 Ah, that is what I feared it might be. I imagine the problem stems from how we are gluing the lakefile environment to the imported environment. I think we may need to wait for @Kha's expertise to debug this (as he wrote that glue code). However, I may give investigating it myself a try (or work on a workaround). |
@tydeu could you point to the code that does this gluing? I'm not sure I can help, but as I've been gluing environments together recently for the REPL and lean4checker I would at least be interested. |
@semorrison The glue code is: lean4/src/lake/Lake/Load/Elab.lean Lines 97 to 119 in fb0d024
|
Ooh, okay that is a scarier part of the API than I have previously used. :-) |
Hi @tydeu, I see a PR related to this issue has been merged. Has the problem been fixed? Will it be part of the next release? |
@yangky11 |
Prerequisites
Description
I get segmentation faults when running any lake commands, including
lake build
andlake clean
. The problem only happens when all of the following three conditions are met:leanprover/lean4:v4.2.0-rc1
(No problem withleanprover/lean4:v4.0.0
).lake build
).Steps to Reproduce
LeanInfer-demo
branch of lean4-example.leanprover/lean4:v4.2.0-rc1
.lake build
lake build
to finish or just kill it in the middle. Then runlake build
for a second time and you'll seeSegmentation fault (core dumped)
. In this state, running any lake command will run into segmentation faults, unless you remove the lakefile.olean of LeanInfer.Versions
Lean (version 4.2.0-rc1, commit a62d2fd49796, Release)
The text was updated successfully, but these errors were encountered: