Skip to content

wasm error: out of bounds memory access wasm stack trace #3920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
shefatfaisal opened this issue Apr 6, 2025 · 1 comment
Closed

wasm error: out of bounds memory access wasm stack trace #3920

shefatfaisal opened this issue Apr 6, 2025 · 1 comment

Comments

@shefatfaisal
Copy link

Version

1.28.0

What happened?

A bug happened!

Relevant log output

$ sqlc generate
panic: start function[17] failed: wasm error: out of bounds memory access
        wasm stack trace:
                .$17()

goroutine 5 [running]:
github.com/wasilibs/go-pgquery/parser.init.func1()
        C:/Users/faisa/go/pkg/mod/github.com/wasilibs/go-pgquery@v0.0.0-20240606042535-c0843d6592cc/parser/parser_wazero.go:154 +0x1571
sync.(*Pool).Get(0x7ff7983ffbc0)
        C:/Program Files/Go/src/sync/pool.go:155 +0xb1
github.com/wasilibs/go-pgquery/parser.newABI(...)
        C:/Users/faisa/go/pkg/mod/github.com/wasilibs/go-pgquery@v0.0.0-20240606042535-c0843d6592cc/parser/parser_wazero.go:192
github.com/wasilibs/go-pgquery/parser.ParseToProtobuf({0xc000140460, 0x9b})
        C:/Users/faisa/go/pkg/mod/github.com/wasilibs/go-pgquery@v0.0.0-20240606042535-c0843d6592cc/parser/parser_wazero.go:62 +0x5a
github.com/wasilibs/go-pgquery.Parse({0xc000140460?, 0xc0000b4600?})
        C:/Users/faisa/go/pkg/mod/github.com/wasilibs/go-pgquery@v0.0.0-20240606042535-c0843d6592cc/pg_query.go:27 +0x18
github.com/sqlc-dev/sqlc/internal/engine/postgresql.(*Parser).Parse(0x0?, {0x7ff798d43d40?, 0xc00039a960?})     
        C:/Users/faisa/go/pkg/mod/github.com/sqlc-dev/sqlc@v1.28.0/internal/engine/postgresql/parse.go:154 +0x57
github.com/sqlc-dev/sqlc/internal/compiler.(*Compiler).parseCatalog(0xc000361908, {0xc000355160?, 0xc000430610?, 0xa?})
        C:/Users/faisa/go/pkg/mod/github.com/sqlc-dev/sqlc@v1.28.0/internal/compiler/compile.go:42 +0x238       
github.com/sqlc-dev/sqlc/internal/compiler.(*Compiler).ParseCatalog(...)
        C:/Users/faisa/go/pkg/mod/github.com/sqlc-dev/sqlc@v1.28.0/internal/compiler/engine.go:68
github.com/sqlc-dev/sqlc/internal/cmd.parse({_, _}, {_, _}, {_, _}, {{0x0, 0x0}, {0xc000430610, 0xa}, ...}, ...)
        C:/Users/faisa/go/pkg/mod/github.com/sqlc-dev/sqlc@v1.28.0/internal/cmd/generate.go:308 +0x198
github.com/sqlc-dev/sqlc/internal/cmd.processQuerySets.func1()
        C:/Users/faisa/go/pkg/mod/github.com/sqlc-dev/sqlc@v1.28.0/internal/cmd/process.go:107 +0x81a
golang.org/x/sync/errgroup.(*Group).Go.func1()
        C:/Users/faisa/go/pkg/mod/golang.org/x/sync@v0.10.0/errgroup/errgroup.go:78 +0x50
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1
        C:/Users/faisa/go/pkg/mod/golang.org/x/sync@v0.10.0/errgroup/errgroup.go:75 +0x93

Database schema

-- +goose UP

create table users(
    id UUID PRIMARY KEY,
    created_at TIMESTAMP not null,
    updated_at TIMESTAMP not null,
    name text not null
);

-- +goose Down

drop table users

SQL queries

-- name: CreateUser :one
insert into users(id, created_at, updated_at, name)
values($1, $2, $3, $4)
RETURNING *;

Configuration

version: "2"
sql:
  - schema: "sql/schema"
    queries: "sql/queries"
    engine: "postgresql"
    gen:
      go:
        out: "internal/database"
        package: "database"
        sql_package: "pgx/v5"

Playground URL

No response

What operating system are you using?

Windows

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

@kyleconroy
Copy link
Collaborator

This is a duplicate of #3836, which will be included in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants