Skip to content
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

Crash when exit emacs #161

Open
pluswu opened this issue May 10, 2021 · 7 comments
Open

Crash when exit emacs #161

pluswu opened this issue May 10, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@pluswu
Copy link

pluswu commented May 10, 2021

问题描述
spaceemacs关闭SPC qq 退出时如果有激活rime会必定crash(linux manjaro)同样的配置 我另外一台ubuntu20.04貌似就没问题...
简明的问题描述堆栈如下
acktrace:
emacs(+0x148065)[0x558151b9b065]
emacs(+0x4089c)[0x558151a9389c]
emacs(+0x40dc3)[0x558151a93dc3]
emacs(+0x14604e)[0x558151b9904e]
emacs(+0x1460ca)[0x558151b990ca]
/usr/lib/libpthread.so.0(+0x13960)[0x7f6d5a99a960]
/usr/lib/librime.so.1(_ZN4rime4PoetD2Ev+0x28)[0x7f6d437381e8]
/usr/lib/librime.so.1(_ZN4rime16ScriptTranslatorD0Ev+0x35)[0x7f6d43751ff5]
/usr/lib/librime.so.1(_ZNSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE10_M_releaseEv+0x3a)[0x7f6d4365033a]
/usr/lib/librime.so.1(_ZN4rime14ConcreteEngineD1Ev+0x17f)[0x7f6d4366b2ff]
/usr/lib/librime.so.1(_ZN4rime14ConcreteEngineD0Ev+0xa)[0x7f6d4366b3fa]
/usr/lib/librime.so.1(_ZN4rime7Service18CleanupAllSessionsEv+0x8a)[0x7f6d43682d8a]
/usr/lib/librime.so.1(_ZN4rime7ServiceD2Ev+0x13)[0x7f6d43682df3]
/usr/lib/librime.so.1(_ZNSt10unique_ptrIN4rime7ServiceESt14default_deleteIS1_EED2Ev+0x12)[0x7f6d43685a82]
/usr/lib/libc.so.6(+0x3f697)[0x7f6d5a621697]
/usr/lib/libc.so.6(+0x3f83e)[0x7f6d5a62183e]

Emacs中的配置

  (setq rime-user-data-dir "~/.emacs.d/private/emacs-config/rime")
  (setq default-input-method "rime")
  (setq rime-show-candidate 'popup)

复现方式(安装遇到问题时省略)

复现问题所需的操作

是否可在 emacs -Q 中复现

是/否

截图

展示错误的截图或动图

环境信息
Manjaro, 27.2 , librime-20210207.1432

  • 操作系统:如 ArchLinux
  • Emacs版本:如 27.0.90
  • Librime版本:如 1.5.3
  • Librime安装方式:包管理器/手工编译
  • 安装方式:Git/Melpa/Straight/Quelpa
@pluswu pluswu added the bug Something isn't working label May 10, 2021
@DogLooksGood DogLooksGood changed the title [BUG] Crash when exit May 11, 2021
@DogLooksGood DogLooksGood changed the title Crash when exit Crash when exit emacs May 11, 2021
@DogLooksGood
Copy link
Owner

DogLooksGood commented May 11, 2021

我也用 ArchLinux 和 Manjaro, 如果把 librime 换成 1:1.7.3-1 的版本呢?(当前仓库中的版本)

@pluswu
Copy link
Author

pluswu commented May 11, 2021 via email

@DogLooksGood
Copy link
Owner

如果能提供可以稳定重现的最小配置的话,应该会很有帮助。

@tarlaw
Copy link

tarlaw commented Jun 2, 2021

我也遇到这个问题,Arch Linux librime 1.7.3

用HOME变量新开emacs环境,什么都不用配置,直接在melpa里安装rime,然后用Ctrl-\切换到rime再退出就会报错

HOME=~/Projects/emacs-test emacs

报错信息

$HOME=~/Projects/emacs-test emacs
Fatal error 11: Segmentation violation
Backtrace:
emacs(+0x148065)[0x56443bc81065]
emacs(+0x4089c)[0x56443bb7989c]
emacs(+0x40dc3)[0x56443bb79dc3]
emacs(+0x14604e)[0x56443bc7f04e]
emacs(+0x1460ca)[0x56443bc7f0ca]
/usr/lib/libpthread.so.0(+0x13870)[0x7f486dd89870]
/usr/lib/librime.so.1(_ZN4rime4PoetD2Ev+0x28)[0x7f485a8ea1e8]
/usr/lib/librime.so.1(_ZN4rime16ScriptTranslatorD0Ev+0x35)[0x7f485a903ff5]
/usr/lib/librime.so.1(_ZNSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE10_M_releaseEv+0x3a)[0x7f485a80233a]
/usr/lib/librime.so.1(_ZN4rime14ConcreteEngineD1Ev+0x17f)[0x7f485a81d2ff]
/usr/lib/librime.so.1(_ZN4rime14ConcreteEngineD0Ev+0xa)[0x7f485a81d3fa]
/usr/lib/librime.so.1(_ZN4rime7Service18CleanupAllSessionsEv+0x8a)[0x7f485a834d8a]
/usr/lib/librime.so.1(_ZN4rime7ServiceD2Ev+0x13)[0x7f485a834df3]
/usr/lib/librime.so.1(_ZNSt10unique_ptrIN4rime7ServiceESt14default_deleteIS1_EED2Ev+0x12)[0x7f485a837a82]
/usr/lib/libc.so.6(+0x3f4a7)[0x7f486da0f4a7]
/usr/lib/libc.so.6(+0x3f64e)[0x7f486da0f64e]
emacs(+0x40824)[0x56443bb79824]
emacs(+0x1aab83)[0x56443bce3b83]
emacs(+0x1e3b89)[0x56443bd1cb89]
emacs(+0x1aaabf)[0x56443bce3abf]
emacs(+0x1e3b89)[0x56443bd1cb89]
emacs(+0x1aaabf)[0x56443bce3abf]
emacs(+0x1a7213)[0x56443bce0213]
emacs(+0x1aab83)[0x56443bce3b83]
emacs(+0x1a86be)[0x56443bce16be]
emacs(+0x1aab83)[0x56443bce3b83]
emacs(+0x1e3b89)[0x56443bd1cb89]
emacs(+0x1aaabf)[0x56443bce3abf]
emacs(+0x1aac3a)[0x56443bce3c3a]
emacs(+0x13c550)[0x56443bc75550]
emacs(+0x1a9cd7)[0x56443bce2cd7]
emacs(+0x12d155)[0x56443bc66155]
emacs(+0x1a9c32)[0x56443bce2c32]
emacs(+0x12d0ed)[0x56443bc660ed]
emacs(+0x1326eb)[0x56443bc6b6eb]
emacs(+0x132a14)[0x56443bc6ba14]
emacs(+0x48dfc)[0x56443bb81dfc]
/usr/lib/libc.so.6(__libc_start_main+0xd5)[0x7f486d9f7b25]
emacs(+0x4954e)[0x56443bb8254e]
Segmentation fault (core dumped)

.emacs配置:

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://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.
 '(package-selected-packages '(rime)))
(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.
 )

@wsw0108
Copy link
Contributor

wsw0108 commented Jul 2, 2021

自己编译了1.7.1,1.7.2,最小配置都没有崩溃的问题,
本来以为自己编译1.7.3,会复现问题,结果,依然没问题。
以上编译都是直接librime源码下make。
然后emacs-rime的Makefile固定rpath到指定路径。

但是只要是链接到系统(Arch)的1.7.3-1,就必然崩溃。。。

已经定位到是这个 rime/librime#431 的提交引入的。
具体来说就是这行 https://github.com/rime/librime/blob/a1203fce1ebca70cc04b964d136ae6c4331708e5/Makefile#L46
-DENABLE_EXTERNAL_PLUGINS=ON,可能是什么PIC导致的,望有高手解答。
如果用make merged-plugins就不会crash了。

更新:
也与这个提交不太相关,与arch打包进去的插件octagram有关,从/usr/lib/rime-plugins里删除这个插件后,正常退出。
单独或全部保留其他插件,都可以正常退出。
只保留或包含这个插件,就必然退出崩溃。

@wangwb98
Copy link

用spacemacs碰到了同样的问题,谢谢 @wsw0108 的信息,最后我采用的fix 方式是用下面代码来确保在exit emacs 之前先清理rime lib session 等。有需要的朋友可以参考。

(add-hook 'kill-emacs-hook #'rime-lib-finalize)

@DogLooksGood
Copy link
Owner

看起来可以把这个处理加在 emacs-rime 中。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants