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

And.left and And.right have malformed constant info #4064

Closed
1 task done
fgdorais opened this issue May 4, 2024 · 1 comment · Fixed by #4084
Closed
1 task done

And.left and And.right have malformed constant info #4064

fgdorais opened this issue May 4, 2024 · 1 comment · Fixed by #4084
Labels
bug Something isn't working

Comments

@fgdorais
Copy link
Contributor

fgdorais commented May 4, 2024

Prerequisites

  • Put an X between the brackets on this line if you have done all of the following:
    • Check that your issue is not already filed.
    • Reduce the issue to a minimal, self-contained, reproducible test case. Avoid dependencies to mathlib4 or std4.

Description

In v4.8.0-rc1, the ConstantInfo for And.left and And.right are malformed and cause lean to segfault (at least on aarch64-apple-darwin). Only the field TheoremVal.all seems affected so this is perhaps related to #4035. Also note that And.left and And.right are structure fields rather than standalone theorems.

Context

Observed after updating code to v4.8.0-rc1 when an alias foo := And.left declaration caused a server crash. Zulip mention

Steps to Reproduce

This file causes lean to segfault.

import Lean

def test : Lean.CoreM (List Lean.Name) := do
  let .thmInfo tval ← Lean.getConstInfo `And.left | unreachable!
  return tval.all

#eval test

Version: Lean (version 4.8.0-rc1, aarch64-apple-darwin, commit dcccfb73cb24, Release)

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

@fgdorais fgdorais added the bug Something isn't working label May 4, 2024
@fgdorais
Copy link
Contributor Author

fgdorais commented May 5, 2024

This is perhaps limited to declarations in Init.Prelude. The following does not cause a segfault:

import Lean

structure Both (p q : Prop) : Prop where
  fst : p
  snd : q

def test : Lean.CoreM (List Lean.Name) := do
  let .thmInfo tval ← Lean.getConstInfo `Both.fst | unreachable!
  return tval.all

#eval test

leodemoura added a commit that referenced this issue May 6, 2024
leodemoura added a commit that referenced this issue May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant