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

workerd: maximum call stack size exceeded #831

Closed
ohodson opened this issue Jul 3, 2023 · 2 comments
Closed

workerd: maximum call stack size exceeded #831

ohodson opened this issue Jul 3, 2023 · 2 comments
Assignees

Comments

@ohodson
Copy link
Contributor

ohodson commented Jul 3, 2023

This ticket is to follow-up on cloudflare/workers-sdk#2386 (comment). workerd is returning 500 Internal Server Error with a note that reads:

There was an error while reporting an unhandled promise rejection: RangeError: maximum call stack size exceeded.

There is a repro in https://github.com/BillBrower-Shopify/cf-workerd-crash-minimal.

@ohodson ohodson self-assigned this Jul 3, 2023
@ohodson ohodson changed the title workerd: memory exhaustion workerd: maximum call stack size exceeded Jul 3, 2023
@ohodson
Copy link
Contributor Author

ohodson commented Jul 5, 2023

It looks like the stack overflow here comes from code in wrangler, in cloudflare/workers-sdk, that is recursing too many times. This does not necessarily mean that this code is at fault, but someone familiar with that code should take a look at what is happening there. The repro case is opaque looking from the workerd side (binary config, unknown code in the package).

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x1057955f8]
    1: StubFrame [pc: 0x1057f04b4]
    2: StubFrame [pc: 0x10573f2cc]
    3: jsonError(aka jsonError) [0x1d110894a73d] [index.js:~64] [pc=0x1d1100049408](this=0x1d1108240301 <undefined>,0x1d115b27fd05 <Request map = 0x1d11083dec25>#0#,0x1d110894a759 <Object map = 0x1d11083cb121>#1#,0x1d110894a775 <ExecutionContext map = 0x1d11083e77a5>#2#,0x1d11096b3cf5 <Object map = 0x1d11083e7ea1>#3#)
    4: __facade_invokeChain__(aka __facade_invokeChain__) [0x1d110894a799] [index.js:~31] [pc=0x1d1100048e84](this=0x1d1108240301 <undefined>,0x1d115b27fd05 <Request map = 0x1d11083dec25>#0#,0x1d110894a759 <Object map = 0x1d11083cb121>#1#,0x1d110894a775 <ExecutionContext map = 0x1d11083e77a5>#2#,0x1d115b27fd29 <JSFunction __facade_modules_dispatch__ (sfi = 0x1d11083e7805)>#4#,0x1d11096b3abd <JSArray[2]>#5#)
    5: next [0x1d11096b3b69] [index.js:~35] [pc=0x1d1100049004](this=0x1d11096b3b55 <Object map = 0x1d11083e7ea1>#6#,0x1d115b27fd05 <Request map = 0x1d11083dec25>#0#,0x1d110894a759 <Object map = 0x1d11083cb121>#1#)
    6: jsonError(aka jsonError) [0x1d110894a73d] [index.js:~64] [pc=0x1d1100049128](this=0x1d1108240301 <undefined>,0x1d115b27fd05 <Request map = 0x1d11083dec25>#0#,0x1d110894a759 <Object map = 0x1d11083cb121>#1#,0x1d110894a775 <ExecutionContext map = 0x1d11083e77a5>#2#,0x1d11096b3b55 <Object map = 0x1d11083e7ea1>#6#)
    7: __facade_invokeChain__(aka __facade_invokeChain__) [0x1d110894a799] [index.js:~31] [pc=0x1d1100048e84](this=0x1d1108240301 <undefined>,0x1d115b27fd05 <Request map = 0x1d11083dec25>#0#,0x1d110894a759 <Object map = 0x1d11083cb121>#1#,0x1d110894a775 <ExecutionContext map = 0x1d11083e77a5>#2#,0x1d115b27fd29 <JSFunction __facade_modules_dispatch__ (sfi = 0x1d11083e7805)>#4#,0x1d11096b38f5 <JSArray[3]>#7#)
    8: next [0x1d11096b39b5] [index.js:~35] [pc=0x1d1100049004](this=0x1d11096b39a1 <Object map = 0x1d11083e7ea1>#8#,0x1d115b27fd05 <Request map = 0x1d11083dec25>#0#,0x1d110894a759 <Object map = 0x1d11083cb121>#1#)
    9: jsonError(aka jsonError) [0x1d110894a73d] [index.js:~64] [pc=0x1d1100049128](this=0x1d1108240301 <undefined>,0x1d115b27fd05 <Request map = 0x1d11083dec25>#0#,0x1d110894a759 <Object map = 0x1d11083cb121>#1#,0x1d110894a775 <ExecutionContext map = 0x1d11083e77a5>#2#,0x1d11096b39a1 <Object map = 0x1d11083e7ea1>#8#)
   10: __facade_invokeChain__(aka __facade_invokeChain__) [0x1d110894a799] [index.js:~31] [pc=0x1d1100048e84](this=0x1d1108240301 <undefined>,0x1d115b27fd05 <Request map = 0x1d11083dec25>#0#,0x1d110894a759 <Object map = 0x1d11083cb121>#1#,0x1d110894a775 <ExecutionContext map = 0x1d11083e77a5>#2#,0x1d115b27fd29 <JSFunction __facade_modules_dispatch__ (sfi = 0x1d11083e7805)>#4#,0x1d11096b3719 <JSArray[4]>#9#)
   11: next [0x1d11096b37ed] [index.js:~35] [pc=0x1d1100049004](this=0x1d11096b37d9 <Object map = 0x1d11083e7ea1>#10#,0x1d115b27fd05 <Request map = 0x1d11083dec25>#0#,0x1d110894a759 <Object map = 0x1d11083cb121>#1#)
   12: jsonError(aka jsonError) [0x1d110894a73d] [index.js:~64] [pc=0x1d1100049128](this=0x1d1108240301 <undefined>,0x1d115b27fd05 <Request map = 0x1d11083dec25>#0#,0x1d110894a759 <Object map = 0x1d11083cb121>#1#,0x1d110894a775 <ExecutionContext map = 0x1d11083e77a5>#2#,0x1d11096b37d9 <Object map = 0x1d11083e7ea1>#10#)
   13: __facade_invokeChain__(aka __facade_invokeChain__) [0x1d110894a799] [index.js:~31] [pc=0x1d1100048e84](this=0x1d1108240301 <undefined>,0x1d115b27fd05 <Request map = 0x1d11083dec25>#0#,0x1d110894a759 <Object map = 0x1d11083cb121>#1#,0x1d110894a775 <ExecutionContext map = 0x1d11083e77a5>#2#,0x1d115b27fd29 <JSFunction __facade_modules_dispatch__ (sfi = 0x1d11083e7805)>#4#,0x1d11096b3529 <JSArray[5]>#11#)
   14: next [0x1d11096b3611] [index.js:~35] [pc=0x1d1100049004](this=0x1d11096b35fd <Object map = 0x1d11083e7ea1>#12#,0x1d115b27fd05 <Request map = 0x1d11083dec25>#0#,0x1d110894a759 <Object map = 0x1d11083cb121>#1#)
   15: jsonError(aka jsonError) [0x1d110894a73d] [index.js:~64] [pc=0x1d1100049128](this=0x1d1108240301 <undefined>,0x1d115b27fd05 <Request map = 0x1d11083dec25>#0#,0x1d110894a759 <Object map = 0x1d11083cb121>#1#,0x1d110894a775 <ExecutionContext map = 0x1d11083e77a5>#2#,0x1d11096b35fd <Object map = 0x1d11083e7ea1>#12#)
   16: __facade_invokeChain__(aka __facade_invokeChain__) [0x1d110894a79
...
 4217: next [0x1d115b47fb55] [index.js:~35] [pc=0x1d1100049004](this=0x1d115b47fb8d <Object map = 0x1d11083e7ea1>@0x1d115b47fb8d,0x1d115b27fd05 <Request map = 0x1d11083dec25>#0#,0x1d110894a759 <Object map = 0x1d11083cb121>#1#)
 4218: jsonError(aka jsonError) [0x1d110894a73d] [index.js:~64] [pc=0x1d1100049128](this=0x1d1108240301 <undefined>,0x1d115b27fd05 <Request map = 0x1d11083dec25>#0#,0x1d110894a759 <Object map = 0x1d11083cb121>#1#,0x1d110894a775 <ExecutionContext map = 0x1d11083e77a5>#2#,0x1d115b47fb8d <Object map = 0x1d11083e7ea1>@0x1d115b47fb8d)
 4219: __facade_invokeChain__(aka __facade_invokeChain__) [0x1d110894a799] [index.js:~31] [pc=0x1d1100048e84](this=0x1d1108240301 <undefined>,0x1d115b27fd05 <Request map = 0x1d11083dec25>#0#,0x1d110894a759 <Object map = 0x1d11083cb121>#1#,0x1d110894a775 <ExecutionContext map = 0x1d11083e77a5>#2#,0x1d115b27fd29 <JSFunction __facade_modules_dispatch__ (sfi = 0x1d11083e7805)>#4#,0x1d115b47fbe1 <JSArray[1407]>@0x1d115b47fbe1)
 4220: next [0x1d115b47fbf1] [index.js:~35] [pc=0x1d1100049004](this=0x1d115b47fc29 <Object map = 0x1d11083e7ea1>@0x1d115b47fc29,0x1d115b27fd05 <Request map = 0x1d11083dec25>#0#,0x1d110894a759 <Object map = 0x1d11083cb121>#1#)

@mrbbot
Copy link
Contributor

mrbbot commented Jul 11, 2023

Looks like this is indeed an issue in Wrangler, should be fixed by cloudflare/workers-sdk#3585

@mrbbot mrbbot closed this as completed Jul 11, 2023
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

2 participants