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

Segmentation Fault when loading 'coq/theories/Numbers/Cyclic/Int63/PrimInt63.v' #35

Comments

@laetitia-teo
Copy link

Hi,

I've been plagued with segfaults when opening a particular file from the standard library ('coq/theories/Numbers/Cyclic/Int63/PrimInt63.v').

I'm on Ubuntu 20.04.3 LTS.

Steps to reproduce

Pretty straightforward, the error happens on file open.

# Open Coq file
with CoqFile('/home/<user>/.opam/default/lib/coq/theories/Numbers/Cyclic/Int63/PrimInt63.v') as coq_file:
    pass

Looking into more detail, the segfault happens on flushing of the BufferedWriter in the json rpc endpoint, when sending a 'coq\getDocument' request (/coqpyt/coqpyt/lsp/json_rpc_endpoint.py, line 61):

    def send_request(self, message):  # message['method'] == 'coq/getDocument'
        """
        Sends the given message.

        :param dict message: The message to send.
        """
        try:
            json_string = json.dumps(message, cls=MyEncoder)
            jsonrpc_req = self.__add_header(
            with self.write_lock:
                self.stdin.write(jsonrpc_req.encode())
                self.stdin.flush()  # happens here
        except BrokenPipeError as e:
            logging.error(e)

I've tried reinstalling coq, using different versions of python, to no avail. Any idea of what might be happening here? This also only show up for this particular file (other coq standard theories are fine).

@Nfsaavedra
Copy link
Member

Hello @laetitia-teo,

I did some debugging and the segmentation fault apparently comes from coq-lsp, so we can't do much about it. Your best option is probably to create an issue in coq-lsp to see if they can fix the bug.

You can also try to use the last version of coq-lsp in the main branch and check if it fixes the problem.

ejgallego added a commit to rocq-archive/coq-serapi that referenced this issue Mar 20, 2024
That was a quite dumb TODO I forgot about. But indeed, GADT remain an
issue for us.

Fixes #397 , fixes sr-lab/coqpyt#35

Thanks to Laetitia Teodorescu (@laetitia-teo) and Nuno
Saavedra (@Nfsaavedra) for the bug report.
@ejgallego
Copy link

Hi folks, thanks for your patience, this is a

Duplicate of rocq-archive/coq-serapi#397

I've fixed the bug, an updated coq-serapi version should appear soon in Opam.

ejgallego added a commit to rocq-archive/coq-serapi that referenced this issue Mar 20, 2024
That was a quite dumb TODO I forgot about. But indeed, GADT remain an
issue for us.

Fixes #397 , fixes sr-lab/coqpyt#35

Thanks to Laetitia Teodorescu (@laetitia-teo) and Nuno
Saavedra (@Nfsaavedra) for the bug report.
@Nfsaavedra
Copy link
Member

Hi folks, thanks for your patience, this is a

Duplicate of ejgallego/coq-serapi#397

I've fixed the bug, an updated coq-serapi version should appear soon in Opam.

Thanks @ejgallego!

ejgallego added a commit to rocq-archive/coq-serapi that referenced this issue Mar 20, 2024
That was a quite dumb TODO I forgot about. But indeed, GADT remain an
issue for us.

Fixes #397 , fixes sr-lab/coqpyt#35

Thanks to Laetitia Teodorescu (@laetitia-teo) and Nuno
Saavedra (@Nfsaavedra) for the bug report.
ejgallego added a commit to rocq-archive/coq-serapi that referenced this issue Mar 21, 2024
That was a quite dumb TODO I forgot about. But indeed, GADT remain an
issue for us.

Fixes #397 , fixes sr-lab/coqpyt#35

Thanks to Laetitia Teodorescu (@laetitia-teo) and Nuno
Saavedra (@Nfsaavedra) for the bug report.
ejgallego added a commit to rocq-archive/coq-serapi that referenced this issue Mar 21, 2024
That was a quite dumb TODO I forgot about. But indeed, GADT remain an
issue for us.

Fixes #397 , fixes sr-lab/coqpyt#35

Thanks to Laetitia Teodorescu (@laetitia-teo) and Nuno
Saavedra (@Nfsaavedra) for the bug report.
ejgallego added a commit to rocq-archive/coq-serapi that referenced this issue Mar 21, 2024
That was a quite dumb TODO I forgot about. But indeed, GADT remain an
issue for us.

Fixes #397 , fixes sr-lab/coqpyt#35

Thanks to Laetitia Teodorescu (@laetitia-teo) and Nuno
Saavedra (@Nfsaavedra) for the bug report.
@ejgallego
Copy link

Hi folks, fixed versions are being released into opam (cc: ocaml/opam-repository#25552 for 8.19, etc... )

You can close this issue IMHO

ejgallego added a commit to ejgallego/opam-repository that referenced this issue Mar 21, 2024
ejgallego added a commit to rocq-archive/coq-serapi that referenced this issue Mar 21, 2024
That was a quite dumb TODO I forgot about. But indeed, GADT remain an
issue for us.

Fixes #397 , fixes sr-lab/coqpyt#35

Thanks to Laetitia Teodorescu (@laetitia-teo) and Nuno
Saavedra (@Nfsaavedra) for the bug report.
ejgallego added a commit to ejgallego/opam-repository that referenced this issue Mar 21, 2024
ejgallego added a commit to ejgallego/opam-repository that referenced this issue Mar 21, 2024
ejgallego added a commit to rocq-archive/coq-serapi that referenced this issue Mar 21, 2024
That was a quite dumb TODO I forgot about. But indeed, GADT remain an
issue for us.

Fixes #397 , fixes sr-lab/coqpyt#35

Thanks to Laetitia Teodorescu (@laetitia-teo) and Nuno
Saavedra (@Nfsaavedra) for the bug report.
ejgallego added a commit to rocq-archive/coq-serapi that referenced this issue Mar 21, 2024
That was a quite dumb TODO I forgot about. But indeed, GADT remain an
issue for us.

Fixes #397 , fixes sr-lab/coqpyt#35

Thanks to Laetitia Teodorescu (@laetitia-teo) and Nuno
Saavedra (@Nfsaavedra) for the bug report.
ejgallego added a commit to ejgallego/opam-repository that referenced this issue Mar 21, 2024
ejgallego added a commit to ejgallego/opam-repository that referenced this issue Mar 21, 2024
ejgallego added a commit to ejgallego/opam-repository that referenced this issue Mar 21, 2024
ejgallego added a commit to ejgallego/opam-repository that referenced this issue Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment