-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Attempt to shape unibyte text" crash error #10
Comments
NixOS 20.09.git.c59ea8b8a0e (Nightingale)
PragmataPro Liga Regular, version 0.828 Ligature config: (use-package ligature
:config
(ligature-set-ligatures t '("[ERROR]" "[DEBUG]" "[INFO]" "[WARN]" "[WARNING]"
"[ERR]" "[FATAL]" "[TRACE]" "[FIXME]" "[TODO]"
"[BUG]" "[NOTE]" "[HACK]" "[MARK]"
"# ERROR" "# DEBUG" "# INFO" "# WARN" "# WARNING"
"# ERR" "# FATAL" "# TRACE" "# FIXME" "# TODO"
"# BUG" "# NOTE" "# HACK" "# MARK"
"// ERROR" "// DEBUG" "// INFO" "// WARN" "// WARNING"
"// ERR" "// FATAL" "// TRACE" "// FIXME" "// TODO"
"// BUG" "// NOTE" "// HACK" "// MARK"
"!!" "!=" "!==" "!!!" "!≡" "!≡≡" "!>" "!=<" "#("
"#_" "#{" "#?" "#>" "##" "#_(" "%=" "%>" "%>%" "%<%"
"&%" "&&" "&*" "&+" "&-" "&/" "&=" "&&&" "&>" "$>"
"***" "*=" "*/" "*>" "++" "+++" "+=" "+>" "++=" "--"
"-<" "-<<" "-=" "->" "->>" "---" "-->" "-+-" "-\\/"
"-|>" "-<|" ".." "..." "..<" ".>" ".~" ".=" "/*" "//"
"/>" "/=" "/==" "///" "/**" ":::" "::" ":=" ":≡" ":>"
":=>" ":(" ":-(" ":)" ":-)" ":/" ":\\" ":3" ":D" ":P"
":>:" ":<:" "<$>" "<*" "<*>" "<+>" "<-" "<<" "<<<" "<<="
"<=" "<=>" "<>" "<|>" "<<-" "<|" "<=<" "<~" "<~~" "<<~"
"<$" "<+" "<!>" "<@>" "<#>" "<%>" "<^>" "<&>" "<?>" "<.>"
"</>" "<\\>" "<\">" "<:>" "<~>" "<**>" "<<^" "<!" "<@"
"<#" "<%" "<^" "<&" "<?" "<." "</" "<\\" "<\"" "<:" "<->"
"<!--" "<--" "<~<" "<==>" "<|-" "<<|" "<-<" "<-->" "<<=="
"<==" "=<<" "==" "===" "==>" "=>" "=~" "=>>" "=/=" "=~="
"==>>" "≡≡" "≡≡≡" "≡:≡" ">-" ">=" ">>" ">>-" ">>=" ">>>"
">=>" ">>^" ">>|" ">!=" ">->" "??" "?~" "?=" "?>" "???"
"?." "^=" "^." "^?" "^.." "^<<" "^>>" "^>" "\\\\" "\\>"
"\\/-" "@>" "|=" "||" "|>" "|||" "|+|" "|->" "|-->" "|=>"
"|==>" "|>-" "|<<" "||>" "|>>" "|-" "||-" "~=" "~>" "~~>"
"~>>" "[[" "]]" "\">" "_|_"))
(global-ligature-mode t)) Worth noting: If I remove
GUI
No, not unless I enable ligature.el features. |
The font is (use-package ligature
:straight (:host github :repo "mickeynp/ligature.el")
:config
(ligature-set-ligatures 'prog-mode
'("-->" "//" "/**" "/*" "*/" "<!--" ":=" "->>" "<<-" "->" "<-"
"<=>" "==" "!=" "<=" ">=" "=:=" "!==" "&&" "||" "..." ".."
"|||" "///" "&&&" "===" "++" "--" "=>" "|>" "<|" "||>" "<||"
"|||>" "<|||" ">>" "<<" "::=" "|]" "[|" "{|" "|}"
"[<" ">]" ":?>" ":?" "/=" "[||]" "!!" "?:" "?." "::"
"+++" "??" "###" "##" ":::" "####" ".?" "?=" "=!=" "<|>"
"<:" ":<" ":>" ">:" "<>" "***" ";;" "/==" ".=" ".-" "__"
"=/=" "<-<" "<<<" ">>>" "<=<" "<<=" "<==" "<==>" "==>" "=>>"
">=>" ">>=" ">>-" ">-" "<~>" "-<" "-<<" "=<<" "---" "<-|"
"<=|" "/\\" "\\/" "|=>" "|~>" "<~~" "<~" "~~" "~~>" "~>"
"<$>" "<$" "$>" "<+>" "<+" "+>" "<*>" "<*" "*>" "</>" "</" "/>"
"<->" "..<" "~=" "~-" "-~" "~@" "^=" "-|" "_|_" "|-" "||-"
"|=" "||=" "#{" "#[" "]#" "#(" "#?" "#_" "#_(" "#:" "#!" "#="
"&="))
(global-ligature-mode t))
GUI
Does not unless |
Interesting: it also happens if the ligature list is completely empty :P Related http://emacs.1067599.n8.nabble.com/bug-42522-Emacs-27-100-CPU-when-setting-mode-name-with-ligatures-td515786.html#a517123
This commit seems to be related to the modeline. |
I can confirm that the commit fixes the issue for me. let
myEmacs = (pkgs.emacs.override {
# Use gtk3 instead of the default gtk2
withGTK3 = true;
withGTK2 = false;
}).overrideAttrs (old: {
patches = (old.patches or []) ++ [
(pkgs.fetchpatch {
url = "https://github.com/emacs-mirror/emacs/commit/fe903c5ab7354b97f80ecf1b01ca3ff1027be446.patch";
sha256 = "0srcgqdc9bhk992vr6yl4vq528fr5414wyz2wf0fxcpw3hz7mhq8";
})
];
});
in ... |
Here's something that can be reproduced from (load "~/.emacs.d/straight/build/ligature/ligature.elc")
(require 'ligature)
(ligature-set-ligatures 't '("=>"))
(ligature-mode t)
(let ((ov (make-overlay 0 1)))
(overlay-put ov 'after-string "=>")) Creating the overlay doesn't crash Emacs. Instead it freezes while chugging 100% of a CPU core. eros.el creates overlays starting with a
Linux Manjaro
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP
The freeze happens with both Fantasque Sans Mono and Source Code Pro.
GUI |
Thank you for your bug reports. It seems this issue's most likely fixed for good in upstream Emacs. |
Once I disabled/removed |
So this is strange. I was experiencing a similar issue where my Emacs was freezing (like in the linked reddit posts). I have HARFBUZZ and CAIRO and Cairo is at 1.16 and I'm using the latest emacs-27 branch on Ubuntu 20.04 with Cascadia Code. I manually bisected the list of ligatures I copied from the readme, and |
@andschwa, I suspect the issue is almost certainly due to a bug in Emacs 27.1. It's fixed in Emacs master (and definitely in the gccemacs branch also) so can you try it again in that one? |
I cherry-picked fe903c5ab7354b97f80ecf1b01ca3ff1027be446 on top of emacs-27 branch and that resolved my issue. However, commit 6f955a4 introduced an issue with the example configuration, as |
Hi Andy. Ah interesting. Seems like a bug - probably due to the role of backslash as an escape mechanism in the reader. Thanks for reporting. |
Arch Linux x86_64 (Kernel: 5.10.4-arch2-1)
27.1
1.17.3
"XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP"
Fira Code Retina
GUI
No From logs buffer:
|
I spent ~1d troubleshooting why my Emacs was crashing 🤦♂️ (what made things was that I'm using EXWM, so my entire X session crashed). For my own education (and likely that of others) can you share some of the debugging steps you took when troubleshooting this? In the end I used a combination of |
One other question: any tips for unfreezing Emacs when this happens? I tried pkill -SIGINT emacs
pkill -USR2 emacs
emacsclient --eval '(keyboard-quit)' # also C-g but these shell commands would hang In the end, I used the nuclear option: pkill -9 emacs Is there a better way to interrupt Emacs here and maintain (some of) the application state? If so, that would be a game-changer for my workflow. |
Wow, I've never found a hang that hasn't fallen to SIGUSR2. My condolences! |
This issue only occurs on Emacs versions 27.1 and 27.2
Resolution
The quickest fix is to use the
master
branch of Emacs 27 and compile it yourself (something you are most likely doing anyway due to the slow adoption of new Emacs versions in most distros.)If you haven't you should try out the native compilation branch also if you haven't.
Details
If you experience this issue on Emacsen newer than Emacs 27.2 when you generate ligatures, then please comment below but include the following:
M-x emacs-version
;C-h v cairo-version-string
;C-h v system-configuration-features
;emacs -q
or not.It's likely a combination of harfbuzz; cairo (or lack thereof); your OS; your font; and the ligatures. Discovering common trends would be useful.
The text was updated successfully, but these errors were encountered: