oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
71.09k stars 2.47k forks source link

Stack overflow while transpiling `binaryen` package #10900

Closed csjh closed 1 week ago

csjh commented 1 week ago

What version of Bun is running?

1.1.7+b0b7db5c0

What platform is your computer?

Darwin 23.4.0 arm64 arm

What steps can reproduce the bug?

Run bun -e "await import('binaryen')" (or import binaryen in any way)

What is the expected behavior?

Expected behaviour is for binaryen to import regularly

What do you see instead?

zsh: illegal hardware instruction bun -e "await import('binaryen')"

Additional information

Wasn't happening before - I suspect I upgraded my bun version, but not sure what I was on previously

Jarred-Sumner commented 1 week ago

This appears to be a stack overflow in our JavaScript parser.

mem.Allocator.allocBytesWithAlignment__anon_91842 (/Users/jarred/Code/bun/src/deps/zig/lib/std/mem/Allocator.zig:214)
mem.Allocator.create__anon_69229 (/Users/jarred/Code/bun/src/deps/zig/lib/std/mem/Allocator.zig:105)
src.js_ast.ASTMemoryAllocator.append__anon_254003 (/Users/jarred/Code/bun/src/js_ast.zig:7502)
src.js_ast.Expr.Data.Store.append__anon_179509 (/Users/jarred/Code/bun/src/js_ast.zig:5494)
src.js_ast.Expr.Data.Store.assert (/Users/jarred/Code/bun/src/js_ast.zig:5526)
src.js_ast.Expr.init__anon_138906 (/Users/jarred/Code/bun/src/js_ast.zig:3903)
src.js_ast.Expr.joinWithComma (/Users/jarred/Code/bun/src/js_ast.zig:3385)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1754)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
src.js_parser.SideEffects.simpifyUnusedExpr__anon_340527 (/Users/jarred/Code/bun/src/js_parser.zig:1755)
soitchu commented 1 week ago

This seems to be a duplicate of #9756

csjh commented 1 week ago

Yep, just noticed the "wasn't happening before" was because I switched out my compiled-from-source version of binaryen for the packaged one (which uses the massive sequence expression)

csjh commented 1 week ago

Duplicate of #9756