Title: WASM plugin error causes SIGSEGV · Issue #3758 · sqlc-dev/sqlc · GitHub
Open Graph Title: WASM plugin error causes SIGSEGV · Issue #3758 · sqlc-dev/sqlc
X Title: WASM plugin error causes SIGSEGV · Issue #3758 · sqlc-dev/sqlc
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 waze...
Open Graph 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 res...
X 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...
Opengraph URL: https://github.com/sqlc-dev/sqlc/issues/3758
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"WASM plugin error causes SIGSEGV","articleBody":"### Version\n\n1.27.0\n\n### What happened?\n\nsqlc throws a SIGSEGV when a WASM plugin fails to load.\r\n\r\nThat'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.\n\n### Relevant log output\n\n```shell\npanic: runtime error: invalid memory address or nil pointer dereference\r\n[signal SIGSEGV: segmentation violation code=0x1 addr=0xb0 pc=0x1140027]\r\n\r\ngoroutine 8 [running]:\r\ngithub.com/tetratelabs/wazero/internal/wasm.(*ModuleInstance).setExitCode(...)\r\n github.com/tetratelabs/wazero@v1.7.3/internal/wasm/module_instance.go:142\r\ngithub.com/tetratelabs/wazero/internal/wasm.(*ModuleInstance).CloseWithExitCode(0x8?, {0x1dce8a0?, 0xc00036dc20?}, 0x1?)\r\n github.com/tetratelabs/wazero@v1.7.3/internal/wasm/module_instance.go:101 +0x27\r\ngithub.com/tetratelabs/wazero/internal/wasm.(*ModuleInstance).Close(0xc0007bc090?, {0x1dce8a0?, 0xc00036dc20?})\r\n github.com/tetratelabs/wazero@v1.7.3/internal/wasm/module_instance.go:96 +0x1f\r\ngithub.com/sqlc-dev/sqlc/internal/ext/wasm.(*Runner).Invoke(0xc0009cf3c0, {0x1dce8a0, 0xc00036dc20}, {0x1aa58a8, 0x1f}, {0x19991e0?, 0xc0007fa630?}, {0x18e1f80, 0xc0009cf400}, {0x0, ...})\r\n github.com/sqlc-dev/sqlc/internal/ext/wasm/wasm.go:229 +0x1039\r\ngithub.com/sqlc-dev/sqlc/internal/plugin.(*codegenServiceClient).Generate(0xc0005f8ad8, {0x1dce8a0, 0xc00036dc20}, 0xc0007fa630, {0x0, 0x0, 0x0})\r\n github.com/sqlc-dev/sqlc/internal/plugin/codegen_grpc.pb.go:42 +0xc8\r\ngithub.com/sqlc-dev/sqlc/internal/cmd.codegen({_, _}, {{{0x33eb9d0, 0x1}, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, ...}, ...}, ...}, ...)\r\n github.com/sqlc-dev/sqlc/internal/cmd/generate.go:410 +0x552\r\ngithub.com/sqlc-dev/sqlc/internal/cmd.(*generator).ProcessResult(_, {_, _}, {{{0x33eb9d0, 0x1}, {{0x0, 0x0}, {0x0, 0x0}, {0x0, ...}, ...}, ...}, ...}, ...)\r\n github.com/sqlc-dev/sqlc/internal/cmd/generate.go:203 +0xa5\r\ngithub.com/sqlc-dev/sqlc/internal/cmd.processQuerySets.func1()\r\n github.com/sqlc-dev/sqlc/internal/cmd/process.go:113 +0x8f0\r\ngolang.org/x/sync/errgroup.(*Group).Go.func1()\r\n golang.org/x/sync@v0.8.0/errgroup/errgroup.go:78 +0x50\r\ncreated by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1\r\n golang.org/x/sync@v0.8.0/errgroup/errgroup.go:75 +0x96\n```\n\n\n### Database schema\n\n```sql\nNA\n```\n\n\n### SQL queries\n\n```sql\nNA\n```\n\n\n### Configuration\n\n```yaml\nNA\n```\n\n\n### Playground URL\n\n_No response_\n\n### What operating system are you using?\n\n_No response_\n\n### What database engines are you using?\n\n_No response_\n\n### What type of code are you generating?\n\n_No response_","author":{"url":"https://github.com/edman","@type":"Person","name":"edman"},"datePublished":"2024-12-22T14:34:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/3758/sqlc/issues/3758"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9fa98119-d4e6-854d-fe9b-b8b05f3ffcdb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A980:35C7EA:1DCBBD:28A0E4:6A513350 |
| html-safe-nonce | 4c74e2db73e77b3cf42562dc501ad91ea570155cdb71298841da5aa8b7b62d3a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTgwOjM1QzdFQToxRENCQkQ6MjhBMEU0OjZBNTEzMzUwIiwidmlzaXRvcl9pZCI6IjY4NjM2MTI1NTI2MTE0NDM1MzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 713595c384ac8782afc451c8d62863990d32fa7cf288fa311d035586ed566364 |
| hovercard-subject-tag | issue:2754687439 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/sqlc-dev/sqlc/3758/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ef1629b42512efac8f92cf1d0db5e20986c8930d9594d465a6fbc9f6887bc12a/sqlc-dev/sqlc/issues/3758 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ef1629b42512efac8f92cf1d0db5e20986c8930d9594d465a6fbc9f6887bc12a/sqlc-dev/sqlc/issues/3758 |
| og:image:alt | 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 res... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | edman |
| hostname | github.com |
| expected-hostname | github.com |
| None | e840f405b2718e8f2d55aafa9ff27dbce17e29d0c253011d05ea0fea3c78baff |
| turbo-cache-control | no-preview |
| go-import | github.com/sqlc-dev/sqlc git https://github.com/sqlc-dev/sqlc.git |
| octolytics-dimension-user_id | 136738596 |
| octolytics-dimension-user_login | sqlc-dev |
| octolytics-dimension-repository_id | 193160679 |
| octolytics-dimension-repository_nwo | sqlc-dev/sqlc |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 193160679 |
| octolytics-dimension-repository_network_root_nwo | sqlc-dev/sqlc |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4ae6027e8ba70c79dc08249bb6cdc1a09d788496 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width