Subject: Re: bug#67900: 30.0.50; Emacs Crahes When Executing Command `consult-buffer'

From: Andrea Corallo <[email-masked]>
Date: Tue, 26 Dec 2023 03:32:11 -0500

Eli Zaretskii <[email-masked]> writes:

>> From: Chang Xiaoduan <[email-masked]>
>> Cc: [email-masked],  [email-masked]
>> Date: Sat, 23 Dec 2023 10:30:14 +0800
>>
>> I have added a file-local prop-line to each of bytecomp.el, mule.el and
>> startup.el, which sets the `native-comp-speed` to 1. Then I rebuilt
>> Emacs and test with a cosnult.el with `native-comp-speed` as 2. Is this
>> the correct setup to test? The result: Emacs still crashes when
>> executing `consult-buffer`.

Yes if consult.el was recompiled in this setup.

>> Further more, I have another test with `native-comp-speed` in comp.el
>> set to 1. That is, the default optimizaiton level for all
>> native-compiled lisp code is 1. Then, I add a file-local prop-line in
>> consult.el and set the `native-comp-speed` to 2. The result: Emacs still
>> crashes when executing `consult-buffer`.
>>
>> I guess this is enough to confirm that the miscompiled code is in
>> consult.el.
>
> I think so, yes.  Andrea, do you agree?

Yes I think so.

>> What should I do next?
>
> If Andrea agrees, I hope he will be able to propose a way of narrowing
> this down, tailored specifically to the code in consult.el.

I think the next step is to narrow down the miss-compiled function.  For
that we can tweak speed on function basis like:

(defun foo (x y)
  (declare (speed 1))
  (+ x y))

As usual I'd start probing the suspect function `consult-buffer` and if
we find is not the coolprint I'd probably bisect all the functions in
the compilation unit.

Thanks

  Andrea