bug#81510: 31.0.90; NS (macOS): clicking a disabled (:enable nil) tab-bar item crases Emacs

Al Haji-Ali <[email protected]> Wed, 29 Jul 2026 23:52:17 +0100
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
On 29/07/2026, Alan Third wrote:
> Al Haji-Ali, are you able to check this fixes the problem for you too?

I have the same crash with this patch, it seems (btw, the issue is not
with an empty tab bar, but a disabled button), see the repro code I had
in my report.

I am not sure I fully understand the logic of the patch tbh.

The previous issue is that kbd_buffer_store_buffered_event is ultimately
called with: event->kind == NO_EVENT
which causes an emacs_abort();

This is caused in the current code because event->kind is initialized as
`NO_EVENT` and

(!(tab_bar_p && NILP (tab_bar_arg)))

is false (since in particular tab_bar_arg is NIL) and the value of kind
remains NO_EVENT.

In the patch the code:

if (tab_bar_p && NILP (tab_bar_arg))
    emacs_event->kind = NO_EVENT;

has the exact same effect, since the condition is flipped and
(tab_bar_p && NILP (tab_bar_arg))
is now true, leaving kind be NO_EVENT.

I see that w32term is doing the same thing, but I am not sure why it's
not crashing for you.

Best regards,
-- Al