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
63.85k stars 3.46k forks source link

[Bug]: no trace, video and screenshot in case of failed test (Target page, context or browser has been closed) #31358

Open svlobanov opened 2 weeks ago

svlobanov commented 2 weeks ago

Version

1.44.1

Steps to reproduce

This is a floating issue, I don't know how to reproduce

I have two issues:

  1. Sometimes test fails with an error 'Target page, context or browser has been closed'. Looks like, browser is crashed, but I'm not sure, how to debug it?
  2. If test is failed with this error, then there is no trace, video and screenshot. Is it normal?
[firefox] › test-1-smoke.spec.ts:22:1 › smoke-ip-signal ───────────────────────────────────────
    Error: locator.click: Target page, context or browser has been closed
    Browser logs:
    <launching> /ms-playwright/firefox-1449/firefox/firefox -no-remote -headless -profile /tmp/playwright_firefoxdev_profile-XXXXXXKsSq[84](https://gitlab.xxx/vision_ott/qa/e2e/-/jobs/386796#L84) -juggler-pipe -silent
    <launched> pid=119
    [pid=119][err] *** You are running in headless mode.
    [pid=119][err] JavaScript warning: resource://services-settings/Utils.sys.mjs, line 114: unreachable code after return statement
    [pid=119][out] console.warn: services.settings: Ignoring preference override of remote settings server
    [pid=119][out] console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
    [pid=119][out] Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libpci missing (t=0.257459) [GFX1-]: glxtest: libpci missing
    [pid=119][out] Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libpci missing (t=0.257459) |[1][GFX1-]: glxtest: Unable to open a connection to the X server (t=0.257459) [GFX1-]: glxtest: Unable to open a connection to the X server
    [pid=119][out] Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libpci missing (t=0.257459) |[1][GFX1-]: glxtest: Unable to open a connection to the X server (t=0.257459) |[2][GFX1-]: No GPUs detected via PCI
    [pid=119][out]  (t=0.257459) [GFX1-]: No GPUs detected via PCI
    [pid=119][out] 
    [pid=119][out] console.error: ({})
    [pid=119][out] 
    [pid=119][out] Juggler listening to the pipe
    [pid=119][out] console.error: ({})
    [pid=119][out] console.error: SearchEngineSelector: "Received empty search configuration!"
    [pid=119][out] console.error: SearchEngineSelector: "Received empty search configuration!"
    [pid=119][out] console.error: SearchService: "#init: failure initializing search:" ({})
    [pid=119][out] console.error: WebExtensions: 
    [pid=119][out]   Message: [Exception... "Failed to get engine data from Remote Settings"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: resource://gre/modules/SearchEngineSelectorOld.sys.mjs :: getEngineConfiguration :: line 118"  data: no]
    [pid=119][out]   Stack:
    [pid=119][out]     getEngineConfiguration@resource://gre/modules/SearchEngineSelectorOld.sys.mjs:118:24
    [pid=119][out] 
    [pid=119][err] JavaScript error: resource://gre/modules/SearchEngineSelectorOld.sys.mjs, line 118: NS_ERROR_UNEXPECTED: Failed to get engine data from Remote Settings
    [pid=119][err] JavaScript error: resource://gre/modules/SearchEngineSelectorOld.sys.mjs, line 118: NS_ERROR_UNEXPECTED: Failed to get engine data from Remote Settings
    [pid=119][err] JavaScript error: resource://gre/modules/SearchEngineSelectorOld.sys.mjs, line 118: NS_ERROR_UNEXPECTED: Failed to get engine data from Remote Settings
    [pid=119][out] console.error: SearchSettings: "_write: Could not write to settings file:" (new Error("cannot write without any engine.", "resource://gre/modules/SearchSettings.sys.mjs", 277))
    [pid=119][out] console.error: "Received empty top sites configuration!"
    [pid=119][err] JavaScript error: resource://gre/modules/SearchEngineSelectorOld.sys.mjs, line 118: NS_ERROR_UNEXPECTED: Failed to get engine data from Remote Settings
    [pid=119][out] console.error: "Received empty top sites configuration!"
    [pid=119][out] console.error: (new TypeError("linkMap is undefined", "resource://gre/modules/NewTabUtils.sys.mjs", 2003))
    [pid=119][out] console.error: URLBar - Provider.UrlbarProviderSearchTips: ({})
    [pid=119][err] JavaScript error: resource://gre/modules/SearchEngineSelectorOld.sys.mjs, line 118: NS_ERROR_UNEXPECTED: Failed to get engine data from Remote Settings
    [pid=119][err] JavaScript warning: resource://gre/modules/UpdateService.sys.mjs, line 3[85](https://gitlab.xxx/vision_ott/qa/e2e/-/jobs/386796#L85)7: unreachable code after return statement
    [pid=119][out] console.error: URLBar - Provider.UrlbarProviderSearchTips: ({})
    [pid=119][err] Exiting due to channel error.
    [pid=119][err] Exiting due to channel error.
    Call log:
      - waiting for locator('id=video-live').locator('..').locator('span')
        at /builds/vision_ott/qa/e2e/[pid=119][out]     getEngineConfiguration@resource:/gre/modules/SearchEngineSelectorOld.sys.mjs:118:24
        at /builds/vision_ott/qa/e2e/tests/test-1-smoke.spec.ts:59:71
    Error: locator.click: Target page, context or browser has been closed
       at fixtures/signal-set.ts:90
      88 |         console.log("signalSet fixture cleanup");
      89 |         //Delete the signal
    > 90 |         await page.locator("id=Configuration").click();
         |                                                ^
      91 |         await expect(page).toHaveURL(/configuration/);
      92 |         await fillSearch(page, signalName);
      93 |         await expect(page.locator(".configurations-column-settings")).toHaveCount(2); // 1st is a header and the signal
        at Object.signalSet (/builds/vision_ott/qa/e2e/tests/fixtures/signal-set.ts:90:48)
    Error: Target page, context or browser has been closed
    Error: ENOENT: no such file or directory, open '/builds/vision_ott/qa/e2e/test-results/.playwright-artifacts-0/4d84c7f257cbb5ff[86](https://gitlab.xxx/vision_ott/qa/e2e/-/jobs/386796#L86)3414c6b211d1c7.zip'

Expected behavior

Trace, video and screenshot are present in case of failed test.

Actual behavior

No trace, no video, no screenshot.

sergey@Sergeys-MacBook-Air pwr4 % ls -laR test-results 
total 32
drwxr-xr-x  5 sergey  staff   160 Jun 18 01:00 .
drwxr-xr-x  4 sergey  staff   128 Jun 18 11:40 ..
-rw-r--r--  1 sergey  staff    96 Jun 18 01:00 .last-run.json
drwxr-xr-x  2 sergey  staff    64 Jun 18 00:57 test-1-smoke-smoke-ip-signal-firefox
-rw-r--r--  1 sergey  staff  9489 Jun 18 01:00 test-results.xml

test-results/test-1-smoke-smoke-ip-signal-firefox:
total 0
drwxr-xr-x  2 sergey  staff   64 Jun 18 00:57 .
drwxr-xr-x  5 sergey  staff  160 Jun 18 01:00 ..
sergey@Sergeys-MacBook-Air pwr4 % ls -laR playwright-report 
total 880
drwxr-xr-x  3 sergey  staff      96 Jun 18 01:00 .
drwxr-xr-x  4 sergey  staff     128 Jun 18 11:40 ..
-rw-rw-r--  1 sergey  staff  450142 Jun 18 01:00 index.html

Additional context

I run tests under gitlab CI, using official docker image mcr.microsoft.com/playwright:v1.44.1-jammy

playwright config:

const { defineConfig, devices } = require('@playwright/test');
module.exports = defineConfig({
    testDir: './tests',
    fullyParallel: true,
    forbidOnly: !!process.env.CI,
    retries: 0,
    workers: process.env.CI ? 1 : undefined,

    reporter: [
        ['list'],
        ['html'],
        ['junit', { outputFile: "test-results/test-results.xml", includeProjectInTestName: true }],
    ],

    use: {
        trace: 'retain-on-first-failure',
        screenshot: 'only-on-failure',
        video: {
            mode: 'retain-on-failure',
            size: { width: 1280, height: 720 }
        },
    },

    projects: [
        {
            name: 'firefox',
            use: { ...devices['Desktop Firefox'] },
        },
        {
            name: 'Google Chrome',
            use: { ...devices['Desktop Chrome'], channel: 'chrome' },
        },
    ],
});

Environment

System:
    OS: Linux 5.4 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (4) x64 Common KVM processor
    Memory: 4.42 GB / 7.77 GB
    Container: Yes
  Binaries:
    Node: 20.13.1 - /usr/bin/node
    Yarn: 1.22.22 - /usr/bin/yarn
    npm: 10.5.2 - /usr/bin/npm
  Languages:
    Bash: 5.1.16 - /usr/bin/bash
  npmPackages:
    @playwright/test: ^1.44.1 => 1.44.1
dgozman commented 2 weeks ago

@svlobanov This is unexpected. However, we cannot fix the problem without a reproduction, unfortunately. Could you please share a repro?

svlobanov commented 2 weeks ago

It happens from time to time (~ 1 of 20 runs), I don't know how to reproduce it exactly. I can share playwright project, but not sure if it helps without the tested system. The tested system is not published to the Internet that's why I'm thinking sharing playwright project will not help. Maybe it's possible to increase log level, make some dumps, etc?

dgozman commented 2 weeks ago

@svlobanov You can try running with DEBUG=pw:test,pw:api npx playwright test, maybe we'll see something interesting in the logs. However, most likely we'll have to debug the issue, and for that we need a reproduction.

OrRosenblatt commented 2 weeks ago

I experience the same issue with playwright v1.43.1 in watch mode - when running playwright test --ui, there's no trace, video and screenshot if the test fail. It looks like there are no artifacts in test-results.

Configuration:

System:
  OS: macOS 14.5
  CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Memory: 1.67 GB / 32.00 GB
Binaries:
  Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
  npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
  pnpm: 9.1.2 - ~/.nvm/versions/node/v20.11.1/bin/pnpm
IDEs:
  VSCode: 1.90.1 - /usr/local/bin/code
Languages:
  Bash: 3.2.57 - /bin/bash
npmPackages:
  @playwright/test: ^1.43.1 => 1.44.0 
svlobanov commented 2 weeks ago

@OrRosenblatt can you reproduce it with 100% reproducibility?

OrRosenblatt commented 2 weeks ago

@OrRosenblatt can you reproduce it with 100% reproducibility?

Unfortunately not :(

I do see correlation with the following error:

    Tearing down "context" exceeded the test timeout of 30000ms.

    Error: Test ended.

    Error: ENOENT: no such file or directory, open '/Users/or.rosenblatt/code/[private-repo-name]/apps/[app-name]/test-results/.playwright-artifacts-4/b73a922a95ebe94b4fa339861b881063.zip'
OrRosenblatt commented 2 weeks ago

I don't know if it helps or not, but when running pnpm exec playwright show-report, the following error message is shown:

svlobanov commented 2 weeks ago

@dgozman after enabling browser debug, I can see in the log that browser is killed by SIGSEGV signal (crashed?)

  pw:channel SEND> {"id":15,"guid":"frame@3ea0f1a86e9d946c09ed5d82f7b942c9","method":"fill","params":{"selector":"id=login","strict":true,"value":"SuperAdmin"}} +2ms
  pw:channel SEND> {"id":16,"guid":"localUtils","method":"addStackToTracingNoReply","params":{"callData":{"id":15,"stack":[{"file":"/builds/vision_ott/qa/e2e/tests/utils/login.ts","line":13,"column":36,"function":"login"},{"file":"/builds/vision_ott/qa/e2e/tests/test-1-smoke.spec.ts","line":18,"column":5}]}}} +0ms
  pw:channel <RECV {"id":16} +1ms
  pw:browser [pid=170][err] Exiting due to channel error. +2s
  pw:browser [pid=170][err] Exiting due to channel error. +0ms
  pw:channel <EVENT {"guid":"page@1fd7d62db781013246bb964baabda681","method":"close"} +273ms
  pw:channel <EVENT {"guid":"page@1fd7d62db781013246bb964baabda681","method":"__dispose__","params":{}} +0ms
  pw:channel <EVENT {"guid":"browser-context@cd47dfc221cd387b61cea42bb3c4d396","method":"close"} +0ms
  pw:channel <EVENT {"guid":"browser-context@cd47dfc221cd387b61cea42bb3c4d396","method":"__dispose__","params":{}} +0ms
  pw:channel <EVENT {"guid":"browser@5430daa7af55e4ae1a3738bd0f68d798","method":"close"} +0ms
  pw:channel <EVENT {"guid":"browser@5430daa7af55e4ae1a3738bd0f68d798","method":"__dispose__","params":{}} +1ms
  pw:channel <RECV {"id":15} +0ms
  pw:channel SEND> {"id":17,"guid":"frame@3ea0f1a86e9d946c09ed5d82f7b942c9","method":"fill","params":{"selector":"id=password","strict":true,"value":"password"}} +1ms
  pw:channel <RECV {"id":17,"error":{"error":{"message":"Target page, context or browser has been closed","stack":"TargetClosedError: Target page, context or browser has been closed\n    at DispatcherConnection.dispatch (/builds/vision_ott/qa/e2e/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js:273:44)\n    at Immediate._onImmediate (/builds/vision_ott/qa/e2e/node_modules/playwright-core/lib/inProcessFactory.js:50:83)\n    at processImmediate (node:internal/timers:478:21)\n    at process.callbackTrampoline (node:internal/async_hooks:130:17)","name":"TargetClosedError"}}} +1ms
  pw:test finished stage "run function" +4s
  pw:test finished stage "beforeEach hook" +1ms
  pw:test finished stage "Before Hooks" +0ms
  pw:test finished stage "setup and test" +0ms
  pw:test started stage "After Hooks" +0ms
  pw:test started stage "on-test-function-finish" +0ms
  pw:test finished stage "on-test-function-finish" +1ms
  pw:test started stage "fixture: page" +0ms
  pw:test finished stage "fixture: page" +1ms
  pw:test started stage "fixture: context" +0ms
  pw:test finished stage "fixture: context" +0ms
  pw:test started stage "fixture: _contextFactory" +0ms
  pw:channel SEND> {"id":18,"guid":"tracing@906e0b17b364cd6cf3124901ba8fcda2","method":"tracingStopChunk","params":{"mode":"entries"}} +5ms
  pw:browser [pid=170] <process did exit: exitCode=null, signal=SIGSEGV> +9ms
  pw:browser [pid=170] starting temporary directories cleanup +0ms
  pw:channel <RECV {"id":18,"error":{"error":{"message":"Target page, context or browser has been closed","stack":"TargetClosedError: Target page, context or browser has been closed\n    at DispatcherConnection.dispatch (/builds/vision_ott/qa/e2e/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js:273:44)\n    at Immediate._onImmediate (/builds/vision_ott/qa/e2e/node_modules/playwright-core/lib/inProcessFactory.js:50:83)\n    at processImmediate (node:internal/timers:478:21)\n    at process.callbackTrampoline (node:internal/async_hooks:130:17)","name":"TargetClosedError"}}} +2ms
  pw:test finished stage "fixture: _contextFactory" +4ms
  pw:test started stage "fixture: _setupArtifacts" +0ms
  pw:test finished stage "fixture: _setupArtifacts" +0ms
  pw:test started stage "fixture: _setupContextOptions" +0ms
  pw:test finished stage "fixture: _setupContextOptions" +0ms
  pw:test started stage "fixture: testIdAttribute" +0ms
  pw:test finished stage "fixture: testIdAttribute" +0ms
  pw:test started stage "fixture: navigationTimeout" +0ms
  pw:test finished stage "fixture: navigationTimeout" +0ms
  pw:test started stage "fixture: actionTimeout" +0ms
  pw:test finished stage "fixture: actionTimeout" +1ms
  pw:test started stage "fixture: _combinedContextOptions" +0ms
  pw:test finished stage "fixture: _combinedContextOptions" +0ms
  pw:test started stage "fixture: serviceWorkers" +0ms
  pw:test finished stage "fixture: serviceWorkers" +0ms
  pw:test started stage "fixture: baseURL" +0ms
  pw:test finished stage "fixture: baseURL" +0ms
  pw:test started stage "fixture: userAgent" +0ms
  pw:test finished stage "fixture: userAgent" +0ms
  pw:test started stage "fixture: timezoneId" +0ms
  pw:test finished stage "fixture: timezoneId" +0ms
  pw:test started stage "fixture: viewport" +0ms
  pw:test finished stage "fixture: viewport" +0ms
  pw:test started stage "fixture: storageState" +0ms
  pw:test finished stage "fixture: storageState" +0ms
  pw:test started stage "fixture: proxy" +0ms
  pw:test finished stage "fixture: proxy" +0ms
  pw:test started stage "fixture: permissions" +0ms
  pw:test finished stage "fixture: permissions" +0ms
  pw:test started stage "fixture: offline" +1ms
  pw:test finished stage "fixture: offline" +0ms
  pw:test started stage "fixture: locale" +0ms
  pw:test finished stage "fixture: locale" +0ms
  pw:test started stage "fixture: javaScriptEnabled" +0ms
  pw:test finished stage "fixture: javaScriptEnabled" +0ms
  pw:test started stage "fixture: isMobile" +0ms
  pw:test finished stage "fixture: isMobile" +0ms
  pw:test started stage "fixture: ignoreHTTPSErrors" +0ms
  pw:test finished stage "fixture: ignoreHTTPSErrors" +0ms
  pw:test started stage "fixture: httpCredentials" +0ms
  pw:test finished stage "fixture: httpCredentials" +0ms
  pw:test started stage "fixture: geolocation" +0ms
  pw:test finished stage "fixture: geolocation" +0ms
  pw:test started stage "fixture: hasTouch" +0ms
  pw:test finished stage "fixture: hasTouch" +1ms
  pw:test started stage "fixture: extraHTTPHeaders" +0ms
  pw:test finished stage "fixture: extraHTTPHeaders" +0ms
  pw:test started stage "fixture: deviceScaleFactor" +0ms
  pw:test finished stage "fixture: deviceScaleFactor" +0ms
  pw:test started stage "fixture: colorScheme" +0ms
  pw:test finished stage "fixture: colorScheme" +0ms
  pw:test started stage "fixture: bypassCSP" +0ms
  pw:test finished stage "fixture: bypassCSP" +0ms
  pw:test started stage "fixture: acceptDownloads" +0ms
  pw:test finished stage "fixture: acceptDownloads" +0ms
  pw:test started stage "fixture: contextOptions" +0ms
  pw:test finished stage "fixture: contextOptions" +0ms
  pw:test finished stage "After Hooks" +1ms
  pw:test started stage "Worker Cleanup" +0ms
  pw:test started stage "fixture: browser" +0ms
  pw:channel SEND> {"id":19,"guid":"browser@5430daa7af55e4ae1a3738bd0f68d798","method":"close","params":{"reason":"Test ended."}} +6ms
  pw:channel <RECV {"id":19,"error":{"error":{"message":"Target page, context or browser has been closed","stack":"TargetClosedError: Target page, context or browser has been closed\n    at DispatcherConnection.dispatch (/builds/vision_ott/qa/e2e/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js:273:44)\n    at Immediate._onImmediate (/builds/vision_ott/qa/e2e/node_modules/playwright-core/lib/inProcessFactory.js:50:83)\n    at processImmediate (node:internal/timers:478:21)\n    at process.callbackTrampoline (node:internal/async_hooks:130:17)","name":"TargetClosedError"}}} +1ms
  pw:test finished stage "fixture: browser" +3ms
  pw:test started stage "fixture: _reuseContext" +0ms
  pw:test finished stage "fixture: _reuseContext" +0ms
  pw:test started stage "fixture: _optionContextReuseMode" +0ms
  pw:test finished stage "fixture: _optionContextReuseMode" +1ms
  pw:test started stage "fixture: video" +0ms
  pw:test finished stage "fixture: video" +0ms
  pw:test started stage "fixture: connectOptions" +0ms
  pw:test finished stage "fixture: connectOptions" +0ms
  pw:test started stage "fixture: _optionConnectOptions" +0ms
  pw:test finished stage "fixture: _optionConnectOptions" +0ms
  pw:test started stage "fixture: browserName" +0ms
  pw:test finished stage "fixture: browserName" +0ms
  pw:test started stage "fixture: defaultBrowserType" +0ms
  pw:test finished stage "fixture: defaultBrowserType" +0ms
  pw:test started stage "fixture: screenshot" +0ms
  pw:test finished stage "fixture: screenshot" +0ms
  pw:test started stage "fixture: _browserOptions" +0ms
  pw:test finished stage "fixture: _browserOptions" +0ms
  pw:test started stage "fixture: channel" +1ms
  pw:test finished stage "fixture: channel" +0ms
  pw:test started stage "fixture: headless" +0ms
  pw:test finished stage "fixture: headless" +0ms
  pw:test started stage "fixture: launchOptions" +0ms
  pw:test finished stage "fixture: launchOptions" +0ms
  pw:test started stage "fixture: playwright" +0ms
  pw:test finished stage "fixture: playwright" +0ms
  pw:test finished stage "Worker Cleanup" +0ms
  pw:test started stage "stop tracing" +0ms
  pw:browser [pid=170] finished temporary directories cleanup +49ms
  pw:test finished stage "stop tracing" +44ms

  1) [firefox] › test-1-smoke.spec.ts:22:1 › smoke-ip-signal ───────────────────────────────────────

    Error: locator.fill: Target page, context or browser has been closed

       at utils/login.ts:14

      12 |     // On login page we have to use ids due to language is unknown
      13 |     await page.locator("id=login").fill(login);
    > 14 |     await page.locator("id=password").fill(password);
         |                                       ^
      15 |     await page.locator("id=password").press("Enter");
      16 |     await expect(page).toHaveURL(/probes/);
      17 |

        at login (/builds/vision_ott/qa/e2e/tests/utils/login.ts:14:39)
        at /builds/vision_ott/qa/e2e/tests/test-1-smoke.spec.ts:18:5

    Error: Target page, context or browser has been closed

    Error: ENOENT: no such file or directory, open '/builds/vision_ott/qa/e2e/test-results/.playwright-artifacts-0/5a7b0e39a5c5b8ccc77086dfe00a9fa0.zip'
dgozman commented 2 weeks ago

@svlobanov Yes, this looks like the browser has crashed. I'd recommend running with DEBUG=pw:browser - perhaps we can gather some information and file an upstream issue.

svlobanov commented 2 weeks ago

@dgozman @OrRosenblatt I found how to reproduce the issue regarding to trace & video loss

git clone https://github.com/svlobanov/playwright-bug-31358
cd playwright-bug-31358
npm ci
npx playwright test
# wait for 5 sec
# from another terminal, run `killall -9 Chromium` (maybe `killall -9 chromium` on linux, I use macos 14.1 arm64 locally)

after chromium is killed, playwright stops but trace and video are not present

svlobanov commented 2 weeks ago

@svlobanov Yes, this looks like the browser has crashed. I'd recommend running with DEBUG=pw:browser - perhaps we can gather some information and file an upstream issue.

I have already enabled DEBUG=pw:browser, no more logs than I already provided, I will check how to extract crash-related logs/dumps from docker

dgozman commented 2 weeks ago

after chromium is killed, playwright stops but trace and video are not present

@svlobanov Thank you for the repro. This is the expected behavior. Playwright assumes that browser crash is an exceptional situation and does not guarantee trace, video or screenshot.

We'd really like to fix the crash though, so any help with getting a repro and/or stack trace of the crash would be great!

svlobanov commented 2 weeks ago

@dgozman finally, I have coredump for crashed firefox, but it's hard to say anything without debug symbols

I use mcr.microsoft.com/playwright/v1.44.1-jammy to run tests and collect core dumps

I can share coredump with you privately if you provide me instructions how to do it.

root@13ab4bd56442:/# gdb /ms-playwright/firefox-1449/firefox/firefox /vol/core
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1
...
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
--Type <RET> for more, q to quit, c to continue without paging--
Core was generated by `/ms-playwright/firefox-1449/firefox/firefox -no-remote -headless -profile /tmp/'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __pthread_kill_implementation (no_tid=0, signo=11, threadid=140650504496704) at ./nptl/pthread_kill.c:44
44  ./nptl/pthread_kill.c: No such file or directory.
[Current thread is 1 (Thread 0x7febbf5ba640 (LWP 213))]
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=11, threadid=140650504496704) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=11, threadid=140650504496704) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140650504496704, signo=signo@entry=11) at ./nptl/pthread_kill.c:89
#3  0x00007febd5544476 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
#4  0x00007febcf9e1811 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
#5  0x00007febd043c97b in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
#6  <signal handler called>
#7  0x00007febcf2c7987 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
#8  0x00007febcf222ba0 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
#9  0x00007febcf24a038 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
#10 0x00007febcc5fd42d in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
#11 0x00007febcfa2b26d in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
#12 0x00007febce86c194 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
#13 0x00007febce86bed0 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
#14 0x00007febce86e714 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
#15 0x00007febcbc88b26 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
#16 0x00007febcbc9578b in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
#17 0x00007febcbc94d5c in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
#18 0x00007febcbc9d1a4 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
#19 0x00007febcbca09fa in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
#20 0x00007febcc332627 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
#21 0x00007febcc2e5357 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
#22 0x00007febcbc9ac62 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
#23 0x00007febd54f4ea6 in ?? () from /ms-playwright/firefox-1449/firefox/libnspr4.so
#24 0x00007febd5596ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#25 0x00007febd5628850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
(gdb) bt full
#0  __pthread_kill_implementation (no_tid=0, signo=11, threadid=140650504496704) at ./nptl/pthread_kill.c:44
        tid = <optimized out>
        ret = 0
        pd = 0x7febbf5ba640
        old_mask = {__val = {140650816776844, 140650815707584, 140650872821512, 140650175528960, 140650175897600, 90, 32768, 8, 8, 
            94735885058853, 1, 32768, 140650870734848, 2160, 11, 32768}}
        ret = <optimized out>
        pd = <optimized out>
        old_mask = <optimized out>
        ret = <optimized out>
        tid = <optimized out>
        ret = <optimized out>
        resultvar = <optimized out>
        resultvar = <optimized out>
        __arg3 = <optimized out>
        __arg2 = <optimized out>
        __arg1 = <optimized out>
        _a3 = <optimized out>
        _a2 = <optimized out>
        _a1 = <optimized out>
        __futex = <optimized out>
        resultvar = <optimized out>
        __arg3 = <optimized out>
        __arg2 = <optimized out>
        __arg1 = <optimized out>
        _a3 = <optimized out>
        _a2 = <optimized out>
        _a1 = <optimized out>
        __futex = <optimized out>
        __private = <optimized out>
        __oldval = <optimized out>
        result = <optimized out>
#1  __pthread_kill_internal (signo=11, threadid=140650504496704) at ./nptl/pthread_kill.c:78
No locals.
#2  __GI___pthread_kill (threadid=140650504496704, signo=signo@entry=11) at ./nptl/pthread_kill.c:89
No locals.
#3  0x00007febd5544476 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
        ret = <optimized out>
#4  0x00007febcf9e1811 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
--Type <RET> for more, q to quit, c to continue without paging--
No symbol table info available.
#5  0x00007febd043c97b in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
No symbol table info available.
#6  <signal handler called>
No locals.
#7  0x00007febcf2c7987 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
No symbol table info available.
#8  0x00007febcf222ba0 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
No symbol table info available.
#9  0x00007febcf24a038 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
No symbol table info available.
#10 0x00007febcc5fd42d in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
No symbol table info available.
#11 0x00007febcfa2b26d in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
No symbol table info available.
#12 0x00007febce86c194 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
No symbol table info available.
#13 0x00007febce86bed0 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
No symbol table info available.
#14 0x00007febce86e714 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
No symbol table info available.
#15 0x00007febcbc88b26 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
No symbol table info available.
#16 0x00007febcbc9578b in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
No symbol table info available.
#17 0x00007febcbc94d5c in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
No symbol table info available.
#18 0x00007febcbc9d1a4 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
No symbol table info available.
#19 0x00007febcbca09fa in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
No symbol table info available.
#20 0x00007febcc332627 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
No symbol table info available.
#21 0x00007febcc2e5357 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
No symbol table info available.
#22 0x00007febcbc9ac62 in ?? () from /ms-playwright/firefox-1449/firefox/libxul.so
No symbol table info available.
#23 0x00007febd54f4ea6 in ?? () from /ms-playwright/firefox-1449/firefox/libnspr4.so
No symbol table info available.
--Type <RET> for more, q to quit, c to continue without paging--
#24 0x00007febd5596ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
        ret = <optimized out>
        pd = <optimized out>
        out = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140733612146528, 5363107476043250929, 140650504496704, 22, 140650873448400, 
                140733612146880, -5351706398393844495, -5351895493678023439}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, 
            data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#25 0x00007febd5628850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
No locals.
(gdb) 
svlobanov commented 1 week ago

Update: this issue happens only in firefox. I use Google Chrome and firefox because I need h264 video-codec support. In Google Chrome everything works fine. After I disabled firefox in the configuration, I don't see crashes.

If there is no debug symbols for playwright-firefox and no ideas how to debug this floating issue, then let's close the issue.

dgozman commented 1 week ago

@svlobanov Thank you for the core dump. Unfortunately, we do not have a symbolized firefox build right now, but we might be able to symbolize it later.

That said, we decided to try and collect traces for situations like a browser crash, so I'll assign this to the next release and we'll see what we can do.

svlobanov commented 1 week ago

great, I can try version from git when it's committed

IgnusG commented 1 week ago

I've had a similar issue happen to me while setup up playwright in a new project. When running npx playwright test --ui --headed the traces appear correctly as the test runs but after it fails the screenshots disappear (along with all information in the timeline). Additionally some commands seem to be missing and instead show a previous step in the trace 🤔

Downgrading to 1.44 resolved the issue for me.

Here's how it looks like in 1.44:

Untitled



And here's 1.45:

Untitled