Skip to content

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

Closed
@hajimehoshi

Description

@hajimehoshi

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions