bytenode/bytenode

stack_overflow using puppeteer

roachadam opened this issue · 6 comments

Error
image

Code Snippit
image

Steps to reproduce:

  1. Use puppeteer to launch browser and visit page as shown in code above.
  2. Compile files via bytenode
  3. Run code and observe overflow.

Environment:
Win10 x64
Node v14.15.5
"puppeteer": "^5.5.0",
"puppeteer-extra": "^3.1.17",
"puppeteer-extra-plugin-stealth": "^2.7.5", // I disabled this and error still occurs.
"puppeteer-extra-plugin-user-data-dir": "^2.2.11"

I did find some similar issues such as #57

I'll do some more digging with puppeteer to see if it is using the Function prototype anywhere, but I'm not sure yet if that's the case here.

Great project btw.

Can confirm it is occurring either on the goto function call, or the subsequent delay call
static delay = ms => new Promise(res => setTimeout(res, ms));

Check this comment.

Let me know if it solves your issue.

Check this comment.

Let me know if it solves your issue.

I had looked into that issue as well, but nowhere am I using the evaluate function. I look into a few of the puppeteer functions but I couldn't find any usage there either.

Further research indicating that this is happening on request interception. Trying to narrow it down if its from request continue/abort or that I'm handling the function asynchronously.

Ok, last update here I think. I assume this is related to the known asyncarrow function issue. Although in the docs it was only mentioned in the context of electron, which is not the case here.

This causes stack overflow:
image

This, however, functions properly.

image

The README file should be updated to reflect this issue.

Closing now as there is nothing that we can do to fix puppeteer (or electron too). It seems that the async arrow functions cause a crash whenever two contexts come into contact (node.js with electron, or node.js with puppeteer). This is definitely a C++ bug that most likely should be fixed in v8 itself.