Project

General

Profile

Actions

致命的 #1055

closed

設定を開くと落ちる

Added by あひる 家鴨 almost 8 years ago. Updated almost 8 years ago.

Status:
終了
Priority:
通常
Target version:
Start date:
2017-07-09
Due date:
% Done:

0%

プラグイン名:
core/plugin/settings/setting_dsl.rb

Description

develop ブランチで設定を開くと落ちます。
cobodo 氏が発見しました。
@core/plugin/settings/setting_dsl.rb
の35行目の super() の引数に plugin を渡していないため落ちているようです。
落ちた際のログは https://gist.github.com/cobodo/32b5a9594d95f122db8c146460db82e5 の cobodo 氏が上げたものを参照してください。
後ほど修正したコミットを上げます。


バックトレース

/Users/ahiru/mikutter/source/core/mui/gtk_form_dsl.rb:10:in `initialize': wrong number of arguments (given 0, expected 1)
from /Users/ahiru/mikutter/source/core/plugin/settings/setting_dsl.rb:35:in `initialize'
from /Users/ahiru/mikutter/source/core/plugin/settings/settings.rb:37:in `new'
from /Users/ahiru/mikutter/source/core/plugin/settings/settings.rb:37:in `block in setting_window'
from /Users/ahiru/mikutter/source/core/plugin/settings/settings.rb:32:in `each'
from /Users/ahiru/mikutter/source/core/plugin/settings/settings.rb:32:in `setting_window'
from /Users/ahiru/mikutter/source/core/plugin/settings/settings.rb:20:in `block (2 levels) in <top (required)>'
from /Users/ahiru/mikutter/source/vendor/bundle/ruby/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/listener.rb:25:in `call'
from /Users/ahiru/mikutter/source/vendor/bundle/ruby/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/event.rb:97:in `block (2 levels) in call_all_listeners'
from /Users/ahiru/mikutter/source/vendor/bundle/ruby/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/event.rb:96:in `each'
from /Users/ahiru/mikutter/source/vendor/bundle/ruby/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/event.rb:96:in `block in call_all_listeners'
from /Users/ahiru/mikutter/source/vendor/bundle/ruby/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/event.rb:95:in `catch'
from /Users/ahiru/mikutter/source/vendor/bundle/ruby/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/event.rb:95:in `call_all_listeners'
from /Users/ahiru/mikutter/source/vendor/bundle/ruby/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/event.rb:39:in `block in call'
from /Users/ahiru/mikutter/source/vendor/bundle/ruby/2.4.0/gems/delayer-0.0.2/lib/delayer/procedure.rb:24:in `run'
from /Users/ahiru/mikutter/source/vendor/bundle/ruby/2.4.0/gems/delayer-0.0.2/lib/delayer/extend.rb:58:in `run_once'
from /Users/ahiru/mikutter/source/vendor/bundle/ruby/2.4.0/gems/delayer-0.0.2/lib/delayer/extend.rb:30:in `run'
from /Users/ahiru/mikutter/source/vendor/bundle/ruby/2.4.0/gems/delayer-0.0.2/lib/delayer.rb:43:in `method_missing'
from /Users/ahiru/mikutter/source/core/plugin/gtk/delayer.rb:10:in `block in boot'
from /Users/ahiru/mikutter/source/core/plugin/gtk/mainloop.rb:10:in `main'
from /Users/ahiru/mikutter/source/core/plugin/gtk/mainloop.rb:10:in `mainloop'
from mikutter.rb:68:in `boot!'
from mikutter.rb:97:in `<main>'

Actions #1

Updated by あひる 家鴨 almost 8 years ago

  • Status changed from 新規 to パッチ適用待ち

ブランチ topic/1055-fix-dsl-initialize に修正をプッシュしました。
確認をお願いします。

Actions #2

Updated by あひる 家鴨 almost 8 years ago

他のパターンでも落ちることを確認したので、もう少し追って見ます。

Actions #3

Updated by あひる 家鴨 almost 8 years ago

setting_dsl の引数の問題を潰したら新たな問題が出てきました。
core/plugin/extract/option_widget.rb@extract のハッシュ?が nil なのにキーでアクセスしようとしてるため落ちてるようです。
雑に nil チェックいれて落ちなくはしましたが、気合が足りずなぜ @extract が nil なのかとかこれでいいのかまで確認できてないです。
とりあえずメモとしてチケットに残します。
あと、場当たり的対処したのをブランチにプッシュしときました。

Actions #4

Updated by Osamu Koga almost 8 years ago

setting_dsl.rbとgtk_form_dsl.rbでコードの重複があり、そもそも元から正しくリファクタリングされてなかったように見えます。moduleのコンストラクタが独自に引数を取ると、複数のそういうmoduleをincludeしたときに必ず壊れたりして面倒なので、setting_dsl.rbではDSL関連のことは

def initialize(plugin)
  @plugin = plugin
  super()
end

だけやっておいて、ブロックの処理とかmethod_missingとかを全部gtk_form_dsl.rbに巻き取らせるのが良いように思います。

Actions #5

Updated by あひる 家鴨 almost 8 years ago

動作確認しました。
topic/1055-fix-dsl-initialize-osak の方が適切に修正されてるので、osak ブランチをマージしたいと思ってますが @toshi_a 初音 さんどうでしょうか。

Actions #6

Updated by toshi_a 初音 almost 8 years ago

  • Status changed from パッチ適用待ち to レビュー待ち

俺もosa_kさんの方法が良いと思うので、developにmergeしました。

Actions #7

Updated by Osamu Koga almost 8 years ago

  • Status changed from レビュー待ち to 終了
Actions

Also available in: Atom PDF