-
Notifications
You must be signed in to change notification settings - Fork 900
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Version
1.27.0
What happened?
sqlc throws a SIGSEGV when a WASM plugin fails to load.
That's caused by https://github.com/sqlc-dev/sqlc/blob/main/internal/ext/wasm/wasm.go#L226 where sqlc calls result.Close()
on a wazero module, but wazero already closes modules on error.
Relevant log output
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb0 pc=0x1140027]
goroutine 8 [running]:
github.com/tetratelabs/wazero/internal/wasm.(*ModuleInstance).setExitCode(...)
github.com/tetratelabs/[email protected]/internal/wasm/module_instance.go:142
github.com/tetratelabs/wazero/internal/wasm.(*ModuleInstance).CloseWithExitCode(0x8?, {0x1dce8a0?, 0xc00036dc20?}, 0x1?)
github.com/tetratelabs/[email protected]/internal/wasm/module_instance.go:101 +0x27
github.com/tetratelabs/wazero/internal/wasm.(*ModuleInstance).Close(0xc0007bc090?, {0x1dce8a0?, 0xc00036dc20?})
github.com/tetratelabs/[email protected]/internal/wasm/module_instance.go:96 +0x1f
github.com/sqlc-dev/sqlc/internal/ext/wasm.(*Runner).Invoke(0xc0009cf3c0, {0x1dce8a0, 0xc00036dc20}, {0x1aa58a8, 0x1f}, {0x19991e0?, 0xc0007fa630?}, {0x18e1f80, 0xc0009cf400}, {0x0, ...})
github.com/sqlc-dev/sqlc/internal/ext/wasm/wasm.go:229 +0x1039
github.com/sqlc-dev/sqlc/internal/plugin.(*codegenServiceClient).Generate(0xc0005f8ad8, {0x1dce8a0, 0xc00036dc20}, 0xc0007fa630, {0x0, 0x0, 0x0})
github.com/sqlc-dev/sqlc/internal/plugin/codegen_grpc.pb.go:42 +0xc8
github.com/sqlc-dev/sqlc/internal/cmd.codegen({_, _}, {{{0x33eb9d0, 0x1}, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, ...}, ...}, ...}, ...)
github.com/sqlc-dev/sqlc/internal/cmd/generate.go:410 +0x552
github.com/sqlc-dev/sqlc/internal/cmd.(*generator).ProcessResult(_, {_, _}, {{{0x33eb9d0, 0x1}, {{0x0, 0x0}, {0x0, 0x0}, {0x0, ...}, ...}, ...}, ...}, ...)
github.com/sqlc-dev/sqlc/internal/cmd/generate.go:203 +0xa5
github.com/sqlc-dev/sqlc/internal/cmd.processQuerySets.func1()
github.com/sqlc-dev/sqlc/internal/cmd/process.go:113 +0x8f0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x50
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1
golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x96
Database schema
NA
SQL queries
NA
Configuration
NA
Playground URL
No response
What operating system are you using?
No response
What database engines are you using?
No response
What type of code are you generating?
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working