Skip to content

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

Closed as duplicate
@shefatfaisal

Description

@shefatfaisal

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/[email protected]/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/[email protected]/parser/parser_wazero.go:192
github.com/wasilibs/go-pgquery/parser.ParseToProtobuf({0xc000140460, 0x9b})
        C:/Users/faisa/go/pkg/mod/github.com/wasilibs/[email protected]/parser/parser_wazero.go:62 +0x5a
github.com/wasilibs/go-pgquery.Parse({0xc000140460?, 0xc0000b4600?})
        C:/Users/faisa/go/pkg/mod/github.com/wasilibs/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/internal/cmd/process.go:107 +0x81a
golang.org/x/sync/errgroup.(*Group).Go.func1()
        C:/Users/faisa/go/pkg/mod/golang.org/x/[email protected]/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/[email protected]/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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions