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

compatibility: setting Error.prepareStackTrace results in an error #251

Closed
kumavis opened this issue Mar 28, 2020 · 5 comments
Closed

compatibility: setting Error.prepareStackTrace results in an error #251

kumavis opened this issue Mar 28, 2020 · 5 comments
Assignees
Labels
confinement Pertaining to confinement of guest programs. debugging support taming compat zoe-alpha-release Goal for Zoe alpha

Comments

@kumavis
Copy link
Member

kumavis commented Mar 28, 2020

the popular express (15.5m/week)
has a dependency depd (16m/week) used for creating deprecation messages.
depd uses some weird voodoo to get v8's object version of the stack by temporarily overriding Error.prepareStackTrace.

There is discussion of making setting this field to fail silently, instead of loudly. depd's implementation will not work gracefully under a silent failure of setting .

@erights erights self-assigned this Mar 28, 2020
@erights erights added debugging support confinement Pertaining to confinement of guest programs. labels Apr 19, 2020
@warner
Copy link
Contributor

warner commented May 29, 2020

I'm running into this now too, as cosmic-swingset uses express. This pattern has appeared in a couple of libraries so far:

@kumavis
Copy link
Member Author

kumavis commented May 29, 2020

also seeing it a lot around tooling for loading native modules, like bindings and node-gyp-build

here's some of my manual workarounds, using patch-package

@warner
Copy link
Contributor

warner commented Jun 18, 2020

The most immediate consequence of this for me is that tape tests, when they fail, cannot tell me which assertion failed: it wants to use this Error fiddling to build a stack trace to the assertion, and instead I get a stack trace to the internal code where the Error fiddling failed. I can work around it by making sure my unit tests always pass (which means doing a lot of console.logs).

@kriskowal kriskowal self-assigned this Jun 18, 2020
warner added a commit to Agoric/agoric-sdk that referenced this issue Jun 19, 2020
We should remove this once endojs/endo#251 (Error.prepareStackTrace) is
fixed.
warner added a commit to Agoric/agoric-sdk that referenced this issue Jun 21, 2020
We should remove this once endojs/endo#251 (Error.prepareStackTrace) is
fixed.
warner added a commit to Agoric/agoric-sdk that referenced this issue Jun 21, 2020
We should remove this once endojs/endo#251 (Error.prepareStackTrace) is
fixed.
warner added a commit to Agoric/agoric-sdk that referenced this issue Jun 21, 2020
We should remove this once endojs/endo#251 (Error.prepareStackTrace) is
fixed.
warner added a commit to Agoric/agoric-sdk that referenced this issue Jun 22, 2020
We should remove this once endojs/endo#251 (Error.prepareStackTrace) is
fixed.
warner added a commit to Agoric/agoric-sdk that referenced this issue Jun 23, 2020
Some packages try to modify properties that SES freezes, like
`Error.prepareStackTrace`. These packages cannot be imported in a SES
environment. Work is underway to tolerate these (endojs/endo#251).

`depd` is one such package. As a temporary workaround, this uses the
`patch-package` tool to modify the installed `depd` code during the `yarn
install` process, patching out its attempt to mutate frozen primordials. When
that bug is fixed, we should remove this change.
warner added a commit to Agoric/agoric-sdk that referenced this issue Jun 23, 2020
Some packages try to modify properties that SES freezes, like
`Error.prepareStackTrace`. These packages cannot be imported in a SES
environment. Work is underway to tolerate these (endojs/endo#251).

`depd` is one such package. As a temporary workaround, this uses the
`patch-package` tool to modify the installed `depd` code during the `yarn
install` process, patching out its attempt to mutate frozen primordials. When
that bug is fixed, we should remove this change.
warner added a commit to Agoric/agoric-sdk that referenced this issue Jun 25, 2020
Some packages try to modify properties that SES freezes, like
`Error.prepareStackTrace`. These packages cannot be imported in a SES
environment. Work is underway to tolerate these (endojs/endo#251).

`depd` is one such package. As a temporary workaround, this uses the
`patch-package` tool to modify the installed `depd` code during the `yarn
install` process, patching out its attempt to mutate frozen primordials. When
that bug is fixed, we should remove this change.
warner added a commit to Agoric/agoric-sdk that referenced this issue Jun 25, 2020
Some packages try to modify properties that SES freezes, like
`Error.prepareStackTrace`. These packages cannot be imported in a SES
environment. Work is underway to tolerate these (endojs/endo#251).

`depd` is one such package. As a temporary workaround, this uses the
`patch-package` tool to modify the installed `depd` code during the `yarn
install` process, patching out its attempt to mutate frozen primordials. When
that bug is fixed, we should remove this change.
warner added a commit to Agoric/agoric-sdk that referenced this issue Jun 25, 2020
Some packages try to modify properties that SES freezes, like
`Error.prepareStackTrace`. These packages cannot be imported in a SES
environment. Work is underway to tolerate these (endojs/endo#251).

`depd` is one such package. As a temporary workaround, this uses the
`patch-package` tool to modify the installed `depd` code during the `yarn
install` process, patching out its attempt to mutate frozen primordials. When
that bug is fixed, we should remove this change.
warner added a commit to Agoric/agoric-sdk that referenced this issue Jun 25, 2020
Some packages try to modify properties that SES freezes, like
`Error.prepareStackTrace`. These packages cannot be imported in a SES
environment. Work is underway to tolerate these (endojs/endo#251).

`depd` is one such package. As a temporary workaround, this uses the
`patch-package` tool to modify the installed `depd` code during the `yarn
install` process, patching out its attempt to mutate frozen primordials. When
that bug is fixed, we should remove this change.
warner added a commit to Agoric/agoric-sdk that referenced this issue Jun 26, 2020
Some packages try to modify properties that SES freezes, like
`Error.prepareStackTrace`. These packages cannot be imported in a SES
environment. Work is underway to tolerate these (endojs/endo#251).

`depd` is one such package. As a temporary workaround, this uses the
`patch-package` tool to modify the installed `depd` code during the `yarn
install` process, patching out its attempt to mutate frozen primordials. When
that bug is fixed, we should remove this change.
@erights
Copy link
Contributor

erights commented Jul 2, 2020

@kumavis @warner
Now that #359 is merged, could you check if we still have the errors? If not, please close. Thanks.

@erights
Copy link
Contributor

erights commented Jul 11, 2020

Now that #359 is merged, could you check if we still have the errors? If not, please close. Thanks.

Closing. Please reopen if this is still a problem.

@erights erights closed this as completed Jul 11, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confinement Pertaining to confinement of guest programs. debugging support taming compat zoe-alpha-release Goal for Zoe alpha
Projects
None yet
Development

No branches or pull requests

4 participants