Skip to content

Why page crashes when do not calling Error catch? #3709

Description

@HassyMasa

Why page crashes when do not calling Error catch?
So do not call catch becomes a zombie process.
Does not display the console message of '2'
Removed how do I process is becoming a zombie?
Always crash at a specific site.

CENTOS7

$ node -v
v11.4.0

$ npm -v
6.5.0

puppeteer@1.11.0

Chromium r609904

(async () => {
  const browser = await puppeteer.launch(
  {
  ignoreHTTPSErrors: true,
  args :[
    '--ignore-certificate-errors',
    '--no-sandbox',
    '--disable-setuid-sandbox',
    '--disable-dev-shm-usage',
    '--lang=ja,en-US;q=0.9,en;q=0.8',
    '--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36',
    '--proxy-server=http://PROXYaddress:port'
  ]
  });
  const page = await browser.newPage();
  try {
    await page.goto(  RequestURL, { waitUntil : 'domcontentloaded' , timeout : 15000});
    let output = await page.evaluate( func );
    console.log(output );//---> 1
  }catch (error) {
    throw error;
  }finally{
    await page.close();
    await browser.close();
  }
})().catch((error) => {
  console.log(error);  //---> 2
});
(node:7329) UnhandledPromiseRejectionWarning: Error: Page crashed!
    at Page._onTargetCrashed (/usr/lib/node_modules/puppeteer/lib/Page.js:176:24)
    at CDPSession.Page.client.on.event (/usr/lib/node_modules/puppeteer/lib/Page.js:138:56)
    at CDPSession.emit (events.js:189:13)
    at CDPSession._onMessage (/usr/lib/node_modules/puppeteer/lib/Connection.js:216:12)
    at Connection._onMessage (/usr/lib/node_modules/puppeteer/lib/Connection.js:99:19)
    at WebSocketTransport._ws.addEventListener.event (/usr/lib/node_modules/puppeteer/lib/WebSocketTransport.js:41:24)
    at WebSocket.onMessage (/usr/lib/node_modules/puppeteer/node_modules/ws/lib/event-target.js:120:16)
    at WebSocket.emit (events.js:189:13)
    at Receiver.receiverOnMessage (/usr/lib/node_modules/puppeteer/node_modules/ws/lib/websocket.js:741:20)
    at Receiver.emit (events.js:189:13)
(node:7329) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7329) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

$ ps aux | grep [c]hrome

root      16746  0.0  1.1 718168 21244 ?        Ssl  09:25   0:00 /usr/lib/node_modules/puppeteer/.local-chromium/linux-609904/chrome-linux/chrome
 --disable-background-networking
 --disable-background-timer-throttling
 --disable-backgrounding-occluded-windows
 --disable-breakpad
 --disable-client-side-phishing-detection
 --disable-default-apps
 --disable-dev-shm-usage
 --disable-extensions
 --disable-features=site-per-process
 --disable-hang-monitor
 --disable-ipc-flooding-protection
 --disable-popup-blocking
 --disable-prompt-on-repost
 --disable-renderer-backgrounding
 --disable-sync
 --disable-translate
 --metrics-recording-only
 --no-first-run
 --safebrowsing-disable-auto-update
 --enable-automation
 --password-store=basic
 --use-mock-keychain
 --headless
 --hide-scrollbars
 --mute-audio about:blank
 --ignore-certificate-errors
 --no-sandbox
 --disable-setuid-sandbox
 --disable-dev-shm-usage
 --lang=ja,en-US;q=0.9,en;q=0.8
 --user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36
 --proxy-server=http://PROXYaddress:port
 --remote-debugging-port=0
 --user-data-dir=/tmp/puppeteer_dev_profile-OcVdPT
root      16785  0.0  0.0 527024  1756 ?        S    09:25   0:00 /usr/lib/node_modules/puppeteer/.local-chromium/linux-609904/chrome-linux/chrome
 --type=zygote
 --no-sandbox
 --headless
 --headless
 --user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36
root      16983  0.0  0.5 759720 10000 ?        Sl   09:25   0:00 /usr/lib/node_modules/puppeteer/.local-chromium/linux-609904/chrome-linux/chrome
 --type=renderer
 --no-sandbox
 --disable-background-timer-throttling
 --disable-breakpad
 --enable-automation
 --file-url-path-alias=/gen=/usr/lib/node_modules/puppeteer/.local-chromium/linux-609904/chrome-linux/gen
 --use-gl=swiftshader-webgl
 --field-trial-handle=14138967158728988808,3334881497019714078,131072
 --disable-features=site-per-process
 --disable-gpu-compositing
 --service-pipe-token=16889009643678838628
 --lang=en-US
 --headless
 --user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36 -
root      17021  0.0  0.1 574580  2672 ?        Sl   09:25   0:00 /usr/lib/node_modules/puppeteer/.local-chromium/linux-609904/chrome-linux/chrome
 --type=gpu-process
 --field-trial-handle=14138967158728988808,3334881497019714078,131072
 --disable-features=site-per-process
 --no-sandbox
 --disable-breakpad
 --headless
 --headless
 --user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36
 --gpu-preferences=KAAAAAAAAACAAACAAQAAAAAAAAAAAGAAAAAAAAAAAAAIAAAAAAAAAAgAAAAAAAAA
 --use-gl=swiftshader-webgl
 --override-use-software-gl-for-tests
 --service-request-channel-token=3899649192833338460

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions