Skip to content
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

go 1.24 panic: invalid table access #190

Closed
rgmz opened this issue Feb 12, 2025 · 6 comments · Fixed by #194
Closed

go 1.24 panic: invalid table access #190

rgmz opened this issue Feb 12, 2025 · 6 comments · Fixed by #194

Comments

@rgmz
Copy link

rgmz commented Feb 12, 2025

Reported in gitleaks/gitleaks#1751 (comment); I haven't been able to reproduce this yet.

panic: wasm error: invalid table access
        wasm stack trace:
                .$27(i32,i32,i32,i32)
                .$398(i32)
                .$430(i32,i32)
                .$428(i32,i32,i32)
                .$474(i32)
                .$652(i32,i32,i32)
                .$666(i32,i32,i32) i32

goroutine 1 [running]:
github.com/wasilibs/go-re2/internal.newRE(0xc0013df680, {0x5885e0?, 0xc001b164f8?}, {0x39?, 0x3c?, 0x47?, 0x0?})
        /go/pkg/mod/github.com/wasilibs/[email protected]/internal/re2_wazero.go:289 +0x269
github.com/wasilibs/go-re2/internal.Compile({0xc0005885e0, 0x20}, {0xd5?, 0xa3?, 0x6a?, 0x76?})
        /go/pkg/mod/github.com/wasilibs/[email protected]/internal/re2.go:67 +0x165
github.com/wasilibs/go-re2.Compile(...)
        /go/pkg/mod/github.com/wasilibs/[email protected]/re2.go:46
github.com/wasilibs/go-re2.MustCompile({0xc0005885e0, 0x20})
        /go/pkg/mod/github.com/wasilibs/[email protected]/re2.go:76 +0x2e
github.com/zricethezav/gitleaks/v8/regexp.MustCompile(...)
        /pwd/gitleaks/regexp/wasilibs_regex.go:14
@anuraaga
Copy link
Collaborator

Thanks @rgmz - I could reproduce with the wazero repo on a Mac using GOARCH=amd64 go run github.com/zricethezav/gitleaks/[email protected] git -v. Can confirm it only happens with go 1.24 amd64 and not earlier or arm64. WIll look into it.

@corani
Copy link
Contributor

corani commented Feb 13, 2025

I reported the initial issue for gitleaks and can confirm that it fails with go-1.24.0/amd64 but works fine with go-1.23.6/amd64 (haven't tested with arm64)

@kashifkhan0771
Copy link

Facing same issue in TruffleHog

@corani
Copy link
Contributor

corani commented Feb 19, 2025

Wazero fix has been released in wazero:v1.9.0, I've created #194 to update.

@anuraaga
Copy link
Collaborator

Thanks everyone for the patience - I have cut a new v1.9.0 with the fix.

@corani
Copy link
Contributor

corani commented Feb 19, 2025

Thanks for the quick turnaround @anuraaga, much appreciated! 🙇‍♂

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

Successfully merging a pull request may close this issue.

4 participants