webassemblyjs icon indicating copy to clipboard operation
webassemblyjs copied to clipboard

wasm-parser exceeds the maximum stack size on large function names in the "name" section

Open RSSchermer opened this issue 4 years ago • 0 comments

This problem originates from a wasm-bindgen application packaged with webpack and the wasm-pack-plugin. wasm-bindgen issue #2567 contains details on the error I encountered.

It seems that very large function names can cause parseNameSectionFunctions to exceed the stack size. It is not clear to me how this happens. I would have expected V8 to allocate large objects on the heap. Could it be because functionNames is marked const?

I will concur that the function name that seems to trigger the error is comically large. However, it results from (imho) reasonable Rust code.

I can share the pkg directory output by wasm-bindgen if that would help (which includes the wasm binary with the offending "name" section).

RSSchermer avatar May 28 '21 21:05 RSSchermer