Project

General

Profile

Actions

バグ #1378

closed

GdkPixbufのアサーションで落ちる

Added by あひる 家鴨 over 5 years ago. Updated over 5 years ago.

Status:
終了
Priority:
通常
Assignee:
-
Target version:
プラグイン名:
core/plugin/skin
クラッシュする:
Yes

Description

Windows環境でmaster( 5747025b )のmikutterを起動したら下記エラーで落ちました。

GdkPixbuf-CRITICAL **: gdk_pixbuf_new_from_file_at_scale: assertion 'width > 0 || width == -1' failed

詳細なログは添付します。

起動時に source:core/plugin/skin/model/image.rb@5747025b#L35 が呼ばれた際に width もしくは height が 0 で呼ばれることにより、この後の処理のアサーションに失敗して落ちるといった挙動です。


Files

1378.txt (7.79 KB) 1378.txt クラッシュログ あひる 家鴨, 2019-09-07 12:18

再現手順

最新のmaster( 5747025b )をcloneして起動する(Windows環境で)

Actions #1

Updated by toshi_a 初音 over 5 years ago

  • Status changed from 分類待ち to 実装待ち

ああ、クラッシュするのか。聞いたことがないです。

Actions #2

Updated by あひる 家鴨 over 5 years ago

pixbuf の呼び出し元の add_face_widget_ifn を確認したところ #1338 で対応の入った scale を通ると値が 0 になることがわかりました。
どうやら自分の環境では scale の中で呼ばれている Gdk::Visual.system.screen.resolution がデフォルト値の -1.0 (参考: GdkScreen resolution )を返すようで、その結果 val * Gdk::Visual.system.screen.resolution / 96 が -0.333333 となり to_i で 0 に丸められています。(当該箇所: source:/core/mui/gtk_extension.rb@5747025b#L340

下記対応をしてみようと思いますがいかがでしょうか。

resolution = Gdk::Visual.system.screen.resolution < 0 ? 96 : Gdk::Visual.system.screen.resolution
val * resolution / 96

Actions #3

Updated by あひる 家鴨 over 5 years ago

  • Assignee set to toshi_a 初音
Actions #4

Updated by toshi_a 初音 over 5 years ago

  • Assignee changed from toshi_a 初音 to あひる 家鴨

良いと思います!

Actions #5

Updated by あひる 家鴨 over 5 years ago

  • Status changed from 実装待ち to レビュー待ち
  • Assignee deleted (あひる 家鴨)
  • ブランチ set to topic/1378-fix-resolution

ブランチ topic/1378-fix-resolution にコミットしました。
確認をお願いします。

Actions #6

Updated by toshi_a 初音 over 5 years ago

  • Target version changed from 3.10 to 3.9
Actions #7

Updated by Shibafu Midorino over 5 years ago

  • Status changed from レビュー待ち to マージ待ち

確認しました。

Actions #8

Updated by あひる 家鴨 over 5 years ago

  • Status changed from マージ待ち to 終了

マージしました。

Actions

Also available in: Atom PDF