pointer being freed was not allocated
wangkui503 opened this issue · 1 comments
Anyone ever seen this error?
`screengrab(85456,0x70000db22000) malloc: *** error for object 0x5955525554525150: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
SIGABRT: abort
PC=0x7fff5c9a6e3e m=4 sigcode=0
goroutine 0 [idle]:
runtime: unknown pc 0x7fff5c9a6e3e
stack: frame={sp:0x70000db21d78, fp:0x0} stack=[0x70000daa2290,0x70000db21e90)
000070000db21c78: 0000000000000000 00007fff5ca18a81
000070000db21c88: 000000000affa000 0000000000000000
000070000db21c98: 00007fff5ca18a70 000070000db21d00
000070000db21ca8: 00007fff5cad90d0 0000700000000001
000070000db21cb8: 0000000000000000 00007fff5ca18a81
000070000db21cc8: 000070000db21d10 000070000db22000
000070000db21cd8: 000000000affa000 000000000ac49000
000070000db21ce8: 0000000000000002 0000000000000000
000070000db21cf8: 5955525554525150 000070000db21de0
000070000db21d08: 00007fff5cad907d 0000003000000018
000070000db21d18: 000070000db21df0 000070000db21d30
000070000db21d28: 0000000000000032 9e3779b97f4a7c55
000070000db21d38: 000000000ac4b0e0 5955525554525150
000070000db21d48: 00007fff5cadae20 0000000000000000
000070000db21d58: 0000000000000000 0a99ac7c1b600036
000070000db21d68: 000070000db21dd8 000000000ac49000
000070000db21d78: <00007fff5cae5150 000070000db22000
000070000db21d88: 000070000db21dc8 000000000ac49000
000070000db21d98: 0000000000000002 0000000000000000
000070000db21da8: 5955525554525150 000070000db21de0
000070000db21db8: 00007fff5c903312 000070000db21de0
000070000db21dc8: 00007fffffffffdf ffffffff0db21d10
000070000db21dd8: 000000000affa000 000070000db21e20
000070000db21de8: 00007fff5ca00866 00007fff9588d0c0
000070000db21df8: 000000c4203262d0 0000000000000040
000070000db21e08: 0000000000000040 0000000000000011
000070000db21e18: 0000000000000100 000000c420053ce8
000070000db21e28: 00000000042399a6 000000c420053d28
000070000db21e38: 0000000004056bb0 <runtime.asmcgocall+112> 000000c420076180
000070000db21e48: 000070000db21e68 0000000004052702 <runtime.(*mcache).nextFree.func1+50>
000070000db21e58: 000000000ac5c6c8 000000000bf5415b
000070000db21e68: 0000000000000348 000000c420000180
runtime: unknown pc 0x7fff5c9a6e3e
stack: frame={sp:0x70000db21d78, fp:0x0} stack=[0x70000daa2290,0x70000db21e90)
000070000db21c78: 0000000000000000 00007fff5ca18a81
000070000db21c88: 000000000affa000 0000000000000000
000070000db21c98: 00007fff5ca18a70 000070000db21d00
000070000db21ca8: 00007fff5cad90d0 0000700000000001
000070000db21cb8: 0000000000000000 00007fff5ca18a81
000070000db21cc8: 000070000db21d10 000070000db22000
000070000db21cd8: 000000000affa000 000000000ac49000
000070000db21ce8: 0000000000000002 0000000000000000
000070000db21cf8: 5955525554525150 000070000db21de0
000070000db21d08: 00007fff5cad907d 0000003000000018
000070000db21d18: 000070000db21df0 000070000db21d30
000070000db21d28: 0000000000000032 9e3779b97f4a7c55
000070000db21d38: 000000000ac4b0e0 5955525554525150
000070000db21d48: 00007fff5cadae20 0000000000000000
000070000db21d58: 0000000000000000 0a99ac7c1b600036
000070000db21d68: 000070000db21dd8 000000000ac49000
000070000db21d78: <00007fff5cae5150 000070000db22000
000070000db21d88: 000070000db21dc8 000000000ac49000
000070000db21d98: 0000000000000002 0000000000000000
000070000db21da8: 5955525554525150 000070000db21de0
000070000db21db8: 00007fff5c903312 000070000db21de0
000070000db21dc8: 00007fffffffffdf ffffffff0db21d10
000070000db21dd8: 000000000affa000 000070000db21e20
000070000db21de8: 00007fff5ca00866 00007fff9588d0c0
000070000db21df8: 000000c4203262d0 0000000000000040
000070000db21e08: 0000000000000040 0000000000000011
000070000db21e18: 0000000000000100 000000c420053ce8
000070000db21e28: 00000000042399a6 000000c420053d28
000070000db21e38: 0000000004056bb0 <runtime.asmcgocall+112> 000000c420076180
000070000db21e48: 000070000db21e68 0000000004052702 <runtime.(*mcache).nextFree.func1+50>
000070000db21e58: 000000000ac5c6c8 000000000bf5415b
000070000db21e68: 0000000000000348 000000c420000180
goroutine 1 [syscall]:
runtime.cgocall(0x420a340, 0xc420053d28, 0x10cfb040)
/usr/local/go/src/runtime/cgocall.go:128 +0x64 fp=0xc420053cf8 sp=0xc420053cc0 pc=0x40055d4
github.com/gen2brain/x264-go/x264c._Cfunc_x264_picture_clean(0xc4203262d0)
_cgo_gotypes.go:589 +0x41 fp=0xc420053d28 sp=0xc420053cf8 pc=0x40bbfb1
github.com/gen2brain/x264-go/x264c.PictureClean.func1(0xc4203262d0)
/go/src/github.com/gen2brain/x264-go/x264c/x264c.go:853 +0x56 fp=0xc420053d60 sp=0xc420053d28 pc=0x40bc8a6
github.com/gen2brain/x264-go/x264c.PictureClean(0xc4203262d0)
/go/src/github.com/gen2brain/x264-go/x264c/x264c.go:853 +0x2b fp=0xc420053d78 sp=0xc420053d60 pc=0x40bc30b
github.com/gen2brain/x264-go.(*Encoder).Encode(0xc420080120, 0x437cee0, 0xc420020140, 0x0, 0x0)
/go/src/github.com/gen2brain/x264-go/encode.go:176 +0x343 fp=0xc420053e10 sp=0xc420053d78 pc=0x40bff93
main.main()
/go/src/github.com/gen2brain/x264-go/examples/screengrab/screengrab.go:93 +0x530 fp=0xc420053f88 sp=0xc420053e10 pc=0x41f7e10
runtime.main()
/usr/local/go/src/runtime/proc.go:198 +0x212 fp=0xc420053fe0 sp=0xc420053f88 pc=0x402e402
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420053fe8 sp=0xc420053fe0 pc=0x4057ea1
goroutine 5 [syscall]:
os/signal.signal_recv(0x0)
/usr/local/go/src/runtime/sigqueue.go:139 +0xa7
os/signal.loop()
/usr/local/go/src/os/signal/signal_unix.go:22 +0x22
created by os/signal.init.0
/usr/local/go/src/os/signal/signal_unix.go:28 +0x41
goroutine 6 [select, locked to thread]:
runtime.gopark(0x435e0a8, 0x0, 0x434c1be, 0x6, 0x18, 0x1)
/usr/local/go/src/runtime/proc.go:291 +0x11a
runtime.selectgo(0xc420044750, 0xc42001e240)
/usr/local/go/src/runtime/select.go:392 +0xe50
runtime.ensureSigM.func1()
/usr/local/go/src/runtime/signal_unix.go:549 +0x1c6
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2361 +0x1
rax 0x0
rbx 0x70000db22000
rcx 0x70000db21d78
rdx 0x0
rdi 0x1103
rsi 0x6
rbp 0x70000db21db0
rsp 0x70000db21d78
r8 0x0
r9 0x0
r10 0x0
r11 0x206
r12 0x1103
r13 0x2
r14 0x6
r15 0x2d
rip 0x7fff5c9a6e3e
rflags 0x206
cs 0x7
fs 0x0
gs 0x0
exit status 2`
Removing the en.flush fixed it.