bnagy / crashwalk

Bucket and triage on-disk crashes. OSX and Linux.
Other
349 stars 37 forks source link

Internal error parsing GDB output #13

Open chrisbdaemon opened 8 years ago

chrisbdaemon commented 8 years ago

System info:

$ gdb --version GNU gdb (GDB) 7.11 $ uname -a Linux robin 4.4.5-1-ARCH #1 SMP PREEMPT Thu Mar 10 07:38:19 CET 2016 x86_64 GNU/Linux $ go version go version go1.6 linux/amd64

I got this output followed by a stacktrace:

BUG: Internal error parsing GDB output!

Something went wrong trying to parse the output of GDB and we can't continue without emitting stupid results. If this is a crash that's not worth money, please open an issue and include the raw GDB output. If not then just wait, I guess. :)

GDB OUTPUT:

COMMAND: -q --batch --ex run --ex source /home/chris/src/exploitable/exploitable/exploitable.py --ex echo --ex exploitable -v --ex echo

--ex echo --ex info reg --ex echo --ex quit --args [snip]

goroutine 19 [running]: github.com/bnagy/crashwalk/gdb.explode(0xc8204aa258, 0xe, 0x3ba8, 0xc82046c000, 0x135) /home/chris/Code/Go/src/github.com/bnagy/crashwalk/gdb/gdb.go:157 +0x2a5 github.com/bnagy/crashwalk/gdb.parse.func1() /home/chris/Code/Go/src/github.com/bnagy/crashwalk/gdb/gdb.go:365 +0x57 github.com/bnagy/crashwalk/gdb.mustAdvanceTo(0x65a610, 0x5, 0xc8201e2c88, 0xc8201e2d78) /home/chris/Code/Go/src/github.com/bnagy/crashwalk/gdb/gdb.go:182 +0x133 github.com/bnagy/crashwalk/gdb.parseRegisters(0xc8204aa258, 0xe, 0x3ba8, 0xc8201e2d78, 0xc820176900, 0x0, 0x18) /home/chris/Code/Go/src/github.com/bnagy/crashwalk/gdb/gdb.go:288 +0x21a github.com/bnagy/crashwalk/gdb.parse(0xc8204aa258, 0xe, 0x3ba8, 0xc82046c000, 0x135, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /home/chris/Code/Go/src/github.com/bnagy/crashwalk/gdb/gdb.go:370 +0xdc github.com/bnagy/crashwalk/gdb.(_Engine).Run(0x7ab398, 0xc82047e2d0, 0x3, 0x3, 0xc820312b70, 0x25, 0x1f4, 0x5, 0x0, 0x0, ...) /home/chris/Code/Go/src/github.com/bnagy/crashwalk/gdb/gdb.go:495 +0x12aa github.com/bnagy/crashwalk.process(0xc8200652b0, 0xc82009c180, 0xc82009c0c0, 0xc8200a0140) /home/chris/Code/Go/src/github.com/bnagy/crashwalk/crashwalk.go:372 +0x15f9 created by github.com/bnagy/crashwalk.(_Crashwalk).Run /home/chris/Code/Go/src/github.com/bnagy/crashwalk/crashwalk.go:540 +0x4b0

goroutine 1 [chan receive, 5 minutes]: main.main() /home/chris/Code/Go/src/github.com/bnagy/crashwalk/cmd/cwtriage/main_unix.go:199 +0x1264

goroutine 17 [syscall, 5 minutes, locked to thread]: runtime.goexit() /usr/lib/go/src/runtime/asm_amd64.s:1721 +0x1

goroutine 18 [syscall]: syscall.Syscall(0x0, 0x7, 0xc8202720be, 0x542, 0x6c, 0x5ae, 0x0) /usr/lib/go/src/syscall/asm_linux_amd64.s:18 +0x5 syscall.read(0x7, 0xc8202720be, 0x542, 0x542, 0x6c, 0x0, 0x0) /usr/lib/go/src/syscall/zsyscall_linux_amd64.go:783 +0x5f syscall.Read(0x7, 0xc8202720be, 0x542, 0x542, 0x6c, 0x0, 0x0) /usr/lib/go/src/syscall/syscall_unix.go:160 +0x4d os.(_File).read(0xc820388578, 0xc8202720be, 0x542, 0x542, 0x6c, 0x0, 0x0) /usr/lib/go/src/os/file_unix.go:211 +0x53 os.(_File).Read(0xc820388578, 0xc8202720be, 0x542, 0x542, 0x6c, 0x0, 0x0) /usr/lib/go/src/os/file.go:95 +0x8a bytes.(_Buffer).ReadFrom(0xc820160e08, 0x7fe5476c8080, 0xc820388578, 0xbe, 0x0, 0x0) /usr/lib/go/src/bytes/buffer.go:173 +0x23f io/ioutil.readAll(0x7fe5476c8080, 0xc820388578, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0) /usr/lib/go/src/io/ioutil/ioutil.go:33 +0x154 io/ioutil.ReadAll(0x7fe5476c8080, 0xc820388578, 0x0, 0x0, 0x0, 0x0, 0x0) /usr/lib/go/src/io/ioutil/ioutil.go:42 +0x51 github.com/bnagy/crashwalk/gdb.(_Engine).Run(0x7ab398, 0xc8203134d0, 0x3, 0x3, 0xc82047e570, 0x25, 0x1f4, 0x5, 0x0, 0x0, ...) /home/chris/Code/Go/src/github.com/bnagy/crashwalk/gdb/gdb.go:479 +0x1097 github.com/bnagy/crashwalk.process(0xc8200652b0, 0xc82009c180, 0xc82009c0c0, 0xc8200a0140) /home/chris/Code/Go/src/github.com/bnagy/crashwalk/crashwalk.go:372 +0x15f9 created by github.com/bnagy/crashwalk.(*Crashwalk).Run /home/chris/Code/Go/src/github.com/bnagy/crashwalk/crashwalk.go:540 +0x4b0

goroutine 20 [syscall]: syscall.Syscall(0x0, 0x5, 0xc8202726be, 0x542, 0x6c, 0x5ae, 0x0) /usr/lib/go/src/syscall/asm_linux_amd64.s:18 +0x5 syscall.read(0x5, 0xc8202726be, 0x542, 0x542, 0x6c, 0x0, 0x0) /usr/lib/go/src/syscall/zsyscall_linux_amd64.go:783 +0x5f syscall.Read(0x5, 0xc8202726be, 0x542, 0x542, 0x6c, 0x0, 0x0) /usr/lib/go/src/syscall/syscall_unix.go:160 +0x4d os.(_File).read(0xc8203885a0, 0xc8202726be, 0x542, 0x542, 0x6c, 0x0, 0x0) /usr/lib/go/src/os/file_unix.go:211 +0x53 os.(_File).Read(0xc8203885a0, 0xc8202726be, 0x542, 0x542, 0x6c, 0x0, 0x0) /usr/lib/go/src/os/file.go:95 +0x8a bytes.(_Buffer).ReadFrom(0xc820050e08, 0x7fe5476c8080, 0xc8203885a0, 0xbe, 0x0, 0x0) /usr/lib/go/src/bytes/buffer.go:173 +0x23f io/ioutil.readAll(0x7fe5476c8080, 0xc8203885a0, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0) /usr/lib/go/src/io/ioutil/ioutil.go:33 +0x154 io/ioutil.ReadAll(0x7fe5476c8080, 0xc8203885a0, 0x0, 0x0, 0x0, 0x0, 0x0) /usr/lib/go/src/io/ioutil/ioutil.go:42 +0x51 github.com/bnagy/crashwalk/gdb.(_Engine).Run(0x7ab398, 0xc82047e5d0, 0x3, 0x3, 0xc8203a74d0, 0x25, 0x1f4, 0x5, 0x0, 0x0, ...) /home/chris/Code/Go/src/github.com/bnagy/crashwalk/gdb/gdb.go:479 +0x1097 github.com/bnagy/crashwalk.process(0xc8200652b0, 0xc82009c180, 0xc82009c0c0, 0xc8200a0140) /home/chris/Code/Go/src/github.com/bnagy/crashwalk/crashwalk.go:372 +0x15f9 created by github.com/bnagy/crashwalk.(*Crashwalk).Run /home/chris/Code/Go/src/github.com/bnagy/crashwalk/crashwalk.go:540 +0x4b0

goroutine 21 [syscall]: syscall.Syscall(0x0, 0x3, 0xc8204758be, 0x542, 0x6c, 0x5ae, 0x0) /usr/lib/go/src/syscall/asm_linux_amd64.s:18 +0x5 syscall.read(0x3, 0xc8204758be, 0x542, 0x542, 0x6c, 0x0, 0x0) /usr/lib/go/src/syscall/zsyscall_linux_amd64.go:783 +0x5f syscall.Read(0x3, 0xc8204758be, 0x542, 0x542, 0x6c, 0x0, 0x0) /usr/lib/go/src/syscall/syscall_unix.go:160 +0x4d os.(_File).read(0xc82002e2c0, 0xc8204758be, 0x542, 0x542, 0x6c, 0x0, 0x0) /usr/lib/go/src/os/file_unix.go:211 +0x53 os.(_File).Read(0xc82002e2c0, 0xc8204758be, 0x542, 0x542, 0x6c, 0x0, 0x0) /usr/lib/go/src/os/file.go:95 +0x8a bytes.(_Buffer).ReadFrom(0xc82004ae08, 0x7fe5476c8080, 0xc82002e2c0, 0xbe, 0x0, 0x0) /usr/lib/go/src/bytes/buffer.go:173 +0x23f io/ioutil.readAll(0x7fe5476c8080, 0xc82002e2c0, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0) /usr/lib/go/src/io/ioutil/ioutil.go:33 +0x154 io/ioutil.ReadAll(0x7fe5476c8080, 0xc82002e2c0, 0x0, 0x0, 0x0, 0x0, 0x0) /usr/lib/go/src/io/ioutil/ioutil.go:42 +0x51 github.com/bnagy/crashwalk/gdb.(_Engine).Run(0x7ab398, 0xc82047e450, 0x3, 0x3, 0xc82047e3f0, 0x25, 0x1f4, 0x5, 0x0, 0x0, ...) /home/chris/Code/Go/src/github.com/bnagy/crashwalk/gdb/gdb.go:479 +0x1097 github.com/bnagy/crashwalk.process(0xc8200652b0, 0xc82009c180, 0xc82009c0c0, 0xc8200a0140) /home/chris/Code/Go/src/github.com/bnagy/crashwalk/crashwalk.go:372 +0x15f9 created by github.com/bnagy/crashwalk.(*Crashwalk).Run /home/chris/Code/Go/src/github.com/bnagy/crashwalk/crashwalk.go:540 +0x4b0

goroutine 22 [chan send]: github.com/bnagy/crashwalk.(_Crashwalk).Run.func2.1(0xc82047e6f0, 0x25, 0x7fe54919b298, 0xc820080eb0, 0x0, 0x0, 0x0, 0x0) /home/chris/Code/Go/src/github.com/bnagy/crashwalk/crashwalk.go:583 +0x316 path/filepath.walk(0xc82047e6f0, 0x25, 0x7fe54919b298, 0xc820080eb0, 0xc8200bcf80, 0x0, 0x0) /usr/lib/go/src/path/filepath/path.go:349 +0x80 path/filepath.walk(0x7ffe932a0123, 0x1, 0x7fe54919b298, 0xc8200ce000, 0xc8200bcf80, 0x0, 0x0) /usr/lib/go/src/path/filepath/path.go:374 +0x4fc path/filepath.Walk(0x7ffe932a0123, 0x1, 0xc8200bcf80, 0x0, 0x0) /usr/lib/go/src/path/filepath/path.go:396 +0xe1 github.com/bnagy/crashwalk.(_Crashwalk).Run.func2(0xc8200652b0, 0xc82009c180) /home/chris/Code/Go/src/github.com/bnagy/crashwalk/crashwalk.go:586 +0x4e created by github.com/bnagy/crashwalk.(*Crashwalk).Run /home/chris/Code/Go/src/github.com/bnagy/crashwalk/crashwalk.go:590 +0x4e9

goroutine 23 [semacquire, 5 minutes]: sync.runtime_Semacquire(0xc8200a014c) /usr/lib/go/src/runtime/sema.go:43 +0x26 sync.(_WaitGroup).Wait(0xc8200a0140) /usr/lib/go/src/sync/waitgroup.go:126 +0xb4 github.com/bnagy/crashwalk.(_Crashwalk).Run.func3(0xc8200a0140, 0xc82009e1c0, 0xc82009c0c0, 0xc8200652b0) /home/chris/Code/Go/src/github.com/bnagy/crashwalk/crashwalk.go:594 +0x21 created by github.com/bnagy/crashwalk.(*Crashwalk).Run /home/chris/Code/Go/src/github.com/bnagy/crashwalk/crashwalk.go:601 +0x52c

bnagy commented 8 years ago

You've snipped the only useful piece of information :)

It looks like there is no gdb output. Try running the exact command (gdb with all the args listed under COMMAND) and see if it is erroring out?

chrisbdaemon commented 8 years ago

The issue came from the executable timing out. The only output from gdb was <EXPLOITABLE> which caused the parser to panic and blow up. Increasing the timeout is serving as a workaround but probably isn't the best option either.

bnagy commented 8 years ago

Uh.. I can't tell if this is on the GH issue or not, or if it's still a problem. I'm happy to help if you mail me at ben at iagu dot net :)

On Sat, Jun 18, 2016 at 7:16 AM, chrisbdaemon notifications@github.com wrote:

The issue came from the executable timing out. The only output from gdb was which caused the parser to panic and blow up. Increasing the timeout is serving as a workaround but probably isn't the best option either.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bnagy/crashwalk/issues/13#issuecomment-226889260, or mute the thread https://github.com/notifications/unsubscribe/AAbtbGG2DfUDTgL4JZnOwIrPEZ1U_oy6ks5qMxW4gaJpZM4H5FMo .