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: Flaky crash on Mac OS X #15075

Closed
hajimehoshi opened this issue Apr 2, 2016 · 8 comments
Closed

x/mobile/exp/audio/al: Flaky crash on Mac OS X #15075

hajimehoshi opened this issue Apr 2, 2016 · 8 comments

Comments

@hajimehoshi
Copy link
Member

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
go version go1.6 darwin/amd64
  1. What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/hajimehoshi/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT="1"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
  1. What did you do?
    When running a program using x/mobile/exp/audio/al, this crashes on alc.go.

In my case, when running github.com/hajimehoshi/go-inovation on Mac OS X, I sometimes get the below crash. I'm afraid I couldn't get a minimum case to reproduce this crash. Looks like there is a case where unsafe.Pointer can't accept the value 0x18.

runtime: writebarrierptr *0x45ec598 = 0x18
fatal error: bad pointer in write barrier

runtime stack:
runtime.throw(0x4337840, 0x1c)
        /usr/local/go/src/runtime/panic.go:530 +0x90
runtime.writebarrierptr.func1()
        /usr/local/go/src/runtime/mbarrier.go:140 +0xb3
runtime.systemstack(0xc82001c000)
        /usr/local/go/src/runtime/asm_amd64.s:291 +0x79
runtime.mstart()
        /usr/local/go/src/runtime/proc.go:1048

goroutine 6 [running]:
runtime.systemstack_switch()
        /usr/local/go/src/runtime/asm_amd64.s:245 fp=0xc820038b90 sp=0xc820038b88
runtime.writebarrierptr(0x45ec598, 0x18)
        /usr/local/go/src/runtime/mbarrier.go:141 +0x97 fp=0xc820038bc0 sp=0xc820038b90
golang.org/x/mobile/exp/audio/al.OpenDevice(0x0, 0x0)
        /Users/hajimehoshi/go/src/golang.org/x/mobile/exp/audio/al/alc.go:53 +0x47c fp=0xc820038c78 sp=0xc820038bc0
github.com/hajimehoshi/ebiten/exp/audio.startPlaying(0xc790000, 0xc8200fc000, 0xac44, 0xc790000, 0x0, 0x0)
        /Users/hajimehoshi/go/src/github.com/hajimehoshi/ebiten/exp/audio/audio_openal.go:44 +0x36 fp=0xc820038d58 sp=0xc820038c78
github.com/hajimehoshi/ebiten/exp/audio.NewContext(0xac44, 0x4522070)
        /Users/hajimehoshi/go/src/github.com/hajimehoshi/ebiten/exp/audio/audio.go:125 +0x151 fp=0xc820038e18 sp=0xc820038d58
main.initAudio.func1(0xc820016540)
        /Users/hajimehoshi/go/src/github.com/hajimehoshi/go-inovation/audio.go:33 +0x70 fp=0xc820038fa8 sp=0xc820038e18
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1998 +0x1 fp=0xc820038fb0 sp=0xc820038fa8
created by main.initAudio
        /Users/hajimehoshi/go/src/github.com/hajimehoshi/go-inovation/audio.go:68 +0x53

goroutine 1 [runnable, locked to thread]:
github.com/hajimehoshi/ebiten/internal/graphics/opengl.(*Context).NewTexture(0xc8200e0000, 0x200, 0x800, 0xc8205fc000, 0x400000, 0x400000, 0x2600, 0x4d04458, 0xc82000ad50, 0x40b7f41)
        /Users/hajimehoshi/go/src/github.com/hajimehoshi/ebiten/internal/graphics/opengl/context_desktop.go:132
github.com/hajimehoshi/ebiten/internal/graphics.NewTextureFromImage(0xc8200e0000, 0x4d04608, 0xc820010400, 0x2600, 0xc8200ff000, 0x0, 0x0)
        /Users/hajimehoshi/go/src/github.com/hajimehoshi/ebiten/internal/graphics/texture.go:82 +0x3be
github.com/hajimehoshi/ebiten.NewImageFromImage(0x4d04608, 0xc820010400, 0x0, 0xc820010400, 0x0, 0x0)
        /Users/hajimehoshi/go/src/github.com/hajimehoshi/ebiten/image.go:228 +0x7a
github.com/hajimehoshi/ebiten/ebitenutil.NewImageFromFile(0xc82000e880, 0x1c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /Users/hajimehoshi/go/src/github.com/hajimehoshi/ebiten/ebitenutil/loadimage.go:37 +0x1b6
main.Run(0x0, 0x0)
        /Users/hajimehoshi/go/src/github.com/hajimehoshi/go-inovation/main.go:443 +0x30e
main.main()
        /Users/hajimehoshi/go/src/github.com/hajimehoshi/go-inovation/main.go:457 +0x1c

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1998 +0x1

goroutine 5 [chan receive, locked to thread]:
github.com/hajimehoshi/ebiten/internal/graphics/opengl.(*Context).Loop(0xc8200e0000)
        /Users/hajimehoshi/go/src/github.com/hajimehoshi/ebiten/internal/graphics/opengl/context_desktop.go:83 +0x55
github.com/hajimehoshi/ebiten/internal/ui.Init.func1(0xc820012280, 0xc820016120)
        /Users/hajimehoshi/go/src/github.com/hajimehoshi/ebiten/internal/ui/ui_glfw.go:79 +0xe4
created by github.com/hajimehoshi/ebiten/internal/ui.Init
        /Users/hajimehoshi/go/src/github.com/hajimehoshi/ebiten/internal/ui/ui_glfw.go:80 +0x362
exit status 2
  1. What did you expect to see?
    No crash.
  2. What did you see instead?
    Crash.
@hajimehoshi
Copy link
Member Author

This might be related to #9191.

@hajimehoshi
Copy link
Member Author

What's going on? If it is OK to use uintptr for the context and device values, I'd be glad to create a patch. However, this fix might be tricky. Does anyone have a better idea? Thanks,

@davecheney
Copy link
Contributor

davecheney commented Jul 4, 2017 via email

@hajimehoshi
Copy link
Member Author

Ah, is this already fixed? If so, could you show me the related change to fix this issue? I'll try Go 1.8.3 anyway. Thanks.

@davecheney
Copy link
Contributor

davecheney commented Jul 4, 2017 via email

@hajimehoshi
Copy link
Member Author

OK, it looks like it is already fixed. I've tried x/mobile/exp/audio 10 times and nothing crashed.

TBH, I've already installed Go 1.8 and I've not tested this issue.

Thank you!

@alistanis
Copy link

Thanks @davecheney for the info on this, we've been using uintptrs on our own but it's good to know when/where this was fixed.

@fastfading
Copy link

I am using go 1.8.3 still crash at alcDestroyContext
just like
#17054

@golang golang locked and limited conversation to collaborators Jul 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants