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

[Bug]: An Error Occurred on the Page Due to Code Execution #12439

Open
2 tasks
alpgul opened this issue May 14, 2024 · 7 comments
Open
2 tasks

[Bug]: An Error Occurred on the Page Due to Code Execution #12439

alpgul opened this issue May 14, 2024 · 7 comments

Comments

@alpgul
Copy link

alpgul commented May 14, 2024

Minimal, reproducible example

const puppeteer = require("puppeteer-core");
const localExecutablePath = "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
async function main() {
  const browser = await puppeteer.launch({
    //ignoreDefaultArgs: ["--enable-automation"],
    args: [],
    executablePath: localExecutablePath,
    headless: false
  });
  console.log("Browser is created.");
  const pages = await browser.pages();
  const page = pages[0];
  page.on('popup', async (popup) => {
    console.log(await popup.url());
    await popup.close();
  });
}
main();

Error string

Crash Page: STATUS_ACCESS_VIOLATION

Bug behavior

  • Flaky
  • PDF

Background

Chrome: windows x64 124.0.6367.201

 const f = document.createElement("iframe");
                f.src = "data:text/html;charset=utf-8,<p></p>",
                document.body.appendChild(f),
                console.log("fire"),
                f.contentWindow.open("", "", "top=9999,left=9999,width=100,height=100")

When the above code is running, it causes a crash on the page.

Expectation

It was supposed to write the popup address to the console and then close it.

Reality

Unfortunately, crashes occurred on both the page and the popup, and the popup listener did not function as intended.

Puppeteer configuration file (if used)

No response

Puppeteer version

22.8.1

Node version

v21.7.1

Package manager

npm

Package manager version

10.6.0

Operating system

Windows

@alpgul alpgul added the bug label May 14, 2024
Copy link

github-actions bot commented May 14, 2024

This issue was not reproducible. Please check that your example runs locally and the following:

  • Ensure the script does not rely on dependencies outside of puppeteer and puppeteer-core.
  • Ensure the error string is just the error message.
    • Bad:

      Error: something went wrong
        at Object.<anonymous> (/Users/username/repository/script.js:2:1)
        at Module._compile (node:internal/modules/cjs/loader:1159:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
        at Module.load (node:internal/modules/cjs/loader:1037:32)
        at Module._load (node:internal/modules/cjs/loader:878:12)
        at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
        at node:internal/main/run_main_module:23:47
    • Good: Error: something went wrong.

  • Ensure your configuration file (if applicable) is valid.
  • If the issue is flaky (does not reproduce all the time), make sure 'Flaky' is checked.
  • If the issue is not expected to error, make sure to write 'no error'.

Once the above checks are satisfied, please edit your issue with the changes and we will
try to reproduce the bug again.


Analyzer run

@github-actions github-actions bot removed the invalid label May 14, 2024
@alpgul alpgul changed the title [Bug]: [Bug]: An Error Occurred on the Page Due to Code Execution May 14, 2024
@OrKoN
Copy link
Collaborator

OrKoN commented May 14, 2024

could you obtain the crash id from chrome://crashes (you might need to re-user the userDataDir for that)?

@OrKoN
Copy link
Collaborator

OrKoN commented May 14, 2024

Is it reproducible with the bundled Chrome for Testing version?

@OrKoN
Copy link
Collaborator

OrKoN commented May 14, 2024

Able to reproduce with stable and canary versions.

@alpgul
Copy link
Author

alpgul commented May 14, 2024

Chrome: crash id:b180583f32e07283
I tried "Google Chrome for Testing" and got the same error.

@OrKoN
Copy link
Collaborator

OrKoN commented May 14, 2024

const puppeteer = require("puppeteer");

async function main() {
  const browser = await puppeteer.launch({
    headless: false
  });
  console.log("Browser is created.");
  const pages = await browser.pages();
  const page = pages[0];
  page.on('popup', async (popup) => {
    console.log(popup.url());
    await popup.close();
  });
  await page.evaluate(() => {
    const f = document.createElement("iframe");
    f.src = "data:text/html;charset=utf-8,<p></p>",
    document.body.appendChild(f),
    console.log("fire"),
    f.contentWindow.open("", "", "top=9999,left=9999,width=100,height=100")
  });
}

main();

one-script repro

@OrKoN OrKoN added the upstream label May 14, 2024
@OrKoN
Copy link
Collaborator

OrKoN commented May 15, 2024

Filed https://crbug.com/340836884

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants