pixiv / go-libjpeg

An implementation of Go binding for libjpeg (or libjpeg-turbo).
BSD 3-Clause "New" or "Revised" License
157 stars 52 forks source link

SEGV on DecodeConfig #38

Closed harukasan closed 5 years ago

harukasan commented 7 years ago

reported by @Gaillard in #36:

""" I am also getting another seg fault going through DecodeConfig, maybe unrelated. I don't have a test case for that one though, just the stack.

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x2 addr=0x7f6f88000388 pc=0x7f6f88000388]

runtime stack:
runtime.throw(0x1a7eb53, 0x2a)
    /usr/local/go/src/runtime/panic.go:566 +0x95
runtime.sigpanic()
    /usr/local/go/src/runtime/sigpanic_unix.go:12 +0x2cc

goroutine 49 [syscall, locked to thread]:
runtime.cgocall(0xbea500, 0xc420349638, 0xc400000000)
    /usr/local/go/src/runtime/cgocall.go:131 +0x110 fp=0xc420349608 sp=0xc4203495c8
NAME/vendor/github.com/pixiv/go-libjpeg/jpeg._Cfunc_new_decompress(0x0)
    ??:0 +0x4a fp=0xc420349638 sp=0xc420349608
NAME/vendor/github.com/pixiv/go-libjpeg/jpeg.DecodeConfig(0x25127e0, 0xc4202a20e0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/gaillard/go/src/NAME/vendor/github.com/pixiv/go-libjpeg/jpeg/decompress.go:323 +0xa4 fp=0xc420349688 sp=0xc420349638

"""

mananSingh commented 7 years ago

Issue in DecodeIntoRGB.

While running openai's universe's first agent, got unexpected crashes (I'm using amd64). I reported the full issue there. I've tried the Go versions 1.6, 1.7 and 1.8, but the error remains. Possibly, some issue in DecodeIntoRGB.

fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0x2c pc=0x7f8f432bad1c]

runtime stack:
runtime.throw(0x7f8f4420b740, 0x2a)
    /usr/lib/go/src/runtime/panic.go:530 +0x92
runtime.sigpanic()
    /usr/lib/go/src/runtime/sigpanic_unix.go:12 +0x5e
runtime.reimburseSweepCredit(0x7f8eec000b60)
    /usr/lib/go/src/runtime/mgcsweep.go:399 +0x52

goroutine 35 [syscall, locked to thread]:
runtime.cgocall(0x7f8f43a803d9, 0xc820045440, 0xc800000000)
    /usr/lib/go/src/runtime/cgocall.go:123 +0x121 fp=0xc820045418 sp=0xc8200453e8
github.com/openai/go-vncdriver/vendor/github.com/pixiv/go-libjpeg/jpeg._Cfunc_new_decompress(0x0)
    ??:0 +0x49 fp=0xc820045440 sp=0xc820045418
github.com/openai/go-vncdriver/vendor/github.com/pixiv/go-libjpeg/jpeg.DecodeIntoRGB(0x7f8f3ed89138, 0xc8200e66c0, 0xc820045618, 0x0, 0x0, 0x0)
    /home/manan/data-science-machine-learning-code/openai/go-vncdriver/.build/src/github.com/openai/go-vncdriver/vendor/github.com/pixiv/go-libjpeg/jpeg/decompress.go:256 +0x93 fp=0xc820045560 sp=0xc820045440
github.com/openai/go-vncdriver/vncclient.(*TightEncoding).Read(0xc8205a2000, 0xc8200fc000, 0xc8200a4000, 0x7f8f2c7ba168, 0xc8200e8018, 0x0, 0x0, 0x0, 0x0)
harukasan commented 7 years ago

@mananSingh Thank you for your report. I'm investigating this issue but could not reproduce yet.

Could you tell me some environments?

mananSingh commented 7 years ago

libjpeg-turbo8-dev linux (ubuntu 14.04) amd64

harukasan commented 5 years ago

This issue may fixed in #53.