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

x/mobile/exp/audio/al: al.Buffer.Geti() stackoverflow #45737

Open
MMulthaupt opened this issue Apr 23, 2021 · 2 comments
Open

x/mobile/exp/audio/al: al.Buffer.Geti() stackoverflow #45737

MMulthaupt opened this issue Apr 23, 2021 · 2 comments
Labels
mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@MMulthaupt
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.16.3 windows/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Zyl\AppData\Local\go-build
set GOENV=C:\Users\Zyl\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=D:\Projects\Code\Go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=D:\Projects\Code\Go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.16.3
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=D:\Projects\Code\Go\src\zyl\testgl\go.mod
set CGO_CFLAGS=-ID:\Projects\Code\Go\src\zyl\testgl\inc
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-LD:\Projects\Code\Go\src\zyl\testgl\lib
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\Zyl\AppData\Local\Temp\go-build3689009114=/tmp/go-build -gno-record-gcc-switches

What did you do?

Call Size() on an al.Buffer.

What did you expect to see?

Receive the size of the buffer.

What did you see instead?

runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0xc020b49390 stack=[0xc020b48000, 0xc040b48000]
fatal error: stack overflow

runtime stack:
runtime.throw(0x126bec4, 0xe)
        C:/Program Files/Go/src/runtime/panic.go:1117 +0x79
runtime.newstack()
        C:/Program Files/Go/src/runtime/stack.go:1069 +0x80d
runtime.morestack()
        C:/Program Files/Go/src/runtime/asm_amd64.s:458 +0x97

goroutine 1 [running, locked to thread]:
golang.org/x/mobile/exp/audio/al.Buffer.Geti(0x3, 0x2004, 0x0)
        D:/Projects/Code/Go/pkg/mod/golang.org/x/mobile@v0.0.0-20210220033013-bdb1ca9a1e08/exp/audio/al/al.go:425 +0x51 fp=0xc020b493a0 sp=0xc020b49398 pc=0x116b531
[...]
golang.org/x/mobile/exp/audio/al.Buffer.Geti(0x3, 0x2004, 0x0)
        D:/Projects/Code/Go/pkg/mod/golang.org/x/mobile@v0.0.0-20210220033013-bdb1ca9a1e08/exp/audio/al/al.go:426 +0x3a fp=0xc020b4a318 sp=0xc020b4a2f0 pc=0x116b51a
...additional frames elided...

Additional information

func (b Buffer) Geti(param int) int32 {
	return b.Geti(param)
}

needs to be

func (b Buffer) Geti(param int) int32 {
	return alGetBufferi(b, param)
}

Probably an oversight by whoever implemented this; experimental module and all.

@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Apr 23, 2021
@gopherbot gopherbot added this to the Unreleased milestone Apr 23, 2021
@cherrymui
Copy link
Member

cc @hyangah @eliasnaur

@cherrymui cherrymui added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 26, 2021
@cherrymui
Copy link
Member

@MMulthaupt thanks for reporting. It seems you already got a fix. Mind sending a patch (https://golang.org/doc/contribute)? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants