Closed n0thhhing closed 6 months ago
This happends via bun run too also, it doesn't even throw the "Cannot use test() outside of the test runner. Run "bun test" to run tests" Error, it instantly throws segmentation fault(in most cases, sometimes it does work), also this will throw if the code is importing the wrapper.ts
file
Have the same issue with bun test
in CI: https://github.com/dl-solarity/zktype/actions/runs/8723755844/job/23932703629
Occurs not consistently but from time to time
Duplicate of #5398
This is a JavaScript transpiler stack overflow.
We will fix it, but to reduce the number of duplicated issues please follow along in #5398
What version of Bun is running?
Tested on bun 1.1.1, 1.0, and 1.0.32
What platform is your computer?
What is the expected behavior?
What do you see instead?
On
Arch Linux
andDebian
, this issue occurs frequently, while onUbuntu
, it consistently happens.For
bun run
:What steps can reproduce the bug?
No additional build steps are required to run the code, as all necessary files have already been generated using Emscripten. You can find the code to reproduce the issue on the SIGSEGV branch of the capstone-wrapper repository.
The primary source files, where most functions originate from, are
src/wrapper.ts
andsrc/memory.ts
. Whilememory.ts
doesn't technically execute any code,wrapper.ts
serves as the entry point, initializing the Emscripten instance and importing a significant portion of the codebase. It's noteworthy that neither of these files throws any errors when executed.Additional information
The errors started occurring as the project grew in size, reaching around
200,000-300,000
lines of code.While aarch64 isn't directly supported with Termux, using
proot
resolves most platform-related issues.No code is executed AT ALL; it fails instantly even with top-level Emscripten stack tracing.
Emscripten
is used for transpilation, which can produce large files. However, running the code on Node.js works fine even with large files.Minifying the code will not resolve the issue.
The project is being developed for
aarch64
because it's meant to run on another project I'm working onThe issue is not related to Emscripten because running
src/wrapper.ts
(where Emscripten is initialized) does not throw any errors.buns bundler
on this code throws the following error, which is why I can't use node in the first place