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

Tracing certain system polyfills can lead to infinite loops or incorrect results (e.g. process.cwd) #611

Open
1 of 2 tasks
Domiii opened this issue Nov 23, 2021 · 0 comments
Assignees

Comments

@Domiii
Copy link
Owner

Domiii commented Nov 23, 2021

Problem: graceful-js/polyfills.js patches process.pwd(), but pwd is called internally by node in several different situations. As a result, code gets traced while runtime is doing its own thing.

  • Ideal solution: don't trace any code while @dbux/runtime code is running.
    • NOTE: only guarding read access is helpful but not sufficient.
    • One of the bugs we had was related to Node@14 executing an instrumented polyfill every time a stacktrace was generated.
  • hackfix: always disable tracing of graceful-js (for now)
    • Another possible hackfix: disable tracing of process.cwd somehow
    • wrap with tracesDisabled via CallbackPatcher

Related

@Domiii Domiii self-assigned this Nov 23, 2021
@Domiii Domiii changed the title Tracing certain system polyfills can lead to infinite loops (e.g. process.cwd) Tracing certain system polyfills can lead to infinite loops or incorrect results (e.g. process.cwd) Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant