microsoft / cognitive-services-speech-sdk-go

Go bindings for the Microsoft Cognitive Services Speech SDK
MIT License
88 stars 32 forks source link

fatal error: checkptr: pointer arithmetic computed bad pointer value #92

Open leiless opened 1 year ago

leiless commented 1 year ago

Describe the bug

Starting an application with go build --race. Crashes with the following error at startup:

Env

# go.mod
go 1.19
require github.com/Microsoft/cognitive-services-speech-sdk-go v1.25.0
# SpeechSDK-Linux-1.25.1-beta.1.tar.gz

$ uname -srvm
Linux 5.19.0-35-generic #36~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb 17 15:17:25 UTC 2 x86_64

$ go version
go version go1.19.6 linux/amd64
+ ./azure-speech-service
fatal error: checkptr: pointer arithmetic computed bad pointer value

goroutine 1 [running]:
runtime.throw({0x54e340?, 0x47d899?})
    /go/src/runtime/panic.go:1047 +0x5d fp=0xc00010da48 sp=0xc00010da18 pc=0x44b05d
runtime.checkptrArithmetic(0x41be0e?, {0x0?, 0xc00010dae0?, 0x10dae0?})
    /go/src/runtime/checkptr.go:52 +0xbb fp=0xc00010da78 sp=0xc00010da48 pc=0x41f55b
github.com/Microsoft/cognitive-services-speech-sdk-go/common.uintptr2handle(...)
    /root/go/pkg/mod/github.com/!microsoft/cognitive-services-speech-sdk-go@v1.25.0/common/interop_utils.go:14
github.com/Microsoft/cognitive-services-speech-sdk-go/common.getErrorCode(...)
    /root/go/pkg/mod/github.com/!microsoft/cognitive-services-speech-sdk-go@v1.25.0/common/error.go:87
github.com/Microsoft/cognitive-services-speech-sdk-go/common.NewCarbonError(0x5)
    /root/go/pkg/mod/github.com/!microsoft/cognitive-services-speech-sdk-go@v1.25.0/common/error.go:72 +0x57 fp=0xc00010db30 sp=0xc00010da78 pc=0x4d0cf7
github.com/Microsoft/cognitive-services-speech-sdk-go/speech.NewSpeechConfigFromSubscription({0x0, 0x0}, {0x0, 0x0})
    /root/go/pkg/mod/github.com/!microsoft/cognitive-services-speech-sdk-go@v1.25.0/speech/speech_config.go:56 +0x158 fp=0xc00010dc38 sp=0xc00010db30 pc=0x4dba18
main.synthesisToSpeaker({0x0, 0x0}, {0x0, 0x0}, {0x7fff8be1ce38, 0x16})
    /src/main.go:52 +0x11e fp=0xc00010def8 sp=0xc00010dc38 pc=0x4e327e
main.main()
    /src/main.go:39 +0xea fp=0xc00010df80 sp=0xc00010def8 pc=0x4e310a
runtime.main()
    /go/src/runtime/proc.go:250 +0x207 fp=0xc00010dfe0 sp=0xc00010df80 pc=0x44d947
runtime.goexit()
    /go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00010dfe8 sp=0xc00010dfe0 pc=0x47c121

goroutine 2 [force gc (idle)]:
runtime.gopark(0x61cc00?, 0x0?, 0x0?, 0x0?, 0x0?)
    /go/src/runtime/proc.go:381 +0xd6 fp=0xc0000467b0 sp=0xc000046790 pc=0x44dd96
runtime.goparkunlock(...)
    /go/src/runtime/proc.go:387
runtime.forcegchelper()
    /go/src/runtime/proc.go:305 +0xb0 fp=0xc0000467e0 sp=0xc0000467b0 pc=0x44dbd0
runtime.goexit()
    /go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000467e8 sp=0xc0000467e0 pc=0x47c121
created by runtime.init.6
    /go/src/runtime/proc.go:293 +0x25

goroutine 3 [GC sweep wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /go/src/runtime/proc.go:381 +0xd6 fp=0xc000054f80 sp=0xc000054f60 pc=0x44dd96
runtime.goparkunlock(...)
    /go/src/runtime/proc.go:387
runtime.bgsweep(0x0?)
    /go/src/runtime/mgcsweep.go:278 +0x8e fp=0xc000054fc8 sp=0xc000054f80 pc=0x43a96e
runtime.gcenable.func1()
    /go/src/runtime/mgc.go:178 +0x26 fp=0xc000054fe0 sp=0xc000054fc8 pc=0x42fe66
runtime.goexit()
    /go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000054fe8 sp=0xc000054fe0 pc=0x47c121
created by runtime.gcenable
    /go/src/runtime/mgc.go:178 +0x6b

goroutine 4 [GC scavenge wait]:
runtime.gopark(0xc00006e000?, 0x56b0c0?, 0x1?, 0x0?, 0x0?)
    /go/src/runtime/proc.go:381 +0xd6 fp=0xc00005af70 sp=0xc00005af50 pc=0x44dd96
runtime.goparkunlock(...)
    /go/src/runtime/proc.go:387
runtime.(*scavengerState).park(0x61c7c0)
    /go/src/runtime/mgcscavenge.go:400 +0x53 fp=0xc00005afa0 sp=0xc00005af70 pc=0x4388d3
runtime.bgscavenge(0x0?)
    /go/src/runtime/mgcscavenge.go:628 +0x45 fp=0xc00005afc8 sp=0xc00005afa0 pc=0x438e85
runtime.gcenable.func2()
    /go/src/runtime/mgc.go:179 +0x26 fp=0xc00005afe0 sp=0xc00005afc8 pc=0x42fe06
runtime.goexit()
    /go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00005afe8 sp=0xc00005afe0 pc=0x47c121
created by runtime.gcenable
    /go/src/runtime/mgc.go:179 +0xaa

goroutine 5 [finalizer wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /go/src/runtime/proc.go:381 +0xd6 fp=0xc000184e28 sp=0xc000184e08 pc=0x44dd96
runtime.runfinq()
    /go/src/runtime/mfinal.go:193 +0x13d fp=0xc000184fe0 sp=0xc000184e28 pc=0x42ee9d
runtime.goexit()
    /go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000184fe8 sp=0xc000184fe0 pc=0x47c121
created by runtime.createfing
    /go/src/runtime/mfinal.go:163 +0x45
leiless commented 1 year ago

Might helpful to debug this issue: https://github.com/fyne-io/fyne/issues/1957