From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Erik Overdahl Newsgroups: gmane.emacs.bugs Subject: bug#66549: 29.1.50; SIGABRT received parsing file with tree-sitter in PGTK Emacs Date: Tue, 17 Oct 2023 16:24:44 -0500 Message-ID: References: <83bkd0qw8j.fsf@gnu.org> <83a5sjpuna.fsf@gnu.org> <835y36q003.fsf@gnu.org> <83pm1enfrd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007b50df0607f0277a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32346"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66549@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 17 23:37:49 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qsrl6-0008EJ-DL for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Oct 2023 23:37:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qsrkx-0007OO-3J; Tue, 17 Oct 2023 17:37:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qsrkv-0007OD-RQ for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2023 17:37:37 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qsrkv-0004r9-JB for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2023 17:37:37 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qsrlL-00051c-5K for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2023 17:38:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Erik Overdahl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Oct 2023 21:38:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66549 X-GNU-PR-Package: emacs Original-Received: via spool by 66549-submit@debbugs.gnu.org id=B66549.169757865119246 (code B ref 66549); Tue, 17 Oct 2023 21:38:03 +0000 Original-Received: (at 66549) by debbugs.gnu.org; 17 Oct 2023 21:37:31 +0000 Original-Received: from localhost ([127.0.0.1]:32898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsrkl-00050F-9m for submit@debbugs.gnu.org; Tue, 17 Oct 2023 17:37:31 -0400 Original-Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:43160) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsrZ9-0004ew-Qk for 66549@debbugs.gnu.org; Tue, 17 Oct 2023 17:25:29 -0400 Original-Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6b44befac59so3379023b3a.0 for <66549@debbugs.gnu.org>; Tue, 17 Oct 2023 14:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697577896; x=1698182696; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=FxoSSJnRqnHb9pBQVjYp7U5GqoDIiQAS+hfFo4xZ8Oo=; b=WMeidxpj4Q9z+sE5YGQA4vD1sihO7ZysVpX67SXs/1SA8MntTtYufxR+UHOkA560wH Y2XsYSp0QMBkgKHT8EGjJnl98wnAU6zgb4NA1Lj07VIZ/8Ux4GyIh0YXjQLg8zoIPtfp Jn8AyfjNxCtNZvkJqvnOkorerRrK+Jg3HyAI8cF/YFZFHmVOWkKJdq10Zjvj7TCIin8K kfh4ph75dVZt41JVE628no6QPbzNFOlg3pLf1Fnftk7DJM1sbSLZ9WkV1ZGAhsrwudsU CG45hqdYOkc7Mr8Qd2+DNsyKoRNLmMgq5WS2lKeh7pfo85DiNow5MV9nTFqhVrktT3kh vhmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697577896; x=1698182696; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FxoSSJnRqnHb9pBQVjYp7U5GqoDIiQAS+hfFo4xZ8Oo=; b=g6fwN/M9Xk9AVF8B7z6flubyuSnXIwY/HyEOfj4lQz/iRa3pfdL3f+kOv/U38NIRkW a58zJ97gRfZ6tjmEPpNyDKTV88p0Yn96lSKccShEvAtHYcDWNfh+Gk3SRzjqsiYGeYNb Nm32Ft8QzCqvk75MxWEcaDLZEwRrcuaoHhdS3Tzimpdxup/N6uiiLulxhfHnwG0hCL5T FMOxG6Pdo/ktwpdMA631zazMpAOue2x4quGCWu9SrzKk9KQ13RO1jxaegzdNw4+tK23C Xtuf4SMbRmW5Iicrjc12FxtwY6zFGf1Fqr9d7rdtZ/3/pPgMsZiDBzy4KAjktacqAGR8 wtAw== X-Gm-Message-State: AOJu0YwEJ2xWkFs1xt66PADAKscqFzPliF1KH1CLnx1YjTyLDmw1YDtZ Agn+/ePCe0y0Rs3dN2Jc/3Wb4DtgyQd/vTpBxxemgiY9 X-Google-Smtp-Source: AGHT+IGTSxcZYnc8vEOtugRJz0ChmY8oeWpxxzd1SoUiT4INWHnfgqgdKXWAnNE1hJZmzKTvSQQPQwjAS1pseiZCEoo= X-Received: by 2002:a05:6a20:3d14:b0:15e:9923:3e35 with SMTP id y20-20020a056a203d1400b0015e99233e35mr4290332pzi.19.1697577896201; Tue, 17 Oct 2023 14:24:56 -0700 (PDT) In-Reply-To: <83pm1enfrd.fsf@gnu.org> X-Mailman-Approved-At: Tue, 17 Oct 2023 17:37:26 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272638 Archived-At: --0000000000007b50df0607f0277a Content-Type: text/plain; charset="UTF-8" I have run the commands (adding -fPIC for linux). I can confirm that using the resulting shared object does not crash Emacs. A bit of experimentation reveals that the crash occurs only when the grammar is compiled with -O0. However, despite not crashing, Emacs does not parse the file successfully, although I agree this may be a separate issue. On Mon, Oct 16, 2023 at 21:29 Eli Zaretskii wrote: > [Please use Reply All when replying to keep the bug tracker CC'ed.] > > > From: Erik Overdahl > > Date: Mon, 16 Oct 2023 18:21:26 -0500 > > > > > After cloning the repository, I ran the following commands: > > > > > > cd src > > > gcc -O2 -I. -MMD -MF ./parser.d -MP -c -o parser.o parser.c > > > gcc -O2 -I. -MMD -MF ./scanner.d -MP -c -o scanner.o scanner.c > > > gcc -shared parser.o scanner.o -ltree-sitter -o > libtree-sitter-hcl.dll > > > > > > (This is on Windows, thus the .dll extension and no -fPIC compiler > > > switch.) Your link command line, viz.: > > > > > > cc -fPIC -shared *.o -o libtree-sitter-hcl.so > > > > > > lacks the -ltree-sitter switch, though, which may or may not be the > > > problem. > > > > If there is a problem with the command I used to build the grammar, then > there is a problem with the > > function `treesit-install-language-grammar`, as I copied the commands > directly from there. I imagine > > this is how most users would install this grammar? > > Maybe there is a problem, but please try compiling using the above > commands, and see if the problem is gone. We must establish the root > cause before we assign blame or consider where and how to fix the > problem. > > So: did the above commands fix the problem for you. > > > I have discovered another oddity. > > Thanks, but I'm not sure this is related. I think we should focus on > fixing the crash first. > --0000000000007b50df0607f0277a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I have run the commands (adding -fPIC for linux). I can c= onfirm that using the resulting shared object does not crash Emacs. A bit o= f experimentation reveals that the crash occurs only when the grammar is co= mpiled with -O0. However, despite not crashing, Emacs does not parse the fi= le successfully, although I agree this may be a separate issue.=C2=A0
=

O= n Mon, Oct 16, 2023 at 21:29 Eli Zaretskii <eliz@gnu.org> wrote:
[Please use Reply= All when replying to keep the bug tracker CC'ed.]

> From: Erik Overdahl <erik.overdahl@gmail.com>
> Date: Mon, 16 Oct 2023 18:21:26 -0500
>
> > After cloning the repository, I ran the following commands:
> >
> > cd src
> > gcc -O2 -I. -MMD -MF ./parser.d -MP=C2=A0 =C2=A0-c -o parser.o pa= rser.c
> > gcc -O2 -I. -MMD -MF ./scanner.d -MP=C2=A0 =C2=A0-c -o scanner.o = scanner.c
> > gcc=C2=A0 -shared parser.o scanner.o=C2=A0 -ltree-sitter -o libtr= ee-sitter-hcl.dll
> >
> > (This is on Windows, thus the .dll extension and no -fPIC compile= r
> > switch.)=C2=A0 Your link command line, viz.:
> >
> >=C2=A0 cc -fPIC -shared *.o -o libtree-sitter-hcl.so
> >
> > lacks the -ltree-sitter switch, though, which may or may not be t= he
> > problem.
>
> If there is a problem with the command I used to build the grammar, th= en there is a problem with the
> function `treesit-install-language-grammar`, as I copied the commands = directly from there. I imagine
> this is how most users would install this grammar?

Maybe there is a problem, but please try compiling using the above
commands, and see if the problem is gone.=C2=A0 We must establish the root<= br> cause before we assign blame or consider where and how to fix the
problem.

So: did the above commands fix the problem for you.

> I have discovered another oddity.

Thanks, but I'm not sure this is related.=C2=A0 I think we should focus= on
fixing the crash first.
--0000000000007b50df0607f0277a--