GNU bug report logs - #68954
[PATCH] Crasher in treesit_traverse_get_predicate

Previous Next

Package: emacs;

Reported by: Dominique Quatravaux <dominique <at> quatravaux.org>

Date: Tue, 6 Feb 2024 17:09:01 UTC

Severity: normal

Tags: patch

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 68954 in the body.
You can then email your comments to 68954 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#68954; Package emacs. (Tue, 06 Feb 2024 17:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dominique Quatravaux <dominique <at> quatravaux.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 06 Feb 2024 17:09:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dominique Quatravaux <dominique <at> quatravaux.org>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Crasher in treesit_traverse_get_predicate
Date: Tue, 6 Feb 2024 18:08:18 +0100
[Message part 1 (text/plain, inline)]
Because nothing guarantees or enforces that either Vtreesit_thing_settings,
or the cdrs of its elements, are cons cells, it is easy to construct values
for `treesit-thing-settings' that make Emacs crash (e.g., when calling
`prog-fill-reindent-defun' from any tree-sitter enabled mode).

The attached patch fixes that.

--
 Dominique Quatravaux
 dominique <at> quatravaux.org
[Message part 2 (text/html, inline)]
[treesit.diff (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#68954; Package emacs. (Tue, 06 Feb 2024 17:16:02 GMT) Full text and rfc822 format available.

Message #8 received at 68954 <at> debbugs.gnu.org (full text, mbox):

From: Dominique Quatravaux <dominique <at> quatravaux.org>
To: 68954 <at> debbugs.gnu.org
Subject: Offending commit
Date: Tue, 6 Feb 2024 18:15:04 +0100
[Message part 1 (text/plain, inline)]
https://github.com/emacs-mirror/emacs/commit/d005e685e1df7692085378633348db39a5190374
doesn't do what it says it does in the commit header, and is very likely
the one that introduced the crash.

--
 Dominique Quatravaux
 dominique <at> quatravaux.org
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#68954; Package emacs. (Wed, 07 Feb 2024 01:59:01 GMT) Full text and rfc822 format available.

Message #11 received at 68954 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Dominique Quatravaux <dominique <at> quatravaux.org>
Cc: 68954 <at> debbugs.gnu.org
Subject: Re: bug#68954: Offending commit
Date: Tue, 6 Feb 2024 17:58:18 -0800

> On Feb 6, 2024, at 9:15 AM, Dominique Quatravaux <dominique <at> quatravaux.org> wrote:
> 
> https://github.com/emacs-mirror/emacs/commit/d005e685e1df7692085378633348db39a5190374 doesn't do what it says it does in the commit header, and is very likely the one that introduced the crash.

Thanks! If you want to submit a patch I’m more than happy to apply it for you (you don’t need to sign the copyright assignment since it’s well under 15 LOC). Otherwise I can apply the change myself.

Also it’s a good idea to not change the email title, sometime that might break threading in email clients.

Yuan



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#68954; Package emacs. (Wed, 07 Feb 2024 07:25:02 GMT) Full text and rfc822 format available.

Message #14 received at 68954 <at> debbugs.gnu.org (full text, mbox):

From: Dominique Quatravaux <dominique <at> quatravaux.org>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 68954 <at> debbugs.gnu.org
Subject: Re: bug#68954: Offending commit
Date: Wed, 7 Feb 2024 08:24:18 +0100
[Message part 1 (text/plain, inline)]
Le mer. 7 févr. 2024 à 02:58, Yuan Fu <casouri <at> gmail.com> a écrit :



Thanks! If you want to submit a patch I’m more than happy to apply it for
you


I attached a patch to my first email already.

Also it’s a good idea to not change the email title, sometime that might
break threading in email clients.


Indeed, as can be seen right here with the patch! I'll be more careful next
time.

-- 
Dominique Quatravaux
dominique <at> quatravaux.org
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#68954; Package emacs. (Thu, 08 Feb 2024 01:37:01 GMT) Full text and rfc822 format available.

Message #17 received at 68954 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Dominique Quatravaux <dominique <at> quatravaux.org>
Cc: 68954 <at> debbugs.gnu.org
Subject: Re: bug#68954: Offending commit
Date: Wed, 7 Feb 2024 17:35:44 -0800

> On Feb 6, 2024, at 11:24 PM, Dominique Quatravaux <dominique <at> quatravaux.org> wrote:
> 
> Le mer. 7 févr. 2024 à 02:58, Yuan Fu <casouri <at> gmail.com> a écrit :
> 
> 
> Thanks! If you want to submit a patch I’m more than happy to apply it for you
> 
> I attached a patch to my first email already.

My bad, I wasn’t clear enough. I meant a patch generated by git format-patch, which includes a commit message, etc. This way when I apply it it’ll show your as the author. If you don’t care about it, I can apply the diff myself and push it.

Btw, there’s a specific format for commit messages, you can check out the CONTRIBUTE file under repo root, in the “Commit messages” section.

Actually, here’s what I would write for your change, feel free to modify it as you like.

Fix treesit_traverse_get_predicate (bug#68954)

Commit d005e685e1df7692085378633348db39a5190374 should have replaced
assq_no_quit with assq_no_signal, but didn't, this commit fixes that.

* src/treesit.c (treesit_traverse_get_predicate): Replace assq_no_quit
with assq_no_signal.


Yuan



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#68954; Package emacs. (Thu, 08 Feb 2024 09:37:02 GMT) Full text and rfc822 format available.

Message #20 received at 68954 <at> debbugs.gnu.org (full text, mbox):

From: Dominique Quatravaux <dominique <at> quatravaux.org>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 68954 <at> debbugs.gnu.org
Subject: Re: bug#68954: Offending commit
Date: Thu, 8 Feb 2024 10:36:05 +0100
[Message part 1 (text/plain, inline)]
Le jeu. 8 févr. 2024 à 02:35, Yuan Fu <casouri <at> gmail.com> a écrit :

>
>
> Actually, here’s what I would write for your change, feel free to modify
> it as you like.
>
>
Many thanks for the step-by-step instructions! Attached is what `git
format-patch` gave me, I hope that I got everything right.

Yours truly,

--
 Dominique Quatravaux
 dominique <at> quatravaux.org
[Message part 2 (text/html, inline)]
[0001-Fix-treesit_traverse_get_predicate-bug-68954.patch (application/octet-stream, attachment)]

Reply sent to Yuan Fu <casouri <at> gmail.com>:
You have taken responsibility. (Fri, 09 Feb 2024 05:29:01 GMT) Full text and rfc822 format available.

Notification sent to Dominique Quatravaux <dominique <at> quatravaux.org>:
bug acknowledged by developer. (Fri, 09 Feb 2024 05:29:02 GMT) Full text and rfc822 format available.

Message #25 received at 68954-done <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Dominique Quatravaux <dominique <at> quatravaux.org>
Cc: 68954-done <at> debbugs.gnu.org
Subject: Re: bug#68954: Offending commit
Date: Thu, 8 Feb 2024 21:27:43 -0800

> On Feb 8, 2024, at 1:36 AM, Dominique Quatravaux <dominique <at> quatravaux.org> wrote:
> 
> 
> 
> Le jeu. 8 févr. 2024 à 02:35, Yuan Fu <casouri <at> gmail.com> a écrit :
> 
> 
> Actually, here’s what I would write for your change, feel free to modify it as you like.
> 
> 
> Many thanks for the step-by-step instructions! Attached is what `git format-patch` gave me, I hope that I got everything right.
> 
> Yours truly,
>  

Great! Merged to master. Closing this. I also recommend you start your copyright assignment process, in case you contribute more in the future. You can ask for the from and instructions on emacs-devel, or just CC Eli (eliz <at> gnu.org) in this thread and ask him to send you one.

Yuan



bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 08 Mar 2024 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 187 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.