microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
66.47k stars 3.63k forks source link

[Bug]: Firefox browser crashing when clicking on labels #33257

Open rockerBOO opened 16 hours ago

rockerBOO commented 16 hours ago

Version

1.48.1

Steps to reproduce

  1. clone https://github.com/rockerBOO/playwright-test-firefox-label-click
  2. npm install
  3. npm run test

Expected behavior

Expected to click on the label, which may (should?) open the file browsing of the input field.

Actual behavior

In docker container

  1) [firefox] › index.spec.js:11:1 › index ────────────────────────────────────────────────────────

    Error: Target page, context or browser has been closed

  2) [firefox] › index.spec.js:3:1 › click a label ─────────────────────────────────────────────────

    Error: Test ended.
    Browser logs:

    <launching> /ms-playwright/firefox-1465/firefox/firefox -no-remote -headless -profile /tmp/playwright_firefoxdev_profile-Fgw6ZC -juggler-pipe -silent
    <launched> pid=134
    [pid=134][err] *** You are running in headless mode.
    [pid=134][err] JavaScript warning: resource://services-settings/Utils.sys.mjs, line 116: unreachable code after return statement
    [pid=134][out] console.warn: services.settings: Ignoring preference override of remote settings server
    [pid=134][out] console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
    [pid=134][out] Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libpci missing (t=0.616565) [GFX1-]: glxtest: libpci missing
    [pid=134][out] Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libpci missing (t=0.616565) |[1][GFX1-]: glxtest: Unable to open a connection to the X server (t=0.616565) [GFX1-]: glxtest: Unable to open a connection to the X server
    [pid=134][out] Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libpci missing (t=0.616565) |[1][GFX1-]: glxtest: Unable to open a connection to the X server (t=0.616565) |[2][GFX1-]: No GPUs detected via PCI
    [pid=134][out]  (t=0.616565) [GFX1-]: No GPUs detected via PCI
    [pid=134][out]
    [pid=134][out] console.error: ({})
    [pid=134][out]
    [pid=134][out] Juggler listening to the pipe
    [pid=134][err] [Parent 134: Main Thread]: D/Process GetNewOrUsedProcess for type extension
    [pid=134][err] [Parent 134: Main Thread]: D/Process Launching new process immediately for type extension
    [pid=134][err] [Parent 134: Main Thread]: V/Process CreateSubprocess: ContentParent 7e0096028c00 mSubprocess 7e009477b580 childID 2
    [pid=134][err] [Parent 134: Main Thread]: D/Process AddBlocker: extension 7e0096028c00 (sNumBlockers=0)
    [pid=134][err] [Parent 134: Main Thread]: D/Process GetNewOrUsedProcess: new immediate process 7e0096028c00
    [pid=134][err] [Parent 134: Main Thread]: D/Process ContentParent::InitInternal: 7e0096028c00
    [pid=134][err] [Child 669: Main Thread]: D/Process Changed name of process 669 to Web Content
    [pid=134][err] [Child 669: Main Thread]: D/Process Setting remoteType of process 669 to extension
    [pid=134][err] [Child 669: Main Thread]: D/Process Changed name of process 669 to WebExtensions
    [pid=134][err] [Parent 134: Main Thread]: D/Process GetNewOrUsedProcess for type extension
    [pid=134][err] [Parent 134: Main Thread]: D/Process GetUsedProcess: Reused process 7e0096028c00 (2) for extension
    [pid=134][err] [Parent 134: Main Thread]: D/Process GetNewOrUsedProcess for type extension
    [pid=134][err] [Parent 134: Main Thread]: D/Process GetUsedProcess: Reused process 7e0096028c00 (2) for extension
    [pid=134][err] [Parent 134: Main Thread]: D/Process GetNewOrUsedProcess for type extension
    [pid=134][err] [Parent 134: Main Thread]: D/Process GetUsedProcess: Reused process 7e0096028c00 (2) for extension
    [pid=134][err] [Parent 134: Main Thread]: D/Process GetNewOrUsedProcess for type extension
    [pid=134][err] [Parent 134: Main Thread]: D/Process GetUsedProcess: Reused process 7e0096028c00 (2) for extension
    [pid=134][err] [Parent 134: Main Thread]: D/Process GetNewOrUsedProcess for type web
    [pid=134][err] [Parent 134: Main Thread]: D/Process Launching new process immediately for type web
    [pid=134][err] [Parent 134: Main Thread]: V/Process CreateSubprocess: ContentParent 7e0093088b00 mSubprocess 7e00930e4980 childID 3
    [pid=134][err] [Parent 134: Main Thread]: D/Process AddBlocker: web 7e0093088b00 (sNumBlockers=1)
    [pid=134][err] [Parent 134: Main Thread]: D/Process GetNewOrUsedProcess: new immediate process 7e0093088b00
    [pid=134][err] [Parent 134: Main Thread]: D/Process ContentParent::InitInternal: 7e0093088b00
    [pid=134][err] [Child 722: Main Thread]: D/Process Changed name of process 722 to Web Content
    [pid=134][err] [Child 722: Main Thread]: D/Process Setting remoteType of process 722 to web
    [pid=134][err] [Child 722: Main Thread]: D/Process Changed name of process 722 to Web Content
    [pid=134][err] [Parent 134: Main Thread]: V/Process RecvFirstIdle 7e0093088b00: Removing Blocker for web
    [pid=134][err] [Parent 134: Main Thread]: D/Process RemoveBlocker: web 7e0093088b00 (sNumBlockers=2)
    [pid=134][out] console.error: ({})
    [pid=134][out] console.error: SearchEngineSelector: "Received empty search configuration!"
    [pid=134][err] [Parent 134: Main Thread]: V/Process RecvFirstIdle 7e0096028c00: Removing Blocker for extension
    [pid=134][err] [Parent 134: Main Thread]: D/Process RemoveBlocker: extension 7e0096028c00 (sNumBlockers=1)
    [pid=134][err] [Parent 134: Main Thread]: D/Process Blocked preallocation for 387.740986ms
    [pid=134][err] [Parent 134: Main Thread]: D/Process GetNewOrUsedProcess for type extension
    [pid=134][err] [Parent 134: Main Thread]: D/Process GetUsedProcess: Reused process 7e0096028c00 (2) for extension
    [pid=134][out] console.error: SearchEngineSelector: "Received empty search configuration!"
    [pid=134][out] console.error: SearchService: "#init: failure initializing search:" ({})
    [pid=134][err] JavaScript error: resource://gre/modules/SearchEngineSelector.sys.mjs, line 76: NS_ERROR_UNEXPECTED: Failed to get engine data from Remote Settings
    [pid=134][err] JavaScript error: resource://gre/modules/SearchEngineSelector.sys.mjs, line 76: NS_ERROR_UNEXPECTED: Failed to get engine data from Remote Settings
    [pid=134][err] JavaScript error: resource://gre/modules/SearchEngineSelector.sys.mjs, line 76: NS_ERROR_UNEXPECTED: Failed to get engine data from Remote Settings
    [pid=134][err] JavaScript error: resource:///modules/SearchModeSwitcher.sys.mjs, line 254: TypeError: engine is null
    [pid=134][err] JavaScript error: resource:///modules/SearchModeSwitcher.sys.mjs, line 254: TypeError: engine is null
    [pid=134][out] console.error: "Received empty top sites configuration!"
    [pid=134][out] console.error: WebExtensions:
    [pid=134][out]   Message: [Exception... "Failed to get engine data from Remote Settings"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: resource://gre/modules/SearchEngineSelector.sys.mjs :: getEngineConfiguration :: line 76"  data: no]
    [pid=134][out]   Stack:
    [pid=134][out]     getEngineConfiguration@resource://gre/modules/SearchEngineSelector.sys.mjs:76:24
    [pid=134][out]
    [pid=134][err] JavaScript error: resource://gre/modules/SearchEngineSelector.sys.mjs, line 76: NS_ERROR_UNEXPECTED: Failed to get engine data from Remote Settings
    [pid=134][out] console.error: "Received empty top sites configuration!"
    [pid=134][err] [Parent 134, Main Thread] WARNING: _gtk_css_lookup_resolve: assertion '(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ((provider)); GType __t = ((_gtk_style_provider_private_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))' failed: 'glib warning', file /home/pwuser/firefox/toolkit/xre/nsSigHandlers.cpp:187
    [pid=134][err]
    [pid=134][err] (firefox-default:134): Gtk-CRITICAL **: 01:48:28.994: _gtk_css_lookup_resolve: assertion '(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ((provider)); GType __t = ((_gtk_style_provider_private_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))' failed
    [pid=134][err] [Parent 134, Main Thread] WARNING: g_object_set_data_full: assertion 'G_IS_OBJECT (object)' failed: 'glib warning', file /home/pwuser/firefox/toolkit/xre/nsSigHandlers.cpp:187
    [pid=134][err]
    [pid=134][err] (firefox-default:134): GLib-GObject-CRITICAL **: 01:48:28.994: g_object_set_data_full: assertion 'G_IS_OBJECT (object)' failed
    [pid=134][err] [Parent 134, Main Thread] ###!!! ASSERTION: Can't create a GtkStyleContext without a display connection: 'glib assertion', file /home/pwuser/firefox/toolkit/xre/nsSigHandlers.cpp:184
    [pid=134][err]
    [pid=134][err] (firefox-default:134): Gtk-ERROR **: 01:48:28.994: Can't create a GtkStyleContext without a display connection
    [pid=134][err] Exiting due to channel error.
    [pid=134][err] Exiting due to channel error.

  2 failed
    [firefox] › index.spec.js:3:1 › click a label ──────────────────────────────────────────────────
    [firefox] › index.spec.js:11:1 › index ─────────────────────────────────────────────────────────
  4 passed (6.1s)

  Serving HTML report at http://localhost:9323. Press Ctrl+C to quit.

On arch linux

  1) [firefox] › index.spec.js:11:1 › index ────────────────────────────────────────────────────────

    Error: browserType.launch: Target page, context or browser has been closed
    Browser logs:

    <launching> /home/rockerboo/.cache/ms-playwright/firefox-1465/firefox/firefox -no-remote -headless -profile /tmp/playwright_firefoxdev_profile-HlV4Fj -juggler-pipe -silent
    <launched> pid=1393375
    [pid=1393375][err] *** You are running in headless mode.
    [pid=1393375][err] JavaScript warning: resource://services-settings/Utils.sys.mjs, line 116: unreachable code after return statement
    [pid=1393375][out] console.warn: services.settings: Ignoring preference override of remote settings server
    [pid=1393375][out] console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
    [pid=1393375] <process did exit: exitCode=null, signal=SIGSEGV>
    [pid=1393375] starting temporary directories cleanup
    Call log:
      - <launching> /home/rockerboo/.cache/ms-playwright/firefox-1465/firefox/firefox -no-remote -headless -profile /tmp/playwright_firefoxdev_profile-HlV4Fj -juggler-pipe -silent
      - <launched> pid=1393375
      - [pid=1393375][err] *** You are running in headless mode.
      - [pid=1393375][err] JavaScript warning: resource://services-settings/Utils.sys.mjs, line 116: unreachable code after return statement
      - [pid=1393375][out] console.warn: services.settings: Ignoring preference override of remote settings server
      - [pid=1393375][out] console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
      - [pid=1393375] <process did exit: exitCode=null, signal=SIGSEGV>
      - [pid=1393375] starting temporary directories cleanup

Core dump from arch linux side, npm run test

           PID: 1393375 (firefox)
           UID: 1000 (rockerboo)
           GID: 1000 (rockerboo)
        Signal: 11 (SEGV)
     Timestamp: Wed 2024-10-23 21:58:18 EDT (9min ago)
  Command Line: /home/rockerboo/.cache/ms-playwright/firefox-1465/firefox/firefox -no-remote -headless -profile /tmp/playwright_firefoxdev_profile-HlV4Fj -juggler-pipe -silent
    Executable: /home/rockerboo/.cache/ms-playwright/firefox-1465/firefox/firefox
 Control Group: /user.slice/user-1000.slice/session-2.scope
          Unit: session-2.scope
         Slice: user-1000.slice
       Session: 2
     Owner UID: 1000 (rockerboo)
       Boot ID: a9de916bada6492eb1b9665fffe339cf
    Machine ID: 7682442f66fa4b97a907eab53edd5786
      Hostname: torment
       Storage: /var/lib/systemd/coredump/core.firefox.1000.a9de916bada6492eb1b9665fffe339cf.1393375.1729735098000000.zst (present)
  Size on Disk: 8.6M
       Message: Process 1393375 (firefox) of user 1000 dumped core.

                Stack trace of thread 1393375:
                #0  0x00007f4d0bca53f4 n/a (libc.so.6 + 0x963f4)
                #1  0x00007f4d0bc4c120 raise (libc.so.6 + 0x3d120)
                #2  0x00007f4d03f44d7d n/a (/home/rockerboo/.cache/ms-playwright/firefox-1465/firefox/libxul.so + 0x6544d7d)

Additional context

I'm on Arch so I am using a docker container.

docker run -it -v .:/app  mcr.microsoft.com/playwright:v1.48.1-noble /bin/bash
cd app && npm run test

I didn't check every label click interactions, or if label is the key component here. The crash did seem significant.

Environment

System: OS: Linux 6.10 Arch Linux CPU: (16) x64 AMD Ryzen 7 5800X 8-Core Processor Memory: 41.33 GB / 94.22 GB Container: Yes Binaries: Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v18.16.0/bin/yarn npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm pnpm: 8.14.0 - ~/.nvm/versions/node/v18.16.0/bin/pnpm bun: 1.0.14 - /usr/bin/bun Languages: Bash: 5.2.32 - /usr/bin/bash

mxschmitt commented 8 hours ago

I can repro.

mxschmitt commented 7 hours ago

Backtrace:

(gdb) bt
#0  0x000077e8bbb9d7da in g_log_writer_default () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x000077e8b82f5b8f in glib_log_writer_func (flags=G_LOG_LEVEL_ERROR, fields=0x7ffc3437f6d0, n_fields=6, user_data=0x0) at /root/firefox/toolkit/xre/nsSigHandlers.cpp:210
#2  0x000077e8bbb95044 in g_log_structured_array () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x000077e8bbb952a8 in g_log_structured_standard () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x000077e8bc03425e in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#5  0x000077e8bbb10ff9 in g_type_create_instance () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#6  0x000077e8bbaf6a64 in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#7  0x000077e8bbaf8016 in g_object_new_with_properties () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#8  0x000077e8bbaf8f71 in g_object_new () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#9  0x000077e8bc144708 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#10 0x000077e8bc1449a3 in gtk_style_new () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#11 0x000077e8bc14ac61 in gtk_widget_get_default_style () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#12 0x000077e8bc0d4d62 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#13 0x000077e8bbb10fbb in g_type_create_instance () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#14 0x000077e8bbaf6a64 in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#15 0x000077e8bbaf8bc3 in g_object_new_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#16 0x000077e8bbaf8f4f in g_object_new () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#17 0x000077e8bbf0873f in gtk_file_chooser_dialog_new () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#18 0x000077e8b79ea9a6 in nsFilePicker::GtkFileChooserNew (this=<optimized out>, title=0x7ffc343808bc "File Upload", parent=<optimized out>, action=<optimized out>, accept_label=0x0) at /root/firefox/widget/gtk/nsFilePicker.cpp:721
#19 0x000077e8b79ea20f in nsFilePicker::Open (this=0x77e8a5875120, aCallback=0x77e8a593adc0) at /root/firefox/widget/gtk/nsFilePicker.cpp:440
#20 0x000077e8b755f1cd in mozilla::dom::FilePickerParent::RecvOpen
    (this=0x77e8a3ed7380, aSelectedType=@0x7ffc34380aa6: 0, aAddToRecentDocs=<optimized out>, aDefaultFile=..., aDefaultExtension=..., aFilters=<optimized out>, aFilterNames=..., aRawFilters=..., aDisplayDirectory=..., aDisplaySpecialDirectory=..., aOkButtonLabel=..., aCapture=@0x7ffc343809f7: nsIFilePicker::captureNone) at /root/firefox/dom/ipc/FilePickerParent.cpp:276
#21 0x000077e8b7621e43 in mozilla::dom::PFilePickerParent::OnMessageReceived (this=0x77e8a3ed7380, msg__=<optimized out>) at /root/firefox/obj-build-playwright/ipc/ipdl/PFilePickerParent.cpp:307
#22 0x000077e8b75f4740 in mozilla::dom::PContentParent::OnMessageReceived (this=<optimized out>, msg__=...) at /root/firefox/obj-build-playwright/ipc/ipdl/PContentParent.cpp:6391
#23 0x000077e8b5042e4b in mozilla::ipc::MessageChannel::DispatchAsyncMessage (this=this@entry=0x77e8a53a0e80, aProxy=aProxy@entry=0x77e8a4f75be0, aMsg=...) at /root/firefox/ipc/glue/MessageChannel.cpp:1785
#24 0x000077e8b504226f in mozilla::ipc::MessageChannel::DispatchMessage (this=this@entry=0x77e8a53a0e80, aProxy=aProxy@entry=0x77e8a4f75be0, aMsg=...) at /root/firefox/ipc/glue/MessageChannel.cpp:1712
#25 0x000077e8b50425ee in mozilla::ipc::MessageChannel::RunMessage (this=0x77e8a53a0e80, aProxy=0x77e8a4f75be0, aTask=...) at /root/firefox/ipc/glue/MessageChannel.cpp:1503
#26 0x000077e8b5042a01 in mozilla::ipc::MessageChannel::MessageTask::Run (this=0x77e89b2aeeb0) at /root/firefox/ipc/glue/MessageChannel.cpp:1603
#27 0x000077e8b49d1efe in mozilla::RunnableTask::Run (this=0x77e8a586df00) at /root/firefox/xpcom/threads/TaskController.cpp:618
#28 0x000077e8b49ced7a in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal (this=this@entry=0x77e8bdc9a650, aProofOfLock=...) at /root/firefox/xpcom/threads/TaskController.cpp:945
#29 0x000077e8b49ce2c7 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal (this=0x77e8bdd00018, this@entry=0x77e8bdc9a650, aProofOfLock=...) at /root/firefox/xpcom/threads/TaskController.cpp:768
#30 0x000077e8b49ce4b8 in mozilla::TaskController::ProcessPendingMTTask (this=0x77e8bdc9a650, aMayWait=false) at /root/firefox/xpcom/threads/TaskController.cpp:554
#31 0x000077e8b49d34cf in mozilla::TaskController::TaskController()::$_0::operator()() const (this=<optimized out>) at /root/firefox/xpcom/threads/TaskController.cpp:268
#32 mozilla::detail::RunnableFunction<mozilla::TaskController::TaskController()::$_0>::Run() (this=<optimized out>) at /root/firefox/xpcom/threads/nsThreadUtils.h:548
#33 0x000077e8b49de35c in nsThread::ProcessNextEvent (this=0x77e8bdc88680, aMayWait=<optimized out>, aResult=0x7ffc34382057) at /root/firefox/xpcom/threads/nsThread.cpp:1155
#34 0x000077e8b49e1bea in NS_ProcessNextEvent (aThread=0x77e8bdd00018, aThread@entry=0x77e8bdc88680, aMayWait=false) at /root/firefox/xpcom/threads/nsThreadUtils.cpp:480
#35 0x000077e8b50453e7 in mozilla::ipc::MessagePump::Run (this=0x77e8bdcf7dc0, aDelegate=0x77e8bdc8a740) at /root/firefox/ipc/glue/MessagePump.cpp:85
#36 0x000077e8b4ffb2b7 in MessageLoop::RunInternal (this=0x0) at /root/firefox/ipc/chromium/src/base/message_loop.cc:370
#37 MessageLoop::RunHandler (this=0x0) at /root/firefox/ipc/chromium/src/base/message_loop.cc:363
#38 MessageLoop::Run (this=0x0) at /root/firefox/ipc/chromium/src/base/message_loop.cc:345
#39 0x000077e8b7941d86 in nsBaseAppShell::Run (this=0x77e8b122bb80) at /root/firefox/widget/nsBaseAppShell.cpp:148
#40 0x000077e8b79ce3b7 in nsAppShell::Run (this=0x77e8b122bb80) at /root/firefox/widget/gtk/nsAppShell.cpp:469
#41 0x000077e8b823dec3 in nsAppStartup::Run (this=0x77e8b121e9c0) at /root/firefox/toolkit/components/startup/nsAppStartup.cpp:296
#42 0x000077e8b82ef1b9 in XREMain::XRE_mainRun (this=this@entry=0x7ffc34382300) at /root/firefox/toolkit/xre/nsAppRunner.cpp:5809
#43 0x000077e8b82ef8f7 in XREMain::XRE_main (this=this@entry=0x7ffc34382300, argc=argc@entry=7, argv=argv@entry=0x7ffc34383658, aConfig=...) at /root/firefox/toolkit/xre/nsAppRunner.cpp:6034
#44 0x000077e8b82efd78 in XRE_main (argc=7, argv=0x7ffc34383658, aConfig=...) at /root/firefox/toolkit/xre/nsAppRunner.cpp:6106
#45 0x000059863c2f2189 in do_main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at /root/firefox/browser/app/nsBrowserApp.cpp:233
#46 main (argc=7, argv=0x7ffc34383658, envp=<optimized out>) at /root/firefox/browser/app/nsBrowserApp.cpp:470

We could set this https://ffsearch.azurewebsites.net/#path=%2Fhome%2Fjoe%2Ffirefox%2Fwidget%2FnsBaseFilePicker.cpp&line=389