all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: luangruo@yahoo.com, casouri@gmail.com, mickey@masteringemacs.org,
	60237@debbugs.gnu.org
Subject: bug#60237: 30.0.50; tree sitter core dumps when I edebug view a node
Date: Wed, 01 Mar 2023 09:08:03 -0500	[thread overview]
Message-ID: <jwvzg8wzhxk.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83mt4wfvpd.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 01 Mar 2023 15:27:26 +0200")

Eli Zaretskii [2023-03-01 15:27:26] wrote:

>> From: Stefan Monnier <monnier@iro.umontreal.ca>
>> Cc: casouri@gmail.com,  luangruo@yahoo.com,  mickey@masteringemacs.org,
>>   60237@debbugs.gnu.org
>> Date: Tue, 28 Feb 2023 23:07:47 -0500
>> 
>> >> > Stefan, could it be a problem for us if garbage-collecting an object
>> >> > calls xmalloc?  Including if the "memory" profiler is running at the
>> >> > time of that GC?
>> >> 
>> >> I can't think of a fundamental reason why this would be a problem, but
>> >> as you've seen some code may not be quite ready for it.
>> >> 
>> >> I suspect the simplest solution is to do something like what we do
>> >> for the cpu-profiler, i.e. handle the "time within GC" specially by
>> >> checking (EQ (backtrace_top_function (), QAutomatic_GC)) to determine
>> >> that we're within the GC.
>> >
>> > Any reason not to install the patch that uses gcsize instead of ASIZE?
>> 
>> That might work, but I suspect there's a good reason why I used
>> `cpu_gc_count`.  I think running the "normal" profiling code during GC
>> can cause other problems than just ASIZE because it can/will change
>> ELisp objects, and modifying the heap while we're doing GC is the
>> problem that concurrent GCs try to solve: our GC is not equipped
>> for that.
>
> Would you mind installing a change along these lines on the emacs-29
> branch?  I'm not familiar enough with profiler.c to experiment with
> its code on the release branch.

For `emacs-29` I suggest we just use the patch below which should
circumvent the problem.


        Stefan


diff --git a/src/profiler.c b/src/profiler.c
index 81b5e7b0cf0..c99ed0a81a2 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -505,6 +505,8 @@ DEFUN ("profiler-memory-log",
 void
 malloc_probe (size_t size)
 {
+  if (EQ (backtrace_top_function (), QAutomatic_GC))
+    return;                     /* bug#60237 */
   eassert (HASH_TABLE_P (memory_log));
   record_backtrace (XHASH_TABLE (memory_log), min (size, MOST_POSITIVE_FIXNUM));
 }






  reply	other threads:[~2023-03-01 14:08 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21 12:24 bug#60237: 30.0.50; tree sitter core dumps when I edebug view a node Mickey Petersen
2022-12-24  7:23 ` Eli Zaretskii
2022-12-24  9:20 ` Yuan Fu
2022-12-29 14:21   ` Mickey Petersen
2023-02-24 23:22 ` Yuan Fu
2023-02-25  7:13   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-25  7:51   ` Eli Zaretskii
2023-02-26  2:01     ` Yuan Fu
2023-02-26  2:37       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-26  6:18         ` Eli Zaretskii
2023-02-26  6:14       ` Eli Zaretskii
2023-02-26 15:16         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-28 14:00           ` Eli Zaretskii
2023-03-01  4:07             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-01 13:27               ` Eli Zaretskii
2023-03-01 14:08                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-03-01 15:51                   ` Eli Zaretskii
2023-03-01 17:39                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-04 12:21                       ` Eli Zaretskii
2023-03-08 16:34                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-10 18:28                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-10 20:56                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-11  6:45                               ` Eli Zaretskii
2023-03-11 17:45                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-10 23:52                             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-11  2:41                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-11  3:29                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-11  3:38                                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-02  5:53                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-02 20:24                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-26  9:41       ` Mickey Petersen
2023-02-27  0:34         ` Yuan Fu
2023-02-27  8:22           ` Mickey Petersen
2023-02-27  9:05             ` Yuan Fu
2023-02-27 14:29               ` Mickey Petersen
2023-02-27 22:37                 ` Yuan Fu
2023-02-27 22:45                   ` Dmitry Gutov
2023-02-24 23:29 ` Yuan Fu
2023-02-25  7:55   ` Eli Zaretskii
2023-02-26  2:02     ` Yuan Fu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvzg8wzhxk.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=60237@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=eliz@gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=mickey@masteringemacs.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.