いまだに最近の glibc に対応していないものがあった件
最近の glibc は x86_64 環境で strcpy の挙動が変わったため、仕様を守らずに strcpy を使うとおかしなことが起こる。
先週あたりから ibus-chewing なる比較的新しめのアプリで問題が起きた。
[2010-07-12 Mon] 追記:「ibus-chewing なる比較的新しめのアプリ」と書いたが、実際には十分に枯れたと思われる gob2 コマンドで問題が起きた。誤解を生むような書き方をしてしまったような気がする。(追記ここまで)
この strcpy 問題は本当に微妙で謎な結果を引き起こす。今回の場合は、ちょっと細かい説明になるが、ibus-chewing/src/MakerDialog.gob を gob2 に通して得られる maker-dialog.c がおかしくなる。
以下の差分において maker-dialog.c.doubt は誤り。maker-dialog.c.correct が正しいものである。なんとも微妙に文字列が腐る。
--- maker-dialog.c.doubt +++ maker-dialog.c.correct @@ -65,7 +65,7 @@ { static GType type = 0; if ___GOB_UNLIKELY(type == 0) - type = g_enum_register_static ("MakerDialogProperFagg", _maker_dialog_property_flag_values); + type = g_enum_register_static ("MakerDialogPropertyFlag", _maker_dialog_property_flag_values); return type; } @@ -91,7 +91,7 @@ /* here are local prototypes */ #line 0 "MakerDialog.gob" -static void maker_dialog_class_init (MakerDialoCClass * c) G_GNUC_UNUSED; +static void maker_dialog_class_init (MakerDialogClass * c) G_GNUC_UNUSED; #line 96 "maker-dialog.c" #line 117 "MakerDialog.gob" static void maker_dialog_init (MakerDialog * self) G_GNUC_UNUSED; @@ -202,7 +202,7 @@ #undef __GOB_FUNCTION__ static void -maker_dialog_class_init (MakerDialoCClass * c G_GNUC_UNUSED) +maker_dialog_class_init (MakerDialogClass * c G_GNUC_UNUSED) { #define __GOB_FUNCTION__ "Maker:Dialog::class_init" GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;
慣れないとすぐには原因を見つけられないだろうね。