Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wayland版Firefox: バグ修正 #2

Closed
ashie opened this issue Jul 26, 2016 · 14 comments
Closed

Wayland版Firefox: バグ修正 #2

ashie opened this issue Jul 26, 2016 · 14 comments
Labels
Renesas RZ/G1 RZ/G1 で再現する問題 Wayland

Comments

@ashie
Copy link
Contributor

ashie commented Jul 26, 2016

X11上ではGPUアクセラレーションが効かないボードが存在するため、これらのボードでも
GPUアクセラレーションを有効化するためにWayland対応を進めている。
しかしWayland版Firefoxはまだ安定しておらず、様々なバグが存在する。
切り分けがあまりできていないので、ひとまずメタissueとして上げておく。

Firefoxそのものの問題については、ここではなく https://bugzilla.mozilla.org で作業を進めるべき。
既にBugエントリが存在する場合はそこで進める。
無い場合は新しいBugを立ててそこで作業する。

関連Bug:

GTK+等の依存ライブラリの問題の場合は、それぞれのライブラリの最新版で修正されているか確認し、修正されていない場合は同様の対応を行う。最新版で対応されていて、バックポート等の対応が必要な場合はここに新たなissueを立てる。

なお、Wayland版FirefoxについてはPC上でも動くので、改善作業には必ずしも組み込みボードは必要無い。上記Bugで情報を拾って最新版をビルドするか、Firefox 45については以下にパッチをポーティングしたブランチを用意している。

@ashie
Copy link
Contributor Author

ashie commented Sep 16, 2016

#1 の対応である程度は改善した。
残っている大きな問題は以下:

  • プルダウンメニュー上のクリックが下のウィンドウに通り抜ける
    • Wayland compositorによって挙動が異なる? Westonではこの問題が発生するが、GNOME Shellでは発生しない。
  • ポップアップウィンドウのサイズがおかしい(ウィンドウ枠分が足りない)
    • GTK+-3.20では改善
  • 右クリックメニュー等がオープン直後に閉じてしまう。
    • これもGTK+-3.20で改善?(記憶違いかも。要確認)
  • ウィンドウリサイズ操作を素早く行うと落ちることがある。
    • GTK+-3.20では改善
  • 終了時にクラッシュする
    • 終了方法による。killやウィンドウクローズボタンでは発生するが、Ctrl+Qでは発生しない

@ashie ashie added the Renesas RZ/G1 RZ/G1 で再現する問題 label Sep 16, 2016
@ashie
Copy link
Contributor Author

ashie commented Sep 26, 2016

Firefoxそのものの問題については、ここではなく https://bugzilla.mozilla.org で作業を進めるべき。

Bugzillaに本プロジェクト用のメタバグ立てたので、個々のBugはそこに繋げていく。

https://bugzilla.mozilla.org/show_bug.cgi?id=1305341

@ashie
Copy link
Contributor Author

ashie commented Oct 11, 2016

残っている大きな問題は以下:

もう一点発見。

  • ナビゲーションのショートカットキー(ALT + ← or →)が効いていない? ALTが効かずカーソルキーだけが認識されているように見える。

@ashie
Copy link
Contributor Author

ashie commented Oct 19, 2016

https://gem-tanzanite.github.io/ のデモでタッチを繰り返していると落ちることがある。
スタックトレースを取れたので貼り付けておく。
GTK+のDnD処理の問題のようだ。

#0  0xb6f001ac in raise (sig=11) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
#1  0xb454c7d0 in nsProfileLock::FatalSignalHandler(int, siginfo_t*, void*) () from ./usr/lib/firefox-45.3.0/libxul.so
#2  <signal handler called>
#3  0x0000c8f8 in mozalloc_abort(char const*) ()
#4  0x0000c8b4 in abort ()
#5  0xb60ae9b4 in wl_proxy_marshal_array_constructor (proxy=proxy@entry=0xb6acd100, opcode=opcode@entry=0, 
    args=args@entry=0xbeb31908, interface=interface@entry=0x0)
    at /usr/src/debug/wayland/1.6.0-r0/wayland-1.6.0/src/wayland-client.c:549
#6  0xb60aea20 in wl_proxy_marshal (proxy=proxy@entry=0xb6acd100, opcode=0)
    at /usr/src/debug/wayland/1.6.0-r0/wayland-1.6.0/src/wayland-client.c:595
#7  0xb6125728 in wl_data_device_start_drag (serial=<optimized out>, icon=0x933feaf0, origin=0x0, source=0x949fd460, 
    wl_data_device=0xb6acd100)
    at /home/aho/Projects/iwg20m-release-bsp/build/tmp/sysroots/iwg20m/usr/include/wayland-client-protocol.h:990
#8  _gdk_wayland_window_drag_begin (window=<optimized out>, device=<optimized out>, targets=<optimized out>)
    at /usr/src/debug/gtk+3/3.18.9-r0/gtk+-3.18.9/gdk/wayland/gdkdnd-wayland.c:378
#9  0xb65126d8 in gtk_drag_begin_internal (widget=0x92761540, widget@entry=0x988b9e58, site=0x9b9e29c0, site@entry=0x0, 
    target_list=0x4, target_list@entry=0x92761540, 
    actions=(GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_PRIVATE | unknown: 3669035328), 
    actions@entry=(GDK_ACTION_DEFAULT | GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK), button=button@entry=1, 
    event=0xbeb31ab8, event@entry=0xbeb31aac, x=x@entry=-1, y=y@entry=-1)
    at /usr/src/debug/gtk+3/3.18.9-r0/gtk+-3.18.9/gtk/gtkdnd.c:2467
#10 0xb65158a8 in gtk_drag_begin (widget=0x988b9e58, targets=0x92761540, 
    actions=(GDK_ACTION_DEFAULT | GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK), button=1, event=0xbeb31ab8)
    at /usr/src/debug/gtk+3/3.18.9-r0/gtk+-3.18.9/gtk/gtkdnd.c:2669
#11 0xb3f0bdec in nsDragService::InvokeDragSessionImpl(nsISupportsArray*, nsIScriptableRegion*, unsigned int) ()
   from ./usr/lib/firefox-45.3.0/libxul.so
#12 0xb3ed9b68 in nsBaseDragService::InvokeDragSession(nsIDOMNode*, nsISupportsArray*, nsIScriptableRegion*, unsigned int)
    () from ./usr/lib/firefox-45.3.0/libxul.so
#13 0xb3ed9a00 in nsBaseDragService::InvokeDragSessionWithImage(nsIDOMNode*, nsISupportsArray*, nsIScriptableRegion*, unsig
ned int, nsIDOMNode*, int, int, nsIDOMDragEvent*, nsIDOMDataTransfer*) () from ./usr/lib/firefox-45.3.0/libxul.so
#14 0xb3a48e00 in mozilla::EventStateManager::DoDefaultDragStart(nsPresContext*, mozilla::WidgetDragEvent*, mozilla::dom::D
ataTransfer*, nsIContent*, nsISelection*) () from ./usr/lib/firefox-45.3.0/libxul.so
#15 0xb3a493e4 in mozilla::EventStateManager::GenerateDragGesture(nsPresContext*, mozilla::WidgetMouseEvent*) ()
   from ./usr/lib/firefox-45.3.0/libxul.so
#16 0xb3a4996c in mozilla::EventStateManager::PreHandleEvent(nsPresContext*, mozilla::WidgetEvent*, nsIFrame*, nsIContent*,
 nsEventStatus*) () from ./usr/lib/firefox-45.3.0/libxul.so
#17 0xb40b4264 in PresShell::HandleEventInternal(mozilla::WidgetEvent*, nsEventStatus*, bool) ()
   from ./usr/lib/firefox-45.3.0/libxul.so
#18 0xb40b47fc in PresShell::HandlePositionedEvent(nsIFrame*, mozilla::WidgetGUIEvent*, nsEventStatus*) ()
   from ./usr/lib/firefox-45.3.0/libxul.so
#19 0xb40b5dac in PresShell::HandleEvent(nsIFrame*, mozilla::WidgetGUIEvent*, bool, nsEventStatus*, nsIContent**) ()
   from ./usr/lib/firefox-45.3.0/libxul.so
#20 0xb3ec2d20 in nsViewManager::DispatchEvent(mozilla::WidgetGUIEvent*, nsView*, nsEventStatus*) ()
   from ./usr/lib/firefox-45.3.0/libxul.so
#21 0xb3ec1a10 in nsView::HandleEvent(mozilla::WidgetGUIEvent*, bool) () from ./usr/lib/firefox-45.3.0/libxul.so
#22 0xb3eeef6c in nsWindow::DispatchEvent(mozilla::WidgetGUIEvent*, nsEventStatus&) ()
   from ./usr/lib/firefox-45.3.0/libxul.so
#23 0xb3ec3f40 in nsBaseWidget::DispatchInputEvent(mozilla::WidgetInputEvent*) () from ./usr/lib/firefox-45.3.0/libxul.so
#24 0xb3ef548c in nsWindow::OnMotionNotifyEvent(_GdkEventMotion*) () from ./usr/lib/firefox-45.3.0/libxul.so
#25 0xb3ef54e0 in motion_notify_event_cb(_GtkWidget*, _GdkEventMotion*) () from ./usr/lib/firefox-45.3.0/libxul.so
#26 0xb6384504 in _gtk_marshal_BOOLEAN__BOXED (closure=0xa1444a70, return_value=0xbeb322d0, 
    n_param_values=<optimized out>, param_values=0xbeb32338, invocation_hint=0xbeb322f4, marshal_data=0x0)
    at /usr/src/debug/gtk+3/3.18.9-r0/gtk+-3.18.9/gtk/gtkmarshalers.c:86
#27 0xb570a35c in g_closure_invoke (closure=0xa1444a70, return_value=0xbeb322d0, return_value@entry=0x0, 
    n_param_values=2, param_values=0xbeb32338, param_values@entry=0xbeb32444, 
    invocation_hint=invocation_hint@entry=0xbeb322f4)
    at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/gobject/gclosure.c:801
#28 0xb571ea60 in signal_emit_unlocked_R (node=node@entry=0xb6acdd90, detail=3064650800, instance=0xb6ac93a8, 
    emission_return=0xbeb322d0, emission_return@entry=0xbeb323c0, 
    instance_and_params=instance_and_params@entry=0xbeb32338)
    at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/gobject/gsignal.c:3627
#29 0xb5726b24 in g_signal_emit_valist (instance=instance@entry=0xa17bd158, signal_id=<optimized out>, 
    detail=detail@entry=380, var_args=...) at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/gobject/gsignal.c:3393
#30 0xb572713c in g_signal_emit (instance=instance@entry=0xa17bd158, signal_id=<optimized out>, detail=0)
    at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/gobject/gsignal.c:3439
#31 0xb64df3ec in gtk_widget_real_touch_event (widget=widget@entry=0xa17bd158, event=0x926afc80)
    at /usr/src/debug/gtk+3/3.18.9-r0/gtk+-3.18.9/gtk/gtkwidget.c:7206
#32 0xb6384504 in _gtk_marshal_BOOLEAN__BOXED (closure=0xb6aadbf0, return_value=0xbeb32538, 
    n_param_values=<optimized out>, param_values=0xbeb325a0, invocation_hint=0xbeb3255c, 
    marshal_data=0xb64df2e0 <gtk_widget_real_touch_event>)
    at /usr/src/debug/gtk+3/3.18.9-r0/gtk+-3.18.9/gtk/gtkmarshalers.c:86
#33 0xb570a35c in g_closure_invoke (closure=0xb6aadbf0, closure@entry=0x2a9, return_value=0xbeb32538, 
    return_value@entry=0x0, n_param_values=2, param_values=0xbeb325a0, param_values@entry=0xbeb326ac, 
    invocation_hint=invocation_hint@entry=0xbeb3255c)
    at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/gobject/gclosure.c:801
#34 0xb571e744 in signal_emit_unlocked_R (node=node@entry=0xb6acdd30, detail=3064650736, instance=0xb6ac9398, 
    emission_return=0xbeb32538, emission_return@entry=0xbeb32628, 
    instance_and_params=instance_and_params@entry=0xbeb325a0)                                                      [10/648]
    at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/gobject/gsignal.c:3665
#35 0xb5726b24 in g_signal_emit_valist (instance=instance@entry=0xa17bd158, signal_id=<optimized out>, 
    detail=detail@entry=0, var_args=...) at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/gobject/gsignal.c:3393
#36 0xb572713c in g_signal_emit (instance=instance@entry=0xa17bd158, signal_id=<optimized out>, detail=0)
    at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/gobject/gsignal.c:3439
#37 0xb64e0ee0 in gtk_widget_event_internal (widget=0xa17bd158, event=0x926afc80)
    at /usr/src/debug/gtk+3/3.18.9-r0/gtk+-3.18.9/gtk/gtkwidget.c:7692
#38 0xb6506d9c in _gtk_window_check_handle_wm_event (event=0x926afc80)
    at /usr/src/debug/gtk+3/3.18.9-r0/gtk+-3.18.9/gtk/gtkwindow.c:7945
#39 0xb6382e50 in gtk_main_do_event (event=0x926afc80) at /usr/src/debug/gtk+3/3.18.9-r0/gtk+-3.18.9/gtk/gtkmain.c:1677
#40 0xb6125990 in gdk_event_source_dispatch (base=<optimized out>, callback=<optimized out>, data=<optimized out>)
    at /usr/src/debug/gtk+3/3.18.9-r0/gtk+-3.18.9/gdk/wayland/gdkeventsource.c:90
#41 0xb5611cc4 in g_main_dispatch (context=0xb6a1b5c0)
    at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/glib/gmain.c:3154
#42 g_main_context_dispatch (context=context@entry=0xb6a1b5c0)
    at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/glib/gmain.c:3769
#43 0xb5611ef8 in g_main_context_iterate (context=context@entry=0xb6a1b5c0, block=block@entry=1, 
    dispatch=dispatch@entry=1, self=<optimized out>) at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/glib/gmain.c:3840
#44 0xb5611fc0 in g_main_context_iteration (context=0xb6a1b5c0, may_block=1)
    at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/glib/gmain.c:3901
#45 0xb3efaa74 in nsAppShell::ProcessNextNativeEvent(bool) () from ./usr/lib/firefox-45.3.0/libxul.so
#46 0xb3edb248 in nsBaseAppShell::DoProcessNextNativeEvent(bool) () from ./usr/lib/firefox-45.3.0/libxul.so
#47 0xb3edd014 in nsBaseAppShell::OnProcessNextEvent(nsIThreadInternal*, bool) () from ./usr/lib/firefox-45.3.0/libxul.so
#48 0xb2ac555c in nsThread::ProcessNextEvent(bool, bool*) () from ./usr/lib/firefox-45.3.0/libxul.so
#49 0xb2ae4374 in NS_ProcessNextEvent(nsIThread*, bool) () from ./usr/lib/firefox-45.3.0/libxul.so
#50 0xb2d015dc in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) () from ./usr/lib/firefox-45.3.0/libxul.so
#51 0xb2ce2500 in MessageLoop::Run() () from ./usr/lib/firefox-45.3.0/libxul.so
#52 0xb3ed98dc in nsBaseAppShell::Run() () from ./usr/lib/firefox-45.3.0/libxul.so
#53 0xb451e258 in nsAppStartup::Run() () from ./usr/lib/firefox-45.3.0/libxul.so
#54 0xb45537d0 in XREMain::XRE_mainRun() () from ./usr/lib/firefox-45.3.0/libxul.so
#55 0xb4553a84 in XREMain::XRE_main(int, char**, nsXREAppData const*) () from ./usr/lib/firefox-45.3.0/libxul.so
#56 0xb4553c90 in XRE_main () from ./usr/lib/firefox-45.3.0/libxul.so
#57 0x0000c590 in do_main(int, char**, nsIFile*) ()
#58 0x0000bd44 in main ()

@ashie
Copy link
Contributor Author

ashie commented Oct 19, 2016

タッチ操作がマウスイベントになっているようだ

外見上の動作としては、Weston上でタッチをすると、マウスカーソルが追従せずにタッチ箇所が反応しているので、タッチイベントとマウスイベントは別に処理されているように見える。GTK+に渡る段階辺りでエミュレーションになっている?

@ashie
Copy link
Contributor Author

ashie commented Oct 24, 2016

Linux版でタッチイベントを有効化しているのは以下:
https://dxr.mozilla.org/mozilla-esr45/source/widget/gtk/nsWindow.cpp#955

それを実際に呼んでいるのは以下:
https://dxr.mozilla.org/mozilla-esr45/source/widget/nsBaseWidget.cpp#926

  // When APZ is enabled, we can actually enable raw touch events because we
  // have code that can deal with them properly. If APZ is not enabled, this
  // function doesn't get called.

APZを有効化するにはe10sを有効化しないといけない。
ESR45ベースだと厳しそう。

関連Bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1268599

@ashie
Copy link
Contributor Author

ashie commented Oct 24, 2016

とりあえずイベント発生させるだけでも試してみるか?

@ashie
Copy link
Contributor Author

ashie commented Oct 24, 2016

https://gem-tanzanite.github.io/ のデモでタッチを繰り返していると落ちることがある。
スタックトレースを取れたので貼り付けておく。
GTK+のDnD処理の問題のようだ。

G_MESSAGES_DEBUG=all をつけた時のメッセージ

(firefox:734): Gdk-CRITICAL **: gdk_wayland_window_get_wl_surface: assertion 'GDK_IS_WAYLAND_WINDOW (window)' failed
(firefox:734): Gdk-DEBUG: error marshalling arguments for start_drag (signature ?oo?ou): null value passed for arg 1

(firefox:734): Gdk-DEBUG: Error marshalling request: Invalid argument

Redirecting call to abort() to mozalloc_abort

_gdk_wayland_window_drag_begin()において、waylandのstart_dragの引数originにNULLが渡っている。WaylandプロトコルとしてはNULLは許されない。

    <request name="start_drag">
      ...
      <arg name="source" type="object" interface="wl_data_source" allow-null="true"/>
      <arg name="origin" type="object" interface="wl_surface"/>
      <arg name="icon" type="object" interface="wl_surface" allow-null="true"/>
      <arg name="serial" type="uint" summary="serial of the implicit grab on the origin"/>

@ashie
Copy link
Contributor Author

ashie commented Oct 24, 2016

_gdk_wayland_window_drag_begin()において、waylandのstart_dragの引数originにNULLが渡っている。WaylandプロトコルとしてはNULLは許されない。

本質的な修正はこのバージョンのGTK+では難しそうだが、NULLチェックを入れればクラッシュは回避できる。

@ashie
Copy link
Contributor Author

ashie commented Oct 31, 2016

  • 右クリックメニュー等がオープン直後に閉じてしまう。
    これもGTK+-3.20で改善?(記憶違いかも。要確認)

GDK_WINDOW_TYPE_HINT_POPUP_MENUでこの症状が出る。また、表示位置もランダムに表示される。
これはGDK_WINDOW_TYPE_HINT_UTILITYに変えることで悪くない挙動になりそうだ(Westonでメニューアイテムをクリックできない問題は残るが)。
PCで確認したところ、GTK+-3.20以上ではGDK_WINDOW_TYPE_HINT_POPUP_MENUのままでも改善される。

右クリックメニューに関しては、上記に加えてクラッシュも発生する。
これは実機のみで、PCでは発生しない。
スタックトレースを確認したが、GPUドライバが絡んできそう。

0xb61dc900 in wl_proxy_marshal_constructor (proxy=0x90acd7c0, opcode=3, interface=0xb61e8ac4 <wl_callback_interface>)
    at /usr/src/debug/wayland/1.6.0-r0/wayland-1.6.0/src/wayland-client.c:625
625     wl_argument_from_va_list(proxy->object.interface->methods[opcode].signature,
(gdb) where
#0  0xb61dc900 in wl_proxy_marshal_constructor (proxy=0x90acd7c0, opcode=3, 
    interface=0xb61e8ac4 <wl_callback_interface>)
    at /usr/src/debug/wayland/1.6.0-r0/wayland-1.6.0/src/wayland-client.c:625
#1  0x9dc21bf4 in ?? () from ./usr/lib/libpvrPVR2D_WAYLANDWSEGL.so
#2  0x9dc21bf4 in ?? () from ./usr/lib/libpvrPVR2D_WAYLANDWSEGL.so
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

@ashie
Copy link
Contributor Author

ashie commented Nov 30, 2016

  • プルダウンメニュー上のクリックが下のウィンドウに通り抜ける
    • Wayland compositorによって挙動が異なる? Westonではこの問題が発生するが、GNOME Shellでは発生しない。

単なる思いつきだが、Wayland Compositorよりもxwaylandの有無が影響している可能性は無いか?

@ashie
Copy link
Contributor Author

ashie commented Dec 1, 2016

単なる思いつきだが、Wayland Compositorよりもxwaylandの有無が影響している可能性は無いか?

一応PC上で試してみたが、挙動に特に変化無し。

@ashie
Copy link
Contributor Author

ashie commented Dec 14, 2016

  • ウィンドウリサイズ操作を素早く行うと落ちることがある。

StranskyとF2Fで話したところ、これは最新版GTKで直っているはずとのこと。

@ashie
Copy link
Contributor Author

ashie commented May 26, 2017

#13#45 の対応の組み合わせで、ここで挙げていた問題のほとんどは直ってしまった。

残りは

  • 終了時にクラッシュする
  • ナビゲーションのショートカットキー(ALT + ← or →)が効いていない? ALTが効かずカーソルキーだけが認識されているように見える。

くらい(後者も @ashie の環境では発生しなくなっているが @cosmo0920 の環境では発生しているらしい。)
ここは閉じて、個別のissueに移行した方が良いか?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Renesas RZ/G1 RZ/G1 で再現する問題 Wayland
Projects
None yet
Development

No branches or pull requests

1 participant