rime / librime

Rime Input Method Engine, the core library
https://rime.im
BSD 3-Clause "New" or "Revised" License
3.42k stars 559 forks source link

rime.dll 在更新intel显卡驱动后加载出现问题 #800

Closed yanhuacuo closed 9 months ago

yanhuacuo commented 9 months ago

首先,我的配置文件没有任何问题,也没有冲突或错误,甚至连警告日志都不会出现,一直使用正常

在使用 https://github.com/rime/librime/releases/tag/latest 下发布的 vs 版 rime.dll 时,遇到了无法加载的问题。

于是,我重做了一下系统后,正常了。我以为,这可能是我电脑出了故障

因为是重做的系统,它的驱动是很陈旧的,于是在更新了下面这版驱动后,较新的 rime.dll 又出现加载故障了:

https://downloadmirror.intel.com/814237/gfx_win_101.5186_101.5234.exe

这太神奇了,我感到不可思议,我想,是不是 CI 的编译环境引起的,于是就用本地的 Visual Studio 2022 编译了一下:

编译过程无报错,而且使用 rime_console.exe 也能调起 rime.dll 正常生成二进制词典,编译 yaml 文件。

使用 vs 依赖检测工具查看它的依赖,本地环境完全满足:

dumpbin /dependents rime.dll
Dump of file rime.dll

File Type: DLL

  Image has the following dependencies:

    KERNEL32.dll
    USER32.dll
    bcrypt.dll
    dbghelp.dll

  Summary

       2D000 .data
       6F000 .rdata
       1B000 .reloc
        1000 .rsrc
      20D000 .text

我觉得,它应当是正常的,于是我放到小狼毫(官网公开版本)里试用,发现算法服务不能正常唤起它。 但是,明明刚才使用 rime_console.exe 是可以正常调用它编译 yaml 文件的啊?

反复尝试,发现它总是在生成如下日志后退出

Log file created at: 2024/01/26 23:11:39
Running on machine: DESKTOP-05OSUPE
Running duration (h:mm:ss): 0:00:00
Log line format: [IWEF]yyyymmdd hh:mm:ss.uuuuuu threadid file:line] msg
I20240126 23:11:39.273687  1296 core_module.cc:20] registering core components.
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: config_builder
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: config
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: schema
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: user_config
I20240126 23:11:39.275681  1296 dict_module.cc:25] registering components from module 'dict'.
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: tabledb
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: stabledb
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: plain_userdb
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: userdb
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: corrector
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: dictionary
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: reverse_lookup_dictionary
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: user_dictionary
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: userdb_recovery_task
I20240126 23:11:39.275681  1296 gears_module.cc:42] registering components from module 'gears'.
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: ascii_composer
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: chord_composer
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: express_editor
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: fluid_editor
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: fluency_editor
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: key_binder
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: navigator
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: punctuator
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: recognizer
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: selector
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: speller
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: shape_processor
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: abc_segmentor
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: affix_segmentor
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: ascii_segmentor
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: matcher
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: punct_segmentor
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: fallback_segmentor
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: echo_translator
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: punct_translator
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: table_translator
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: script_translator
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: r10n_translator
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: reverse_lookup_translator
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: schema_list_translator
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: switch_translator
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: history_translator
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: simplifier
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: uniquifier
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: charset_filter
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: cjk_minifier
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: reverse_lookup_filter
I20240126 23:11:39.275681  1296 registry.cc:14] registering component: single_char_filter
I20240126 23:11:39.277683  1296 registry.cc:14] registering component: shape_formatter
I20240126 23:11:39.277683  1296 modules.cc:65] registering components from module 'lua'.
I20240126 23:11:39.283653  1296 registry.cc:14] registering component: lua_translator
I20240126 23:11:39.283653  1296 registry.cc:14] registering component: lua_filter
I20240126 23:11:39.285094  1296 registry.cc:14] registering component: lua_segmentor
I20240126 23:11:39.285094  1296 registry.cc:14] registering component: lua_processor
I20240126 23:11:39.285094  1296 levers_module.cc:22] registering components from module 'levers'.
I20240126 23:11:39.285094  1296 registry.cc:14] registering component: detect_modifications
I20240126 23:11:39.285094  1296 registry.cc:14] registering component: installation_update
I20240126 23:11:39.285094  1296 registry.cc:14] registering component: workspace_update
I20240126 23:11:39.285094  1296 registry.cc:14] registering component: schema_update
I20240126 23:11:39.285094  1296 registry.cc:14] registering component: config_file_update
I20240126 23:11:39.285094  1296 registry.cc:14] registering component: prebuild_all_schemas
I20240126 23:11:39.285094  1296 registry.cc:14] registering component: user_dict_upgrade
I20240126 23:11:39.285094  1296 registry.cc:14] registering component: cleanup_trash
I20240126 23:11:39.285094  1296 registry.cc:14] registering component: user_dict_sync
I20240126 23:11:39.285094  1296 registry.cc:14] registering component: backup_config_files
I20240126 23:11:39.285094  1296 registry.cc:14] registering component: clean_old_log_files

我就清空了【用户目录】下的【build】文件夹,从【小狼毫输入法设定】处做变动,发现 【build】文件夹下的 bin 词典都能正常生成,但是算法服务在生成它们后,就退出了。日志,亦如上。

更早的版本 rime.dll 则是正常的,不过它多了一个依赖项「ole32.dll」:

Dump of file rime.dll

File Type: DLL

  Image has the following dependencies:

    KERNEL32.dll
    USER32.dll
    bcrypt.dll
    dbghelp.dll
    ole32.dll

  Summary

       2E000 .data
       70000 .rdata
       1D000 .reloc
        1000 .rsrc
      22F000 .text

再次重做系统,一切问题消失,直到我再次尝试升级 intel 显卡驱动

https://downloadmirror.intel.com/814237/gfx_win_101.5186_101.5234.exe

最新本地编译的 rime.dll 又不能用了。

这真是令人费解啊。

yanhuacuo commented 9 months ago

rime.zip

SHA256: e4aa827328c384c0f14cb49f1bc1d028fed439fe073cf11a52f3f8ff4fc46f0d

最新本地编译版本的 rime.dll

yanhuacuo commented 9 months ago

显卡驱动怎么会影响到 rime.dll 的加载呢?

yanhuacuo commented 9 months ago

另外,有一个有意思的地方:似乎,它( 算法服务加载 rime.dll )并非是因崩溃而退,而是基于某种条件而退出。

我写了一个辅助工具,每隔 2 秒就检测一下算法服务进程是否存在,如果不存在,就强行唤醒它。在这样的机制下,就可以一直正常使用。

但是如果解除了这种【进程守护】,切【隔一会儿不用】,rime.dll 好像就又睡死了,叫不醒了。

yanhuacuo commented 9 months ago

确认是 weasel 的问题