asticode / go-astiav

Golang ffmpeg and libav C bindings
MIT License
393 stars 45 forks source link

fatal error when using frame.Data().Image() #31

Closed Cacsjep closed 9 months ago

Cacsjep commented 10 months ago

I want convert a astiav.Frame to an image.Image with using existing func: frame.Data().Image() but it crash. Frame is not nil and is a valid frame.

Thanks

unexpected fault address 0x22b7747ea40
fatal error: fault
[signal 0xc0000005 code=0x0 addr=0x22b7747ea40 pc=0x7ff68f46fbe9]

goroutine 1 [running]:
runtime.throw({0x7ff68f4e14a1?, 0x101f68f414ba5?})
        C:/Program Files/Go/src/runtime/panic.go:1077 +0x65 fp=0xc000115b90 sp=0xc000115b60 pc=0x7ff68f444285
runtime.sigpanic()
        C:/Program Files/Go/src/runtime/signal_windows.go:377 +0xd0 fp=0xc000115bd8 sp=0xc000115b90 pc=0x7ff68f456930
runtime.memmove()
        C:/Program Files/Go/src/runtime/memmove_amd64.s:339 +0x3c9 fp=0xc000115be0 sp=0xc000115bd8 pc=0x7ff68f46fbe9
runtime.gobytes(0x7ff68f4c88c0?, 0x8940)
        C:/Program Files/Go/src/runtime/string.go:309 +0x65 fp=0xc000115c30 sp=0xc000115be0 pc=0x7ff68f45b525
github.com/asticode/go-astiav._Cfunc_GoBytes(...)
        _cgo_gotypes.go:2077
github.com/asticode/go-astiav.bytesFromC.func1(0xc00000a150?, 0x7ff68f423e88?)
        C:/Users/c.acs/go/pkg/mod/github.com/asticode/go-astiav@v0.12.0/bytes.go:27 +0x3e fp=0xc000115c70 sp=0xc000115c30 pc=0x7ff68f4a751e
github.com/asticode/go-astiav.bytesFromC(0xc000115e38)
        C:/Users/c.acs/go/pkg/mod/github.com/asticode/go-astiav@v0.12.0/bytes.go:27 +0x38 fp=0xc000115c98 sp=0xc000115c70 pc=0x7ff68f4a74b8
github.com/asticode/go-astiav.(*FrameData).planeData(...)
        C:/Users/c.acs/go/pkg/mod/github.com/asticode/go-astiav@v0.12.0/frame_data.go:48
github.com/asticode/go-astiav.(*FrameData).imageYCbCr(0xc000115ed8)
        C:/Users/c.acs/go/pkg/mod/github.com/asticode/go-astiav@v0.12.0/frame_data.go:83 +0x1b1 fp=0xc000115e68 sp=0xc000115c98 pc=0x7ff68f4a8171
github.com/asticode/go-astiav.(*FrameData).Image(0xc000115ef0?)
        C:/Users/c.acs/go/pkg/mod/github.com/asticode/go-astiav@v0.12.0/frame_data.go:117 +0xad fp=0xc000115eb0 sp=0xc000115e68 pc=0x7ff68f4a89cd
main.main()
        C:/Development/milunx/cmd/decoder/main.go:97 +0xde fp=0xc000115f40 sp=0xc000115eb0 pc=0x7ff68f4aa71e
runtime.main()
        C:/Program Files/Go/src/runtime/proc.go:267 +0x2b2 fp=0xc000115fe0 sp=0xc000115f40 pc=0x7ff68f446b72
runtime.goexit()
        C:/Program Files/Go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000115fe8 sp=0xc000115fe0 pc=0x7ff68f46eac1

goroutine 2 [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        C:/Program Files/Go/src/runtime/proc.go:398 +0xce fp=0xc000059fa8 sp=0xc000059f88 pc=0x7ff68f446f8e
runtime.goparkunlock(...)
        C:/Program Files/Go/src/runtime/proc.go:404
runtime.forcegchelper()
        C:/Program Files/Go/src/runtime/proc.go:322 +0xb8 fp=0xc000059fe0 sp=0xc000059fa8 pc=0x7ff68f446e18
runtime.goexit()
        C:/Program Files/Go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000059fe8 sp=0xc000059fe0 pc=0x7ff68f46eac1
created by runtime.init.6 in goroutine 1
        C:/Program Files/Go/src/runtime/proc.go:310 +0x1a

goroutine 3 [GC sweep wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        C:/Program Files/Go/src/runtime/proc.go:398 +0xce fp=0xc00005bf78 sp=0xc00005bf58 pc=0x7ff68f446f8e
runtime.goparkunlock(...)
        C:/Program Files/Go/src/runtime/proc.go:404
runtime.bgsweep(0x0?)
        C:/Program Files/Go/src/runtime/mgcsweep.go:280 +0x94 fp=0xc00005bfc8 sp=0xc00005bf78 pc=0x7ff68f431ef4
runtime.gcenable.func1()
        C:/Program Files/Go/src/runtime/mgc.go:200 +0x25 fp=0xc00005bfe0 sp=0xc00005bfc8 pc=0x7ff68f427265
runtime.goexit()
        C:/Program Files/Go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc00005bfe8 sp=0xc00005bfe0 pc=0x7ff68f46eac1
created by runtime.gcenable in goroutine 1
        C:/Program Files/Go/src/runtime/mgc.go:200 +0x66

goroutine 4 [GC scavenge wait]:
runtime.gopark(0xc000066000?, 0x7ff68f503470?, 0x1?, 0x0?, 0xc000056b60?)
        C:/Program Files/Go/src/runtime/proc.go:398 +0xce fp=0xc00006df70 sp=0xc00006df50 pc=0x7ff68f446f8e
runtime.goparkunlock(...)
        C:/Program Files/Go/src/runtime/proc.go:404
runtime.(*scavengerState).park(0x7ff68f5837a0)
        C:/Program Files/Go/src/runtime/mgcscavenge.go:425 +0x49 fp=0xc00006dfa0 sp=0xc00006df70 pc=0x7ff68f42f7a9
runtime.bgscavenge(0x0?)
        C:/Program Files/Go/src/runtime/mgcscavenge.go:653 +0x3c fp=0xc00006dfc8 sp=0xc00006dfa0 pc=0x7ff68f42fd3c
runtime.gcenable.func2()
        C:/Program Files/Go/src/runtime/mgc.go:201 +0x25 fp=0xc00006dfe0 sp=0xc00006dfc8 pc=0x7ff68f427205
runtime.goexit()
        C:/Program Files/Go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc00006dfe8 sp=0xc00006dfe0 pc=0x7ff68f46eac1
created by runtime.gcenable in goroutine 1
        C:/Program Files/Go/src/runtime/mgc.go:201 +0xa5

goroutine 5 [finalizer wait]:
runtime.gopark(0x7ff68f4de900?, 0x18f447e01?, 0x0?, 0x0?, 0x7ff68f44f305?)
        C:/Program Files/Go/src/runtime/proc.go:398 +0xce fp=0xc00005de28 sp=0xc00005de08 pc=0x7ff68f446f8e
runtime.runfinq()
        C:/Program Files/Go/src/runtime/mfinal.go:193 +0x107 fp=0xc00005dfe0 sp=0xc00005de28 pc=0x7ff68f426327
runtime.goexit()
        C:/Program Files/Go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc00005dfe8 sp=0xc00005dfe0 pc=0x7ff68f46eac1
created by runtime.createfing in goroutine 1
        C:/Program Files/Go/src/runtime/mfinal.go:163 +0x3d
exit status 2
asticode commented 10 months ago

Can you provide a file and minimal code to reproduce the issue?

Cacsjep commented 9 months ago

sre was an issue on my side