GNU bug report logs - #74274
[PATCH] Revert part of d3f8ed730f to avoid segmentation fault

Previous Next

Package: emacs;

Reported by: Gong Qijian <gongqijian <at> gmail.com>

Date: Sat, 9 Nov 2024 01:21:01 UTC

Severity: normal

Tags: patch

Fixed in version 31.1

Done: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Gong Qijian <gongqijian <at> gmail.com>
Cc: Gerd Möllmann <gerd <at> gnu.org>, 74274 <at> debbugs.gnu.org
Subject: bug#74274: [PATCH] Revert part of d3f8ed730f to avoid segmentation fault
Date: Sat, 09 Nov 2024 05:15:29 +0100
Gong Qijian <gongqijian <at> gmail.com> writes:

> Patch for branch scratch/tty-child-frames to avoid segmentation fault.
>
> The issue can be triggered by the message function when creating a tty
> child frame during the initialization process.
>
> Reproduce:
>
>   $ src/emacs -nw -Q --eval "\
>     (progn
>       (require 'cl-lib)
>       (require 'tty-tip)
>       (advice-add 'tty-tip--compute-position :around
>        (defun tty-tip--compute-position <at> fix-nil-error (&rest args)
>          (cl-letf ((orig-mouse-position (symbol-function #'mouse-position))
>                    ((symbol-function #'mouse-position)
>                     (lambda ()
>                       (if (terminal-parameter nil 'xterm-mouse-x)
>                           (funcall orig-mouse-position)
>                         (cons (window-frame) (posn-x-y (posn-at-point)))))))
>            (apply args))))
>
>       (tty-tip--create-frame \"line1\nline2\")
>       (message \"tty-type: %S\" (tty-type)))"
>   Fatal error 11: Segmentation fault
>   ^[[Ifish: Job 1, 'src/emacs -nw -Q --eval "\…' terminated by signal (pro… (SIGABRT)
>   fish: Job Abort, '' terminated by signal  ()

Thanks Gong Qijian, I think I can reproduce this here. Before debugging
this, I'd like to understand your test case a bit better, though. (And
I'm procrastinating a bit :-).)

Do I understand this right, that the advice you add to
tty-tip-compute-position only serves the purpose of being able to pop up
a tip frame early, when mouse-position doesn't really have a position to
report? Or does it also serve another purpose?

Another interesting question would be in which other, let's say more
normal, circumstances you observe this segfault.




This bug report was last modified 285 days ago.

Previous Next


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