unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Thibault Polge <thibault@thb.lt>
Cc: 39662@debbugs.gnu.org, Dmitry Gutov <dgutov@yandex.ru>
Subject: bug#39662: 28.0.50; Emacs crashes in x_cr_define_fringe_bitmap if (fringe-mode 0)
Date: Tue, 18 Feb 2020 16:45:20 +0100	[thread overview]
Message-ID: <m2d0abj3vz.fsf@gmail.com> (raw)
In-Reply-To: <87h7zoorys.fsf@thb.lt> (Thibault Polge's message of "Tue, 18 Feb 2020 16:06:19 +0100")

>>>>> On Tue, 18 Feb 2020 16:06:19 +0100, Thibault Polge <thibault@thb.lt> said:

    Thibault> Emacs built from commit b519d515bac8bd8c1265fe3965a51be249581817, on
    Thibault> GNU/Linux, with the Lucid or GTK3 toolkits (haven't tried anything
    Thibault> else), will crash eval'ing this snippet:

    Thibault> (progn
    Thibault>   (package-initialize)
    Thibault>   (package-install 'diff-hl)
    Thibault>   (fringe-mode 0)
    Thibault>   (dired "~")
    Thibault>   (diff-hl-dired-mode 1))

Yes, if fringe-mode is disabled the width calculated by diff-hl for
the bitmap is zero, which x_cr_define_fringe_bitmap doesnʼt like.

Does this bandaid fix it for you? It will still crash if you later
re-enable fringe-mode. Perhaps we should signal an error for this case
and have diff-hl deal with the fallout? (define-fringe-bitmap
docstring says the width has to be from 1-16).

diff --git a/src/xterm.c b/src/xterm.c
index 21d99f0c7b..7836a57fc6 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -552,6 +552,9 @@ x_end_cr_xlib_drawable (struct frame *f, GC gc)
 static void
 x_cr_define_fringe_bitmap (int which, unsigned short *bits, int h, int wd)
 {
+  if (h == 0 || wd == 0)
+    return;
+
   int i, stride;
   cairo_surface_t *surface;
   cairo_pattern_t *pattern;





  reply	other threads:[~2020-02-18 15:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18 15:06 bug#39662: 28.0.50; Emacs crashes in x_cr_define_fringe_bitmap if (fringe-mode 0) Thibault Polge
2020-02-18 15:45 ` Robert Pluim [this message]
2020-02-18 16:54   ` Thibault Polge
2020-02-18 19:32     ` Robert Pluim
2020-02-18 19:50       ` Eli Zaretskii
2020-02-18 20:03         ` Robert Pluim
2020-02-18 20:12           ` Eli Zaretskii
2020-02-18 20:29             ` Dmitry Gutov
2020-02-18 20:34               ` Robert Pluim
2020-02-18 21:32                 ` Dmitry Gutov
2020-02-19  3:27               ` Eli Zaretskii
2020-02-19  8:59                 ` Robert Pluim
2020-02-19 15:39                   ` Eli Zaretskii
2020-02-26  9:56                     ` Robert Pluim
2020-02-26 14:27                       ` Dmitry Gutov
2020-02-26 15:27                         ` Robert Pluim
2020-02-26 17:55                           ` Eli Zaretskii
2020-02-26 18:36                             ` Robert Pluim
2020-02-18 19:29   ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2d0abj3vz.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=39662@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=thibault@thb.lt \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).