leanprover-community / leanprover-community/lean

Segfault during type checking

Open
#438 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug crash
Dominant language
C++
Stars
434
Forks
79
PR merge metrics
No merged PRs in 30d

Description

Prerequisites
  • Put an X between the brackets on this line if you have done all of the following:
    • Checked that your issue isn't already filed.
    • Reduced the issue to a self-contained, reproducible test case.
Description

Lean segfaults when type checking rather than giving a proper error.

Steps to Reproduce
inductive convex_hull : set α
| intrv (v₁ ∈ convex_hull) : convex_hull v₁

Expected behavior: A proper error about neither α nor set being known identifiers, or if they're in the context, acceptance.

Actual behavior: Lean segfaults with no output. For some people, a very similar example was producing many "unreachable code" errors, but I wasn't getting them on my particular setup.

The alternative version:

inductive convex_hull (s : set α) : set α
| of_set : ∀ v ∈ s, convex_hull v
| intrv (v₁ v₂ ∈ convex_hull) : convex_hull v₁

Reproduces how often: 100% (for me)

Versions

Lean (version 3.18.4, commit f539be1e867c, Release)
Windows 10

Additional Information

A segfault with no output occurs with both of the examples given on my machine, but some people who tried it in the zulip had unreachable code errors. One member had Lean continue working fine for the second example despite still giving unreachable code errors, though I couldn't reproduce.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce both inductive examples with Lean 3.18.4 on the reported setup, starting from the type-checking path mentioned in the issue. Done means neither example segfaults or emits unreachable-code failures, and invalid identifiers produce proper errors while valid contextual identifiers are accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.