LoginSignup
1
0

More than 3 years have passed since last update.

ibus-setup-kkcがエラーを吐いて困る

Last updated at Posted at 2020-06-21

まずはじめに伝えておきたいこと

完全に私が悪いです。
すべてが解決した今、ibus-kkcは安定していますし、何の不満もありません。
私と同じようなミスをしてしまった人のために記録に残そうと思います。

経緯

古くからATOKユーザの私はkkcのキーバインドのATOKにしたい。upstreamにはATOKキーバインドが既にmergeされており、Debianパッケージのバージョンには含まれていなかったため、upstreamから設定部分だけ持ってこようとしました。そして失敗しました。しつこいようですが完全に私が悪いです。

その際、表示されたエラーは下のとおり。

$ /usr/lib/ibus/ibus-setup-kkc 
**
ERROR:setup.c:2389:setup_dialog_populate_shortcut_treeview: assertion failed: (parent_metadata != null)
Bail out! ERROR:setup.c:2389:setup_dialog_populate_shortcut_treeview: assertion failed: (parent_metadata != null)
Aborted (core dumped)

多分、どこかにATOKリファンレスを参照する設定が残っていることが原因と思い、原因を追いました。

ソースコードのエラー箇所を探す


469     void populate_shortcut_treeview (Kkc.InputMode input_mode) {
470         Variant? variant = preferences.get ("typing_rule");
471         assert (variant != null);
472
473         var parent_metadata = Kkc.RuleMetadata.find (variant.get_string ());
474         assert (parent_metadata != null);
475

474行目。parent_metadataがエラー表示されているのと、関数名が一致していることから怪しい。
ここでは、名前"typing_rule"で保存された設定情報に基づいて、kkcのルールを探そうとしています。kkcのルールが存在せずassertされていますので、typing_ruleがどこに保存されているか、今の値が何か、がはっきりすれば修正できそうです。

アクセスするファイルを特定する

どこかのファイルから設定情報を読み込んでいるはず。githubにソースコードはあるもののリコンパイルするのもひと手間なので、とりあえずトレースしてみました。

$ strace -o strace.log /usr/lib/ibus/ibus-setup-kkc

存在しないファイルは除外。/usr,/etcなどシステム全体で扱うようなファイルはPermissionの都合で変更出来無いことから除外。/home以下に存在するファイルに絞っていきます。


$ grep /home/hiromotai/.config strace.log | grep -v NOENT 
openat(AT_FDCWD, "/home/hiromotai/.config/dconf/user", O_RDONLY) = 8
access("/home/hiromotai/.config/gtk-3.0/settings.ini", F_OK) = 0
openat(AT_FDCWD, "/home/hiromotai/.config/gtk-3.0/settings.ini", O_RDONLY) = 13
mkdir("/home/hiromotai/.config/ibus/bus", 0700) = -1 EEXIST (ファイルが存在します)
stat("/home/hiromotai/.config/ibus/bus", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
stat("/home/hiromotai/.config/ibus/bus", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
inotify_add_watch(13, "/home/hiromotai/.config/ibus/bus", IN_MODIFY|IN_ATTRIB|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_ONLYDIR) = 1
openat(AT_FDCWD, "/home/hiromotai/.config/ibus/bus/838350fdf26046b0b7dc4b20674d3783-unix-wayland-0", O_RDONLY) = 14

ディレクトリエントリを除くと、"/home/hiromotai/.config/dconf/user" に絞られました。これが怪しいですね。

dconf

wikipediaによると、dconfとはシステム設定の塊のようです。

dconf is a low-level configuration system and settings management tool. Its main purpose is to provide a back end to GSettings on platforms that don't already have configuration storage systems.

探してみるとatokエントリを発見しました。defaultに戻して修正完了です。

$ dconf dump /desktop/ibus/engine/kkc/
[/]
show-annotation=true
typing-rule='atok'

参考文献

以上,誰かの参考になれば幸いです。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0