0

When I try to run emacs 26.3.50 (built from source), it gives me the following warning: "Warning: desktop file appears to be in use by PID .... Using it may cause conflicts. Use it anyway? (y or n)". If I select "y", after several seconds it quits and the following error is produced:

Fatal error 11: Segmentation fault
Backtrace:
./src/emacs-26.3.50.1[0x5072fe]
./src/emacs-26.3.50.1[0x4ece6a]
./src/emacs-26.3.50.1[0x50581e]
./src/emacs-26.3.50.1[0x505a38]
./src/emacs-26.3.50.1[0x505abc]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7f0e498eb890]
/usr/lib/x86_64-linux-gnu/libXft.so.2(XftCharIndex+0xd)[0x7f0e4a9bb68d]
./src/emacs-26.3.50.1[0x5c8b29]
./src/emacs-26.3.50.1[0x45ad79]
./src/emacs-26.3.50.1[0x433180]
./src/emacs-26.3.50.1[0x43df5d]
./src/emacs-26.3.50.1[0x446f4a]
./src/emacs-26.3.50.1[0x4507ce]
./src/emacs-26.3.50.1[0x42f428]
./src/emacs-26.3.50.1[0x4551da]
./src/emacs-26.3.50.1[0x4554ef]
./src/emacs-26.3.50.1[0x45565c]
./src/emacs-26.3.50.1[0x559b5d]
./src/emacs-26.3.50.1[0x562ee2]
./src/emacs-26.3.50.1[0x599c70]
./src/emacs-26.3.50.1[0x562e5d]
./src/emacs-26.3.50.1[0x599c70]
./src/emacs-26.3.50.1[0x562e5d]
./src/emacs-26.3.50.1[0x599c70]
./src/emacs-26.3.50.1[0x562e5d]
./src/emacs-26.3.50.1[0x599c70]
./src/emacs-26.3.50.1[0x565953]
./src/emacs-26.3.50.1[0x564eca]
./src/emacs-26.3.50.1[0x566dab]
./src/emacs-26.3.50.1[0x56204e]
./src/emacs-26.3.50.1[0x4ed290]
./src/emacs-26.3.50.1[0x561fbd]
./src/emacs-26.3.50.1[0x4ed1a8]
./src/emacs-26.3.50.1[0x4f1d73]
./src/emacs-26.3.50.1[0x4f2096]
./src/emacs-26.3.50.1[0x416129]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f0e48d4ab97]
./src/emacs-26.3.50.1[0x416d7a]

My .emacs is as follows:

(add-to-list 'custom-theme-load-path "/home/ricercar/src/replace-colorthemes")

(package-initialize)

(define-key special-event-map [config-changed-event] #'ignore)
(set-face-attribute 'default nil :height 90)
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(custom-enabled-themes '(blippblopp))
 '(custom-safe-themes
   '("780c67d3b58b524aa485a146ad9e837051918b722fd32fd1b7e50ec36d413e70" "6a674ffa24341f2f129793923d0b5f26d59a8891edd7d9330a258b58e767778a" "5c83b15581cb7274085ba9e486933062652091b389f4080e94e4e9661eaab1aa" default))
 '(fill-column 80)
 '(package-selected-packages
   '(sql-indent emacsql emacsql-mysql emacsql-psql emacsql-sqlite magit project-explorer helm company-box jinja2-mode web-mode auto-complete neotree projectile auctex tabbar-ruler mode-icons powerline tabbar))
 '(send-mail-function 'mailclient-send-it)
 '(tab-width 4)
 '(tabbar-mode t nil (tabbar)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
;; C STYLE AND TAB SETTINGS
(setq-default tab-width 4)
(setq-default c-default-style "stroustrup")
(defvaralias 'c-basic-offset 'tab-width)
(setq-default indent-tabs-mode t)

;; SCROLL SETTINGS
(setq scroll-step 1)
(setq mouse-wheel-progressive-speed nil)
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) ;; one line at a time

;; NEOTREE SETTINGS
(require 'neotree)
(global-set-key [f8] 'neotree-toggle)

;; TABBAR SETTINGS
(global-set-key [C-iso-lefttab] 'tabbar-backward-tab)
(global-set-key [C-tab] 'tabbar-forward-tab)

;; AUTO FILL SETTINGS
(setq-default fill-column 80)
(setq-default auto-fill-function 'do-auto-fill)

;; AUTO COMPLETE SETTINGS
(global-auto-complete-mode 1)       

;; PROJECTILE SETTINGS
(projectile-mode 1)
(define-key projectile-mode-map (kbd "s-p") 'projectile-command-map)
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
(setq projectile-project-search-path '("~/src"))
(global-auto-complete-mode 1)
(column-number-mode 1)

;; UNDO TREE
(add-to-list 'load-path "/home/ricercar/src/undo-tree")
(require 'undo-tree)
(global-undo-tree-mode)

;; COLUMN ENFORCE
(add-to-list 'load-path "/home/ricercar/src/column-enforce-mode")
(require 'column-enforce-mode)
(global-column-enforce-mode 1)

;; PROJECT EXPLORER
(global-set-key [f9] 'project-explorer-open)

;; HIDE SHOW
(add-hook 'prog-mode-hook (lambda() (hs-minor-mode)))

;; MISCELLANEOUS
(blink-cursor-mode 0)
(global-linum-mode 1)
(column-number-mode 1)
(global-visual-line-mode 1)
(desktop-save-mode 1)
(set-face-attribute 'default nil :height 90)

;; DISABLED COMMANDS
(put 'scroll-left 'disabled nil)
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)

;; MAGIT SETTINGS
(global-set-key (kbd "C-x g") 'magit-status)

If I remove the line (desktop-save-mode 1), or select "n" for the aforementioned prompt, emacs 26 runs just fine (except I can't save the session of course). Also, emacs 27 for some reason runs fine even with desktop-save-mode on. But I would prefer not to have to resort to using the latest development version on a daily basis.

Any idea how I might go about fixing this?

  • Please consider reporting the problem: M-x report-emacs-bug. Pretty much any crash indicates a basic Emacs bug somewhere. – Drew Dec 31 '19 at 17:16
1

When saving the desktop file, emacs used to also save which font-backend is being used by the various frames it has open. Emacs-26 on GNU/Linux by default uses the xft backend, whilst emacs-27 can use the ftcr (Cairo) backend, so that's what it saves in the desktop file. That wouldn't normally be a problem, except that until recently, emacs would crash if you tried to switch font backends for a frame, so when you go back to emacs-26 with a desktop file saved by emacs-27, it crashes.

The desktop package no longer saves or restores the font-backed in emacs-27, and the crashing bug has been fixed as well. See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23386 and https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38442

Easy fix if you don't want to upgrade: remove the (font-backend ftcr) and (font-backend ftcrhb) forms from your desktop file.

| improve this answer | |
0

I just had the same problem. If you delete the .emacs.desktop file the problem goes away. The file will be re-created when you exit Emacs. I've tried a few times to start and exit Emacs without further crashes. Could it be a problem with the .emacs.desktop file format (i.e. after an upgrade of the desktop package)?

| improve this answer | |
  • The crash is a problem in Emacs's C code (almost by definition of a "segmentation fault") rather than in the desktop package (although that problem might indeed be triggered by something in the desktop package). – Stefan Apr 20 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.