bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#60237: 30.0.50; tree sitter core dumps when I edebug view a node


From: Po Lu
Subject: bug#60237: 30.0.50; tree sitter core dumps when I edebug view a node
Date: Thu, 02 Mar 2023 13:53:54 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> 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));
>  }

Shouldn't this be:

  if (gc_in_progress)
    return;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]