Subject: 27.0.50; Segmentation fault (xstrdup gdk_monitor_get_model)

From: Jhair Tocancipa Triana <[email-masked]>
Date: Sat, 13 Apr 2019 22:24:06 +0200

Emacs crashes randomly, sometimes when clicking links in eww. The crash
is not easily reproducible, nevertheless the core dump points to a
segfault at xfns.c:

a35e06bbe27 (Alexander Gramiak   2019-04-06 5033)       mi->name = xstrdup (gdk_monitor_get_model (monitor));

gkd_monitor_get_model is returning NULL in my case causing the segfault
at xstrdup.

The gkd_monitor_get_model documentation says the function may return
NULL.

https://developer.gnome.org/gdk3/stable/GdkMonitor.html#gdk-monitor-get-model

Maybe we need to guard against a NULL return value.

Please find attached the bt full gdb output.

In GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.4)
 of 2019-04-13 built on DE1-JT-Ubuntu
Repository revision: f9694a713824d402bcba01064ac2f95156bf4161
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12001000
System Description: Ubuntu 18.10

Recent messages:
Subscribe newsgroup: nnimap+gmail:[Gmail]/Important
nnimap read 0k from imap.gmail.com (initial sync of 1 group; please wait)
nnimap read 0k from imap.gmail.com
Making completion list... [2 times]
delete-backward-char: Text is read-only [2 times]
Making completion list...
delete-backward-char: Text is read-only
Saving file /home/jt/News/drafts/drafts/9...
Wrote /home/jt/News/drafts/drafts/9
Deleting article /home/jt/News/drafts/drafts/7 in drafts...

Configured using:
 'configure --with-xwidgets --with-imagemagick'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS GLIB NOTIFY
INOTIFY GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11
XDBE XIM THREADS XWIDGETS PDUMPER LCMS2 GMP

Important settings:
  value of $LC_ALL: en_US.UTF-8
  value of $LC_MONETARY: en_US.UTF-8
  value of $LC_NUMERIC: en_US.UTF-8
  value of $LC_TIME: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Group

Minor modes in effect:
  gnus-topic-mode: t
  gnus-undo-mode: t
  shell-dirtrack-mode: t
  show-paren-mode: t
  global-anzu-mode: t
  anzu-mode: t
  display-time-mode: t
  desktop-save-mode: t
  google-this-mode: t
  popwin-mode: t
  global-company-mode: t
  company-mode: t
  savehist-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/jt/.emacs.d/elpa/org-20171225/ob-lilypond hides /home/jt/local/src/emacs.git/lisp/org/ob-lilypond
/home/jt/.emacs.d/elpa/org-20171225/org-pcomplete hides /home/jt/local/src/emacs.git/lisp/org/org-pcomplete
/home/jt/.emacs.d/elpa/org-20171225/ob-sql hides /home/jt/local/src/emacs.git/lisp/org/ob-sql
/home/jt/.emacs.d/elpa/org-20171225/org-element hides /home/jt/local/src/emacs.git/lisp/org/org-element
/home/jt/.emacs.d/elpa/org-20171225/ob-fortran hides /home/jt/local/src/emacs.git/lisp/org/ob-fortran
/home/jt/.emacs.d/elpa/org-20171225/ox-publish hides /home/jt/local/src/emacs.git/lisp/org/ox-publish
/home/jt/.emacs.d/elpa/org-20171225/org-duration hides /home/jt/local/src/emacs.git/lisp/org/org-duration
/home/jt/.emacs.d/elpa/org-20171225/ob-scheme hides /home/jt/local/src/emacs.git/lisp/org/ob-scheme
/home/jt/.emacs.d/elpa/org-20171225/ob-picolisp hides /home/jt/local/src/emacs.git/lisp/org/ob-picolisp
/home/jt/.emacs.d/elpa/org-20171225/ox-html hides /home/jt/local/src/emacs.git/lisp/org/ox-html
/home/jt/.emacs.d/elpa/org-20171225/org-loaddefs hides /home/jt/local/src/emacs.git/lisp/org/org-loaddefs
/home/jt/.emacs.d/elpa/org-20171225/org-src hides /home/jt/local/src/emacs.git/lisp/org/org-src
/home/jt/.emacs.d/elpa/org-20171225/ob-table hides /home/jt/local/src/emacs.git/lisp/org/ob-table
/home/jt/.emacs.d/elpa/org-20171225/ox-org hides /home/jt/local/src/emacs.git/lisp/org/ox-org
/home/jt/.emacs.d/elpa/org-20171225/ox-ascii hides /home/jt/local/src/emacs.git/lisp/org/ox-ascii
/home/jt/.emacs.d/elpa/org-20171225/ob-ocaml hides /home/jt/local/src/emacs.git/lisp/org/ob-ocaml
/home/jt/.emacs.d/elpa/org-20171225/ox-odt hides /home/jt/local/src/emacs.git/lisp/org/ox-odt
/home/jt/.emacs.d/elpa/org-20171225/org-inlinetask hides /home/jt/local/src/emacs.git/lisp/org/org-inlinetask
/home/jt/.emacs.d/elpa/org-20171225/ob-screen hides /home/jt/local/src/emacs.git/lisp/org/ob-screen
/home/jt/.emacs.d/elpa/org-20171225/org-attach hides /home/jt/local/src/emacs.git/lisp/org/org-attach
/home/jt/.emacs.d/elpa/org-20171225/ob-calc hides /home/jt/local/src/emacs.git/lisp/org/ob-calc
/home/jt/.emacs.d/elpa/org-20171225/ob-ruby hides /home/jt/local/src/emacs.git/lisp/org/ob-ruby
/home/jt/.emacs.d/elpa/org-20171225/ob-shen hides /home/jt/local/src/emacs.git/lisp/org/ob-shen
/home/jt/.emacs.d/elpa/org-20171225/org-docview hides /home/jt/local/src/emacs.git/lisp/org/org-docview
/home/jt/.emacs.d/elpa/org-20171225/org-timer hides /home/jt/local/src/emacs.git/lisp/org/org-timer
/home/jt/.emacs.d/elpa/org-20171225/ob-org hides /home/jt/local/src/emacs.git/lisp/org/ob-org
/home/jt/.emacs.d/elpa/org-20171225/ox-latex hides /home/jt/local/src/emacs.git/lisp/org/ox-latex
/home/jt/.emacs.d/elpa/org-20171225/org-compat hides /home/jt/local/src/emacs.git/lisp/org/org-compat
/home/jt/.emacs.d/elpa/org-20171225/ob-forth hides /home/jt/local/src/emacs.git/lisp/org/ob-forth
/home/jt/.emacs.d/elpa/org-20171225/ob-keys hides /home/jt/local/src/emacs.git/lisp/org/ob-keys
/home/jt/.emacs.d/elpa/org-20171225/org-irc hides /home/jt/local/src/emacs.git/lisp/org/org-irc
/home/jt/.emacs.d/elpa/org-20171225/ob-mscgen hides /home/jt/local/src/emacs.git/lisp/org/ob-mscgen
/home/jt/.emacs.d/elpa/org-20171225/org-mhe hides /home/jt/local/src/emacs.git/lisp/org/org-mhe
/home/jt/.emacs.d/elpa/org-20171225/ob-ditaa hides /home/jt/local/src/emacs.git/lisp/org/ob-ditaa
/home/jt/.emacs.d/elpa/org-20171225/org-list hides /home/jt/local/src/emacs.git/lisp/org/org-list
/home/jt/.emacs.d/elpa/org-20171225/ob-dot hides /home/jt/local/src/emacs.git/lisp/org/ob-dot
/home/jt/.emacs.d/elpa/org-20171225/org-colview hides /home/jt/local/src/emacs.git/lisp/org/org-colview
/home/jt/.emacs.d/elpa/org-20171225/org-w3m hides /home/jt/local/src/emacs.git/lisp/org/org-w3m
/home/jt/.emacs.d/elpa/org-20171225/ox hides /home/jt/local/src/emacs.git/lisp/org/ox
/home/jt/.emacs.d/elpa/org-20171225/ob-J hides /home/jt/local/src/emacs.git/lisp/org/ob-J
/home/jt/.emacs.d/elpa/org-20171225/ob-processing hides /home/jt/local/src/emacs.git/lisp/org/ob-processing
/home/jt/.emacs.d/elpa/org-20171225/org-crypt hides /home/jt/local/src/emacs.git/lisp/org/org-crypt
/home/jt/.emacs.d/elpa/org-20171225/org-info hides /home/jt/local/src/emacs.git/lisp/org/org-info
/home/jt/.emacs.d/elpa/org-20171225/ob-js hides /home/jt/local/src/emacs.git/lisp/org/ob-js
/home/jt/.emacs.d/elpa/org-20171225/org-eww hides /home/jt/local/src/emacs.git/lisp/org/org-eww
/home/jt/.emacs.d/elpa/org-20171225/org-footnote hides /home/jt/local/src/emacs.git/lisp/org/org-footnote
/home/jt/.emacs.d/elpa/org-20171225/ob-R hides /home/jt/local/src/emacs.git/lisp/org/ob-R
/home/jt/.emacs.d/elpa/org-20171225/ob-octave hides /home/jt/local/src/emacs.git/lisp/org/ob-octave
/home/jt/.emacs.d/elpa/org-20171225/ob-gnuplot hides /home/jt/local/src/emacs.git/lisp/org/ob-gnuplot
/home/jt/.emacs.d/elpa/org-20171225/ob-groovy hides /home/jt/local/src/emacs.git/lisp/org/ob-groovy
/home/jt/.emacs.d/elpa/org-20171225/org-capture hides /home/jt/local/src/emacs.git/lisp/org/org-capture
/home/jt/.emacs.d/elpa/org-20171225/ob-lob hides /home/jt/local/src/emacs.git/lisp/org/ob-lob
/home/jt/.emacs.d/elpa/org-20171225/org-habit hides /home/jt/local/src/emacs.git/lisp/org/org-habit
/home/jt/.emacs.d/elpa/org-20171225/ob-abc hides /home/jt/local/src/emacs.git/lisp/org/ob-abc
/home/jt/.emacs.d/elpa/org-20171225/ob-maxima hides /home/jt/local/src/emacs.git/lisp/org/ob-maxima
/home/jt/.emacs.d/elpa/org-20171225/ob-plantuml hides /home/jt/local/src/emacs.git/lisp/org/ob-plantuml
/home/jt/.emacs.d/elpa/org-20171225/ob-perl hides /home/jt/local/src/emacs.git/lisp/org/ob-perl
/home/jt/.emacs.d/elpa/org-20171225/org-rmail hides /home/jt/local/src/emacs.git/lisp/org/org-rmail
/home/jt/.emacs.d/elpa/org-20171225/org hides /home/jt/local/src/emacs.git/lisp/org/org
/home/jt/.emacs.d/elpa/org-20171225/ob-exp hides /home/jt/local/src/emacs.git/lisp/org/ob-exp
/home/jt/.emacs.d/elpa/org-20171225/ob-shell hides /home/jt/local/src/emacs.git/lisp/org/ob-shell
/home/jt/.emacs.d/elpa/org-20171225/ob hides /home/jt/local/src/emacs.git/lisp/org/ob
/home/jt/.emacs.d/elpa/org-20171225/ob-sqlite hides /home/jt/local/src/emacs.git/lisp/org/ob-sqlite
/home/jt/.emacs.d/elpa/org-20171225/ob-makefile hides /home/jt/local/src/emacs.git/lisp/org/ob-makefile
/home/jt/.emacs.d/elpa/org-20171225/ob-python hides /home/jt/local/src/emacs.git/lisp/org/ob-python
/home/jt/.emacs.d/elpa/org-20171225/ob-java hides /home/jt/local/src/emacs.git/lisp/org/ob-java
/home/jt/.emacs.d/elpa/org-20171225/org-bibtex hides /home/jt/local/src/emacs.git/lisp/org/org-bibtex
/home/jt/.emacs.d/elpa/org-20171225/ob-clojure hides /home/jt/local/src/emacs.git/lisp/org/ob-clojure
/home/jt/.emacs.d/elpa/org-20171225/ox-man hides /home/jt/local/src/emacs.git/lisp/org/ox-man
/home/jt/.emacs.d/elpa/org-20171225/org-ctags hides /home/jt/local/src/emacs.git/lisp/org/org-ctags
/home/jt/.emacs.d/elpa/org-20171225/ox-texinfo hides /home/jt/local/src/emacs.git/lisp/org/ox-texinfo
/home/jt/.emacs.d/elpa/org-20171225/ob-sed hides /home/jt/local/src/emacs.git/lisp/org/ob-sed
/home/jt/.emacs.d/elpa/org-20171225/ob-asymptote hides /home/jt/local/src/emacs.git/lisp/org/ob-asymptote
/home/jt/.emacs.d/elpa/org-20171225/ob-vala hides /home/jt/local/src/emacs.git/lisp/org/ob-vala
/home/jt/.emacs.d/elpa/org-20171225/org-id hides /home/jt/local/src/emacs.git/lisp/org/org-id
/home/jt/.emacs.d/elpa/org-20171225/ob-awk hides /home/jt/local/src/emacs.git/lisp/org/ob-awk
/home/jt/.emacs.d/elpa/org-20171225/org-eshell hides /home/jt/local/src/emacs.git/lisp/org/org-eshell
/home/jt/.emacs.d/elpa/org-20171225/ob-haskell hides /home/jt/local/src/emacs.git/lisp/org/ob-haskell
/home/jt/.emacs.d/elpa/org-20171225/ob-sass hides /home/jt/local/src/emacs.git/lisp/org/ob-sass
/home/jt/.emacs.d/elpa/org-20171225/ob-ledger hides /home/jt/local/src/emacs.git/lisp/org/ob-ledger
/home/jt/.emacs.d/elpa/org-20171225/org-macs hides /home/jt/local/src/emacs.git/lisp/org/org-macs
/home/jt/.emacs.d/elpa/org-20171225/ox-md hides /home/jt/local/src/emacs.git/lisp/org/ox-md
/home/jt/.emacs.d/elpa/org-20171225/ox-beamer hides /home/jt/local/src/emacs.git/lisp/org/ox-beamer
/home/jt/.emacs.d/elpa/org-20171225/org-gnus hides /home/jt/local/src/emacs.git/lisp/org/org-gnus
/home/jt/.emacs.d/elpa/org-20171225/org-faces hides /home/jt/local/src/emacs.git/lisp/org/org-faces
/home/jt/.emacs.d/elpa/org-20171225/org-entities hides /home/jt/local/src/emacs.git/lisp/org/org-entities
/home/jt/.emacs.d/elpa/org-20171225/ob-latex hides /home/jt/local/src/emacs.git/lisp/org/ob-latex
/home/jt/.emacs.d/elpa/org-20171225/org-datetree hides /home/jt/local/src/emacs.git/lisp/org/org-datetree
/home/jt/.emacs.d/elpa/org-20171225/org-indent hides /home/jt/local/src/emacs.git/lisp/org/org-indent
/home/jt/.emacs.d/elpa/org-20171225/org-table hides /home/jt/local/src/emacs.git/lisp/org/org-table
/home/jt/.emacs.d/elpa/org-20171225/ob-matlab hides /home/jt/local/src/emacs.git/lisp/org/ob-matlab
/home/jt/.emacs.d/elpa/org-20171225/org-bbdb hides /home/jt/local/src/emacs.git/lisp/org/org-bbdb
/home/jt/.emacs.d/elpa/org-20171225/ob-emacs-lisp hides /home/jt/local/src/emacs.git/lisp/org/ob-emacs-lisp
/home/jt/.emacs.d/elpa/org-20171225/org-feed hides /home/jt/local/src/emacs.git/lisp/org/org-feed
/home/jt/.emacs.d/elpa/org-20171225/ob-comint hides /home/jt/local/src/emacs.git/lisp/org/ob-comint
/home/jt/.emacs.d/elpa/org-20171225/org-plot hides /home/jt/local/src/emacs.git/lisp/org/org-plot
/home/jt/.emacs.d/elpa/org-20171225/ob-stan hides /home/jt/local/src/emacs.git/lisp/org/ob-stan
/home/jt/.emacs.d/elpa/org-20171225/org-agenda hides /home/jt/local/src/emacs.git/lisp/org/org-agenda
/home/jt/.emacs.d/elpa/org-20171225/org-version hides /home/jt/local/src/emacs.git/lisp/org/org-version
/home/jt/.emacs.d/elpa/org-20171225/ob-eval hides /home/jt/local/src/emacs.git/lisp/org/ob-eval
/home/jt/.emacs.d/elpa/org-20171225/ob-css hides /home/jt/local/src/emacs.git/lisp/org/ob-css
/home/jt/.emacs.d/elpa/org-20171225/org-archive hides /home/jt/local/src/emacs.git/lisp/org/org-archive
/home/jt/.emacs.d/elpa/org-20171225/org-mouse hides /home/jt/local/src/emacs.git/lisp/org/org-mouse
/home/jt/.emacs.d/elpa/org-20171225/ob-lisp hides /home/jt/local/src/emacs.git/lisp/org/ob-lisp
/home/jt/.emacs.d/elpa/org-20171225/ob-ebnf hides /home/jt/local/src/emacs.git/lisp/org/ob-ebnf
/home/jt/.emacs.d/elpa/org-20171225/org-protocol hides /home/jt/local/src/emacs.git/lisp/org/org-protocol
/home/jt/.emacs.d/elpa/org-20171225/org-clock hides /home/jt/local/src/emacs.git/lisp/org/org-clock
/home/jt/.emacs.d/elpa/org-20171225/org-macro hides /home/jt/local/src/emacs.git/lisp/org/org-macro
/home/jt/.emacs.d/elpa/org-20171225/ob-coq hides /home/jt/local/src/emacs.git/lisp/org/ob-coq
/home/jt/.emacs.d/elpa/org-20171225/ox-icalendar hides /home/jt/local/src/emacs.git/lisp/org/ox-icalendar
/home/jt/.emacs.d/elpa/org-20171225/org-mobile hides /home/jt/local/src/emacs.git/lisp/org/org-mobile
/home/jt/.emacs.d/elpa/org-20171225/ob-C hides /home/jt/local/src/emacs.git/lisp/org/ob-C
/home/jt/.emacs.d/elpa/org-20171225/org-install hides /home/jt/local/src/emacs.git/lisp/org/org-install
/home/jt/.emacs.d/elpa/org-20171225/ob-io hides /home/jt/local/src/emacs.git/lisp/org/ob-io
/home/jt/.emacs.d/elpa/org-20171225/ob-core hides /home/jt/local/src/emacs.git/lisp/org/ob-core
/home/jt/.emacs.d/elpa/org-20171225/ob-lua hides /home/jt/local/src/emacs.git/lisp/org/ob-lua
/home/jt/.emacs.d/elpa/org-20171225/ob-hledger hides /home/jt/local/src/emacs.git/lisp/org/ob-hledger
/home/jt/.emacs.d/elpa/org-20171225/ob-ref hides /home/jt/local/src/emacs.git/lisp/org/ob-ref
/home/jt/.emacs.d/elpa/org-20171225/ob-tangle hides /home/jt/local/src/emacs.git/lisp/org/ob-tangle
/home/jt/.emacs.d/elpa/org-20171225/org-lint hides /home/jt/local/src/emacs.git/lisp/org/org-lint

Features:
(shadow emacsbug gnus-picon sort shr-color color shr svg xml dom
mm-archive gnus-async qp nnfolder utf-7 add-log log-view pcvs-util vc
vc-dispatcher vc-git diff-mode gnus-bcklg gnus-cite mail-extr flyspell
ispell nnir gnus-draft gnus-ml disp-table gnus-topic misearch
multi-isearch ibuf-ext ibuffer ibuffer-loaddefs nndraft nnmh nnmaildir
nnml bbdb-gnus bbdb-mua bbdb-com crm gnutls network-stream nsm
gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art
mm-uu mml2015 mm-view mml-smime smime dig gnus-cache gnus-sum footnote
smtpmail gnus-demon nntp gnus-group gnus-undo bbdb-message sendmail bbdb
bbdb-site timezone gnus-start gnus-cloud nnimap nnmail mail-source utf7
netrc nnoo gnus-spec gnus-int gnus-range message rmc puny rfc822 mml
mml-sec epa epg mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader gnus-win gnus nnheader gnus-util rmail
rmail-loaddefs rfc2047 rfc2045 ietf-drums text-property-search time-date
mail-utils mm-util mail-prsvr wid-edit tramp tramp-loaddefs trampver
tramp-integration files-x tramp-compat ucs-normalize shell pcomplete
parse-time format-spec paren anzu advice time desktop frameset cus-start
cus-load google-this easy-mmode popwin cl-extra yasnippet elec-pair
help-mode flymake-proc flymake warnings thingatpt pylookup ido cl
browse-url python-pep8 derived compile comint ansi-color dired-x dired
dired-loaddefs ls-lisp dpaste url url-proxy url-privacy url-expand
url-methods url-history url-cookie url-domsuf url-util mailcap server
company-oddmuse company-keywords company-etags etags fileloop generator
xref project ring company-gtags company-dabbrev-code company-dabbrev
company-files company-capf company-cmake company-xcode company-clang
company-semantic company-eclim company-template company-bbdb
company-emoji company-emoji-list company edmacro kmacro pcase
exec-path-from-shell savehist finder-inf mule-util tex-site rx info
package easymenu epg-config url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting xwidget-internal move-toolbar
gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 1834577 160000)
 (symbols 48 59886 108)
 (strings 32 689366 67654)
 (string-bytes 1 46468691)
 (vectors 16 242042)
 (vector-slots 8 4222102 368526)
 (floats 8 421 280)
 (intervals 56 5401 887)
 (buffers 992 41))

-- 
Key fingerprint = 5917 806E 3A2F 659B BE6A  8DEE 04B5 52D9 BC07 29A4