GNU bug report logs - #38757
emacs-27; reliably crashes when wrapping visual lines

Previous Next

Package: emacs;

Reported by: "Paul W. Rankin" <hello <at> paulwrankin.com>

Date: Fri, 27 Dec 2019 02:28:01 UTC

Severity: normal

Tags: fixed

Merged with 38564

Found in version 27.0.50

Fixed in version 27.1

Done: Alan Third <alan <at> idiocy.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 38757 in the body.
You can then email your comments to 38757 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#38757; Package emacs. (Fri, 27 Dec 2019 02:28:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Paul W. Rankin" <hello <at> paulwrankin.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 27 Dec 2019 02:28:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Paul W. Rankin" <hello <at> paulwrankin.com>
To: bug-gnu-emacs <at> gnu.org
Subject: emacs-27; reliably crashes when wrapping visual lines
Date: Fri, 27 Dec 2019 12:27:02 +1000
Emacs 27 when run in console mode (i.e. without NS/X window system) will
reliably crash completely when running stable code for minor mode
olivetti (included below in full for convenience). This code has been
stable since 24.5, and so represents a regression in 27.0, I suspect in
the display code.

The crash occurs when minor mode is enabled in a buffer with text lines
long enough to wrap visually, or enabled in empty buffer within which
enough text is then entered to wrap lines visually.

I am happy to test fixes applied to the emacs-27 branch.


Steps to reproduce:

1. checkout emacs-27 branch and build
2. emacs -nw -Q
3. load-library olivetti (included in full below)
4. olivetti-mode [in buffer with wrapped lines]

Expected results:

Lines wrap as normal without crash. Stable code for minor mode functions
as normal.

Actual results:

Emacs crashes to console without warning or error message.


;;; olivetti.el --- Minor mode for a nice writing environment -*- lexical-binding: t; -*-

;; Copyright (c) 2014-2019 Free Software Foundation, Inc.
;; Copyright (c) 2019 Paul W. Rankin

;; Author: Paul W. Rankin <code <at> paulwrankin.com>
;; Keywords: wp, text
;; Version: 1.8.1
;; Package-Requires: ((emacs "24.5"))
;; URL: https://gthub.com/rnkn/olivetti

;; This file is not part of GNU Emacs.

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:

;; # Olivetti #

;; A simple Emacs minor mode for a nice writing environment.

;; Screenshot: https://f002.backblazeb2.com/file/pwr-share/olivetti.png

;; ## Features ##

;; - Set a desired text body width to automatically resize window margins to
;;   keep the text comfortably in the middle of the window.
;; - Text body width can be the number of characters (an integer) or a fraction
;;   of the window width (a float between 0.0 and 1.0).
;; - Interactively change body width with:
;;   olivetti-shrink C-c { { { ...
;;   olivetti-expand C-c } } } ...
;;   olivetti-set-width C-c \
;; - If olivetti-body-width is an integer, the text body width will scale with
;;   use of text-scale-mode, whereas if a fraction (float) then the text body
;;   width will remain at that fraction.
;; - Optionally remember the state of visual-line-mode on entry and recall its
;;   state on exit.

;; Olivetti keeps everything it does buffer-local, so you can write prose in one
;; buffer and code in another, side-by-side in the same frame. For those looking
;; for a hardcore distraction-free writing mode with a much larger scope, I
;; recommend writeroom-mode: https://github.com/joostkremers/writeroom-mode.

;; ## Requirements ##

;; - Emacs 24.5

;; ## Installation ##

;; The latest stable release of Olivetti is available via [MELPA-stable]
;; and can be installed with:

;;     M-x package-install RET olivetti RET

;; Alternately, download the [latest release], move this file into your
;; load-path and add to your .emacs/init.el file:

;;     (require 'olivetti)

;; If you prefer the latest but perhaps unstable version, install via
;; [MELPA], or clone the repository into your load-path and require as
;; above:

;;     git clone https://github.com/rnkn/olivetti.git

;; [melpa]: https://melpa.org/#/olivetti "MELPA"
;; [melpa-stable]: https://stable.melpa.org/#/olivetti "MELPA-stable"
;; [latest release]: https://github.com/rnkn/olivetti/releases/latest "Olivetti latest release"

;; ## Contributing ##

;; Please report bugs and request features at:
;; https://github.com/rnkn/olivetti/issues

;; ## Hints ##

;; To always use a different width for a specific file, set a File
;; Variable:

;;     M-x add-file-local-variable RET olivetti-body-width RET 66 RET

;; See (info "(emacs) File Variables")


;;; Code:

(defgroup olivetti ()
  "Minor mode for a nice writing environment"
  :prefix "olivetti-"
  :group 'text)


;;; Variables

(defvar-local olivetti--visual-line-mode
  nil
  "Non-nil if `visual-line-mode' is active when `olivetti-mode' is turned on.")


;;; Options

(defcustom olivetti-body-width
  70
  "Text body width to which to adjust relative margin width.

If an integer, set text body width to that integer in columns; if
a floating point between 0.0 and 1.0, set text body width to
that fraction of the total window width.

An integer is best if you want text body width to remain
constant, while a floating point is best if you want text body
width to change with window width.

The floating point can anything between 0.0 and 1.0 (exclusive),
but it's better to use a value between about 0.33 and 0.9 for
best effect.

This option does not affect file contents."
  :type '(choice (integer 70) (float 0.5))
  :safe 'numberp)
(make-variable-buffer-local 'olivetti-body-width)

(defcustom olivetti-minimum-body-width
  40
  "Minimum width in columns that text body width may be set."
  :type 'integer
  :safe 'integerp)

(defcustom olivetti-lighter
  " Olv"
  "Mode-line indicator for `olivetti-mode'."
  :type '(choice (const :tag "No lighter" "") string)
  :safe 'stringp)

(defcustom olivetti-recall-visual-line-mode-entry-state
  t
  "Recall the state of `visual-line-mode' upon exiting.

When non-nil, if `visual-line-mode' is inactive upon activating
`olivetti-mode', then `visual-line-mode' will be deactivated upon
exiting. The reverse is not true."
  :type 'boolean
  :safe 'booleanp)


;;; Set Environment

(defun olivetti-set-all-margins ()
  "Balance window margins in all windows displaying current buffer.

Cycle through all windows in all frames displaying the current
buffer, and call `olivetti-set-margins'."
  (dolist (window (get-buffer-window-list nil nil t))
    (olivetti-set-margins window)))

(defun olivetti-set-margins (&optional frame-or-window)
  "Balance window margins displaying current buffer.

If FRAME-OR-WINDOW is a frame, cycle through windows displaying
current buffer in that frame, otherwise only work on the selected
window.

First find the `olivetti-safe-width' to which to set
`olivetti-body-width', then find the appropriate margin size
relative to each window. Finally set the window margins, taking
care that the maximum size is 0."
  (if (framep frame-or-window)
      (dolist (window (get-buffer-window-list nil nil frame-or-window))
        (olivetti-set-margins window))
    ;; FRAME-OR-WINDOW passed below *must* be a window
    (olivetti-reset-window frame-or-window)
    (let ((width (olivetti-safe-width olivetti-body-width frame-or-window))
          (frame (window-frame frame-or-window))
          (window-width (window-total-width frame-or-window))
          (fringes (window-fringes frame-or-window))
          left-fringe right-fringe margin-total left-margin right-margin)
      (cond ((integerp width)
             (setq width (olivetti-scale-width width)))
            ((floatp width)
             (setq width (* window-width width))))
      (setq left-fringe (/ (car fringes) (float (frame-char-width frame)))
            right-fringe (/ (cadr fringes) (float (frame-char-width frame))))
      (setq margin-total (max (/ (- window-width width) 2) 0)
            left-margin (max (round (- margin-total left-fringe)) 0)
            right-margin (max (round (- margin-total right-fringe)) 0))
      (set-window-parameter frame-or-window 'split-window 'olivetti-split-window)
      (set-window-margins frame-or-window left-margin right-margin))))

(defun olivetti-reset-all-windows ()
  "Remove Olivetti's parameters and margins from all windows.

Cycle through all windows displaying current buffer and call
`olivetti-reset-window'."
  (dolist (window (get-buffer-window-list nil nil t))
    (olivetti-reset-window window)))

(defun olivetti-reset-window (window)
  "Remove Olivetti's parameters and margins from WINDOW."
  (when (eq (window-parameter window 'split-window) 'olivetti-split-window)
    (set-window-parameter window 'split-window nil))
  (set-window-margins window nil))

(defun olivetti-split-window (&optional window size side pixelwise)
  "Call `split-window' after resetting WINDOW.
Pass SIZE, SIDE and PIXELWISE unchanged."
  (olivetti-reset-window window)
  (split-window window size side pixelwise))

(defun olivetti-split-window-sensibly (&optional window)
  "Like `olivetti-split-window' but call `split-window-sensibly'.
Pass WINDOW unchanged."
  (olivetti-reset-window window)
  (split-window-sensibly window))


;;; Calculate Width

(defun olivetti-scale-width (n)
  "Scale N in accordance with the face height.

For compatibility with `text-scale-mode', if
`face-remapping-alist' includes a :height property on the default
face, scale N by that factor if it is a fraction, by (height/100)
if it is an integer, and otherwise scale by 1."
  (let
      ((height (plist-get (cadr (assq 'default face-remapping-alist)) :height)))
    (cond
     ((integerp height) (* n (/ height 100.0)))
     ((floatp height) (* n height))
     (t n))))

(defun olivetti-safe-width (width window)
  "Parse WIDTH to a safe value for `olivetti-body-width' for WINDOW.

May return a float with many digits of precision."
  (let ((window-width (window-total-width window))
        (fringes (window-fringes window))
        (min-width (+ olivetti-minimum-body-width
                      (% olivetti-minimum-body-width 2))))
    (setq window-width
          (- window-width
             (/ (* (max (car fringes) (cadr fringes)) 2)
                (float (frame-char-width (window-frame window))))
             (% window-width 2)))
    (cond ((integerp width)
           (max min-width (min width (floor window-width))))
          ((floatp width)
           (max (/ min-width window-width) (min width 1.0)))
          ((user-error "`olivetti-body-width' must be an integer or a float")
           ;; FIXME: This code is unreachable since we signal an error before
           ;; getting here!?
           (eval (car (get 'olivetti-body-width 'standard-value)) t)))))


;;; Width Interaction

(defun olivetti-set-width (n)
  "Set text body width to N with relative margins.

N may be an integer specifying columns or a float specifying a
fraction of the window width."
  (interactive
   (list (or current-prefix-arg
             (read-number "Set text body width (integer or float): "
                          olivetti-body-width))))
  (setq olivetti-body-width n)
  (olivetti-set-all-margins)
  (message "Text body width set to %s" olivetti-body-width))

(defun olivetti-expand (&optional arg)
  "Incrementally increase the value of `olivetti-body-width'.

If prefixed with ARG, incrementally decrease."
  (interactive "P")
  (let* ((p (if arg -1 1))
         (n (cond ((integerp olivetti-body-width)
                   (+ olivetti-body-width (* 2 p)))
                  ((floatp olivetti-body-width)
                   (+ olivetti-body-width (* 0.01 p))))))
    (setq olivetti-body-width (olivetti-safe-width n (selected-window))))
  (olivetti-set-all-margins)
  (message "Text body width set to %s" olivetti-body-width)
  (set-transient-map
   (let ((map (make-sparse-keymap)))
     (define-key map "}" #'olivetti-expand)
     (define-key map "{" #'olivetti-shrink) map)))

(defun olivetti-shrink (&optional arg)
  "Incrementally decrease the value of `olivetti-body-width'.

If prefixed with ARG, incrementally increase."
  (interactive "P")
  (let ((p (unless arg t)))
    (olivetti-expand p)))


;;; Mode Definition

(defvar olivetti-mode-map
  (let ((map (make-sparse-keymap)))
    (define-key map (kbd "C-c }") #'olivetti-expand)
    (define-key map (kbd "C-c {") #'olivetti-shrink)
    (define-key map (kbd "C-c \\") #'olivetti-set-width)
    map)
  "Mode map for `olivetti-mode'.")

(define-obsolete-function-alias 'turn-on-olivetti-mode
  #'olivetti-mode "1.7.0")

;;;###autoload
(define-minor-mode olivetti-mode
  "Olivetti provides a nice writing environment.

Window margins are set to relative widths to accomodate a text
body width set with `olivetti-body-width'."
  :init-value nil
  :lighter olivetti-lighter
  (if olivetti-mode
      (progn
        (cond ((<= emacs-major-version 24)
               (add-hook 'window-configuration-change-hook
                         #'olivetti-set-all-margins t t))
              ((<= emacs-major-version 26)
               (add-hook 'window-configuration-change-hook
                         #'olivetti-set-all-margins t t)
               (add-hook 'window-size-change-functions
                         #'olivetti-set-margins t t))
              ((<= 27 emacs-major-version)
               (add-hook 'window-size-change-functions
                         #'olivetti-set-margins t t)))
        (add-hook 'change-major-mode-hook
                  #'olivetti-reset-all-windows nil t)
        (setq-local split-window-preferred-function
                    #'olivetti-split-window-sensibly)
        (setq olivetti--visual-line-mode visual-line-mode)
        (unless olivetti--visual-line-mode (visual-line-mode 1))
        (olivetti-set-all-margins))
    (remove-hook 'window-configuration-change-hook
                 #'olivetti-set-all-margins t)
    (remove-hook 'window-size-change-functions
                 #'olivetti-set-margins t)
    (olivetti-reset-all-windows)
    (when (and olivetti-recall-visual-line-mode-entry-state
               (not olivetti--visual-line-mode))
      (visual-line-mode 0))
    (kill-local-variable 'split-window-preferred-function)
    (kill-local-variable 'olivetti--visual-line-mode)))



(provide 'olivetti)

;;; olivetti.el ends here




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38757; Package emacs. (Fri, 27 Dec 2019 06:07:01 GMT) Full text and rfc822 format available.

Message #8 received at 38757 <at> debbugs.gnu.org (full text, mbox):

From: "Paul W. Rankin" <hello <at> paulwrankin.com>
To: 38757 <at> debbugs.gnu.org
Date: Fri, 27 Dec 2019 16:06:08 +1000
Hmm sorry I can no longer reproduce this with a new build...

GNU Emacs 27.0.60 (build 2, x86_64-apple-darwin17.7.0, NS appkit-1561.61
Version 10.13.6 (Build 17G10021)) of 2019-12-27




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 27 Dec 2019 07:58:01 GMT) Full text and rfc822 format available.

Notification sent to "Paul W. Rankin" <hello <at> paulwrankin.com>:
bug acknowledged by developer. (Fri, 27 Dec 2019 07:58:01 GMT) Full text and rfc822 format available.

Message #13 received at 38757-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Paul W. Rankin" <hello <at> paulwrankin.com>
Cc: 38757-done <at> debbugs.gnu.org
Subject: Re: bug#38757:
Date: Fri, 27 Dec 2019 09:57:32 +0200
> From: "Paul W. Rankin" <hello <at> paulwrankin.com>
> Date: Fri, 27 Dec 2019 16:06:08 +1000
> 
> Hmm sorry I can no longer reproduce this with a new build...

Neither can I reproduce it with the current emacs-27 branch.

So I'm closing this bug; feel free to reopen if you ever encounter
this again.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38757; Package emacs. (Fri, 27 Dec 2019 08:05:01 GMT) Full text and rfc822 format available.

Message #16 received at 38757 <at> debbugs.gnu.org (full text, mbox):

From: "Paul W. Rankin" <hello <at> paulwrankin.com>
To: 38757 <at> debbugs.gnu.org
Subject: Re:
Date: Fri, 27 Dec 2019 18:04:11 +1000
I have narrowed down the issue, which is not limited to olivetti, so the
above minor-mode code can be ignored.

Emacs will segfault if first launched as a daemon, then accessed with
emacsclient -nw and setting margins cause a string to visually wrap in a
window.

Revised steps to reproduce:

1. checkout emacs-27 branch and build
2. emacs --fg-daemon
3. emacsclient -nw
4. in *scratch*

    (let ((margin (/ (window-body-width) 4)))
      (visual-line-mode 1)
      (insert (make-string (window-body-width) ?x))
      (set-window-margins nil margin margin))

Expected resutls:

The window should have symetrical margins each half the window body
width. The window text should be a line of 'x' wrapped at the window
body edge.

Actual results:

    Fatal error 11: Segmentation fault
    zsh: abort      emacs --fg-daemon

Emacs version:

GNU Emacs 27.0.60 (build 1, x86_64-apple-darwin17.7.0, NS appkit-1561.61
Version 10.13.6 (Build 17G10021)) of 2019-12-27




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38757; Package emacs. (Fri, 27 Dec 2019 09:16:01 GMT) Full text and rfc822 format available.

Message #19 received at 38757 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Paul W. Rankin" <hello <at> paulwrankin.com>
Cc: 38757 <at> debbugs.gnu.org
Subject: Re: bug#38757:
Date: Fri, 27 Dec 2019 11:15:18 +0200
reopen 38757
thanks

> From: "Paul W. Rankin" <hello <at> paulwrankin.com>
> Date: Fri, 27 Dec 2019 18:04:11 +1000
> 
> 1. checkout emacs-27 branch and build
> 2. emacs --fg-daemon
> 3. emacsclient -nw
> 4. in *scratch*
> 
>     (let ((margin (/ (window-body-width) 4)))
>       (visual-line-mode 1)
>       (insert (make-string (window-body-width) ?x))
>       (set-window-margins nil margin margin))
> 
> Expected resutls:
> 
> The window should have symetrical margins each half the window body
> width. The window text should be a line of 'x' wrapped at the window
> body edge.
> 
> Actual results:
> 
>     Fatal error 11: Segmentation fault
>     zsh: abort      emacs --fg-daemon

Please show a backtrace from GDB when Emacs crashes.

Thanks.




Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 27 Dec 2019 09:16:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38757; Package emacs. (Fri, 27 Dec 2019 09:20:01 GMT) Full text and rfc822 format available.

Message #24 received at 38757 <at> debbugs.gnu.org (full text, mbox):

From: "Paul W. Rankin" <hello <at> paulwrankin.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 38757 <at> debbugs.gnu.org
Subject: Re: bug#38757:
Date: Fri, 27 Dec 2019 19:19:11 +1000
On Fri, Dec 27 2019, Eli Zaretskii wrote:
>
> Please show a backtrace from GDB when Emacs crashes.
>
> Thanks.

This might be a bit beyond my skillset (i.e. idk what GDB is...)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38757; Package emacs. (Fri, 27 Dec 2019 09:48:02 GMT) Full text and rfc822 format available.

Message #27 received at 38757 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: "Paul W. Rankin" <hello <at> paulwrankin.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 38757 <at> debbugs.gnu.org
Subject: Re: bug#38757:
Date: Fri, 27 Dec 2019 10:47:05 +0100
>> Please show a backtrace from GDB when Emacs crashes.
>>
>> Thanks.
>
> This might be a bit beyond my skillset (i.e. idk what GDB is...)

This thread is confusing.  Does Emacs crash or doesn't it, given

> Hmm sorry I can no longer reproduce this with a new build...

?

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38757; Package emacs. (Fri, 27 Dec 2019 09:57:01 GMT) Full text and rfc822 format available.

Message #30 received at 38757 <at> debbugs.gnu.org (full text, mbox):

From: "Paul W. Rankin" <hello <at> paulwrankin.com>
To: "martin rudalics" <rudalics <at> gmx.at>, "Eli Zaretskii" <eliz <at> gnu.org>
Cc: 38757 <at> debbugs.gnu.org
Subject: Re: bug#38757:
Date: Fri, 27 Dec 2019 19:56:13 +1000
On Fri, 27 Dec 2019, at 7:47 PM, martin rudalics wrote:
>  >> Please show a backtrace from GDB when Emacs crashes.
>  >>
>  >> Thanks.
>  >
>  > This might be a bit beyond my skillset (i.e. idk what GDB is...)
>
> This thread is confusing.  Does Emacs crash or doesn't it, given

It is but a journey... with twists and turns....

But yes Emacs crashes. See:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38757#16

The crash is limited to running emacs as a daemon then interfacing with
emacsclient -nw




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38757; Package emacs. (Fri, 27 Dec 2019 10:30:02 GMT) Full text and rfc822 format available.

Message #33 received at 38757 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Paul W. Rankin" <hello <at> paulwrankin.com>
Cc: 38757 <at> debbugs.gnu.org
Subject: Re: bug#38757: emacs-27; reliably crashes when wrapping visual lines
Date: Fri, 27 Dec 2019 12:29:24 +0200
> From: "Paul W. Rankin" <hello <at> paulwrankin.com>
> Date: Fri, 27 Dec 2019 18:04:11 +1000
> 
> Emacs will segfault if first launched as a daemon, then accessed with
> emacsclient -nw and setting margins cause a string to visually wrap in a
> window.
> 
> Revised steps to reproduce:
> 
> 1. checkout emacs-27 branch and build
> 2. emacs --fg-daemon
> 3. emacsclient -nw
> 4. in *scratch*
> 
>     (let ((margin (/ (window-body-width) 4)))
>       (visual-line-mode 1)
>       (insert (make-string (window-body-width) ?x))
>       (set-window-margins nil margin margin))
> 
> Expected resutls:
> 
> The window should have symetrical margins each half the window body
> width. The window text should be a line of 'x' wrapped at the window
> body edge.
> 
> Actual results:
> 
>     Fatal error 11: Segmentation fault
>     zsh: abort      emacs --fg-daemon

Thanks.

I cannot reproduce this on GNU/Linux, I get the expected result.  So
it might be Darwin-specific, or maybe someone will be able to
reproduce on GNU/Linux and post a backtrace.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38757; Package emacs. (Fri, 27 Dec 2019 12:01:01 GMT) Full text and rfc822 format available.

Message #36 received at 38757 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: "Paul W. Rankin" <hello <at> paulwrankin.com>
Cc: martin rudalics <rudalics <at> gmx.at>, Eli Zaretskii <eliz <at> gnu.org>,
 38757 <at> debbugs.gnu.org
Subject: Re: bug#38757:
Date: Fri, 27 Dec 2019 12:00:11 +0000
"Paul W. Rankin" <hello <at> paulwrankin.com> writes:

> On Fri, 27 Dec 2019, at 7:47 PM, martin rudalics wrote:
>>  >> Please show a backtrace from GDB when Emacs crashes.
>>  >>
>>  >> Thanks.
>>  >
>>  > This might be a bit beyond my skillset (i.e. idk what GDB is...)
>>
>> This thread is confusing.  Does Emacs crash or doesn't it, given
>
> It is but a journey... with twists and turns....
>
> But yes Emacs crashes. See:
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38757#16
>
> The crash is limited to running emacs as a daemon then interfacing with
> emacsclient -nw

It looks to me like this is the same as bug#38564. Robert applied a fix
that sometimes works, but he has a proper fix worked out, he just needs
to finalise it and apply it.
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38757; Package emacs. (Fri, 27 Dec 2019 12:45:02 GMT) Full text and rfc822 format available.

Message #39 received at 38757 <at> debbugs.gnu.org (full text, mbox):

From: "Paul W. Rankin" <hello <at> paulwrankin.com>
To: Alan Third <alan <at> idiocy.org>
Cc: martin rudalics <rudalics <at> gmx.at>, Eli Zaretskii <eliz <at> gnu.org>,
 38757 <at> debbugs.gnu.org
Subject: Re: bug#38757:
Date: Fri, 27 Dec 2019 22:44:02 +1000
On Fri, Dec 27 2019, Eli Zaretskii wrote:
> I cannot reproduce this on GNU/Linux, I get the expected result.  So
> it might be Darwin-specific, or maybe someone will be able to
> reproduce on GNU/Linux and post a backtrace.

On Fri, Dec 27 2019, Alan Third wrote:
> It looks to me like this is the same as bug#38564. Robert applied a fix
> that sometimes works, but he has a proper fix worked out, he just needs
> to finalise it and apply it.

I can reproduce it (on OSX) only about two-thirds of the time.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38757; Package emacs. (Fri, 27 Dec 2019 14:02:02 GMT) Full text and rfc822 format available.

Message #42 received at 38757 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: hello <at> paulwrankin.com
Cc: 38757 <at> debbugs.gnu.org
Subject: Re: bug#38757: emacs-27; reliably crashes when wrapping visual lines
Date: Fri, 27 Dec 2019 16:01:00 +0200
> Date: Fri, 27 Dec 2019 12:29:24 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 38757 <at> debbugs.gnu.org
> 
> > 1. checkout emacs-27 branch and build
> > 2. emacs --fg-daemon
> > 3. emacsclient -nw
> > 4. in *scratch*
> > 
> >     (let ((margin (/ (window-body-width) 4)))
> >       (visual-line-mode 1)
> >       (insert (make-string (window-body-width) ?x))
> >       (set-window-margins nil margin margin))
> > 
> > Expected resutls:
> > 
> > The window should have symetrical margins each half the window body
> > width. The window text should be a line of 'x' wrapped at the window
> > body edge.
> > 
> > Actual results:
> > 
> >     Fatal error 11: Segmentation fault
> >     zsh: abort      emacs --fg-daemon
> 
> Thanks.
> 
> I cannot reproduce this on GNU/Linux, I get the expected result.  So
> it might be Darwin-specific, or maybe someone will be able to
> reproduce on GNU/Linux and post a backtrace.

And one more question: does this happen if you invoke Emacs with -Q?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38757; Package emacs. (Sat, 28 Dec 2019 01:01:02 GMT) Full text and rfc822 format available.

Message #45 received at 38757 <at> debbugs.gnu.org (full text, mbox):

From: "Paul W. Rankin" <hello <at> paulwrankin.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 38757 <at> debbugs.gnu.org
Subject: Re: bug#38757: emacs-27; reliably crashes when wrapping visual lines
Date: Sat, 28 Dec 2019 11:00:42 +1000
On Sat, Dec 28 2019, Eli Zaretskii wrote:
>
> And one more question: does this happen if you invoke Emacs with -Q?

Yes. Sorry -Q should be in the steps.

Also, I get the same results with either --fg/bg-daemon.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38757; Package emacs. (Sun, 29 Dec 2019 21:11:02 GMT) Full text and rfc822 format available.

Message #48 received at 38757 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: "Paul W. Rankin" <hello <at> paulwrankin.com>
Cc: Alan Third <alan <at> idiocy.org>, 38757 <at> debbugs.gnu.org
Subject: Re: bug#38757:
Date: Sun, 29 Dec 2019 22:10:13 +0100
>>>>> On Fri, 27 Dec 2019 22:44:02 +1000, "Paul W. Rankin" <hello <at> paulwrankin.com> said:

    Paul> On Fri, Dec 27 2019, Eli Zaretskii wrote:
    >> I cannot reproduce this on GNU/Linux, I get the expected result.  So
    >> it might be Darwin-specific, or maybe someone will be able to
    >> reproduce on GNU/Linux and post a backtrace.

    Paul> On Fri, Dec 27 2019, Alan Third wrote:
    >> It looks to me like this is the same as bug#38564. Robert applied a fix
    >> that sometimes works, but he has a proper fix worked out, he just needs
    >> to finalise it and apply it.

Iʼve just pushed it to emacs-27. Sorry for the delay.

    Paul> I can reproduce it (on OSX) only about two-thirds of the time.

38564 has a reproduction involving git-gutter which triggers 100% of
the time for me.

Robert




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38757; Package emacs. (Mon, 30 Dec 2019 01:01:01 GMT) Full text and rfc822 format available.

Message #51 received at 38757 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: "Paul W. Rankin" <hello <at> paulwrankin.com>, 38757 <at> debbugs.gnu.org
Subject: Re: bug#38757:
Date: Mon, 30 Dec 2019 01:00:37 +0000
On Sun, Dec 29, 2019 at 10:10:13PM +0100, Robert Pluim wrote:
> >>>>> On Fri, 27 Dec 2019 22:44:02 +1000, "Paul W. Rankin" <hello <at> paulwrankin.com> said:
> 
>     Paul> On Fri, Dec 27 2019, Eli Zaretskii wrote:
>     >> I cannot reproduce this on GNU/Linux, I get the expected result.  So
>     >> it might be Darwin-specific, or maybe someone will be able to
>     >> reproduce on GNU/Linux and post a backtrace.
> 
>     Paul> On Fri, Dec 27 2019, Alan Third wrote:
>     >> It looks to me like this is the same as bug#38564. Robert applied a fix
>     >> that sometimes works, but he has a proper fix worked out, he just needs
>     >> to finalise it and apply it.
> 
> Iʼve just pushed it to emacs-27. Sorry for the delay.

I’ve given it a go and I couldn’t reproduce the crash, so I think
we’re good.

Thanks for fixing this.
-- 
Alan Third




Added tag(s) fixed. Request was from Alan Third <alan <at> idiocy.org> to control <at> debbugs.gnu.org. (Mon, 30 Dec 2019 01:02:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 38757 <at> debbugs.gnu.org and "Paul W. Rankin" <hello <at> paulwrankin.com> Request was from Alan Third <alan <at> idiocy.org> to control <at> debbugs.gnu.org. (Mon, 30 Dec 2019 01:02:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38757; Package emacs. (Mon, 30 Dec 2019 03:23:02 GMT) Full text and rfc822 format available.

Message #58 received at 38757 <at> debbugs.gnu.org (full text, mbox):

From: "Paul W. Rankin" <hello <at> paulwrankin.com>
To: Alan Third <alan <at> idiocy.org>
Cc: Robert Pluim <rpluim <at> gmail.com>, 38757 <at> debbugs.gnu.org
Subject: Re: bug#38757:
Date: Mon, 30 Dec 2019 13:21:51 +1000
On Mon, Dec 30 2019, Alan Third wrote:
> On Sun, Dec 29, 2019 at 10:10:13PM +0100, Robert Pluim wrote:
>> Iʼve just pushed it to emacs-27. Sorry for the delay.
>
> I’ve given it a go and I couldn’t reproduce the crash, so I think
> we’re good.

Looks fixed to me! Thanks everyone :)




Merged 38564 38757. Request was from Robert Pluim <rpluim <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 06 Jan 2020 15:13:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 04 Feb 2020 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 81 days ago.

Previous Next


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