Strange, intermittent panic issues

157 views
Skip to first unread message

brik...@gmail.com

unread,
Dec 6, 2016, 5:00:37 PM12/6/16
to golang-nuts
Hi folks,

We're using Go to write an open source CLI tool called terragrunt. We cross-compile binaries for the tool for multiple OS's. Some of the users are reporting intermittent crashes due to mysterious panic errors. Here are two examples:
The panics seem to happen in strange places. For example, one happens deep in a call to the Printf method of a logger. Another in malloc.

We're at a loss for how to debug these as this doesn't seem to be caused by the usual culprits (e.g. a nil in the code) and can only be reproduced intermittently. Any suggestions?

Thanks,
Jim

Tamás Gulácsi

unread,
Dec 6, 2016, 5:27:29 PM12/6/16
to golang-nuts
Compile with -race flag, and run that binary, and "go test -race", to eliminate the most possible reason: data race.

r...@golang.org

unread,
Dec 6, 2016, 5:29:45 PM12/6/16
to golang-nuts, brik...@gmail.com

0xb01dfacedebac1e is a poison pill that usually indicates misuse of unsafe.Pointer.
If there is any use of unsafe.Pointer or CGO in the program that would be a good
place to start looking.

You can google "0xb01dfacedebac1e" for more details.

brik...@gmail.com

unread,
Dec 6, 2016, 10:52:17 PM12/6/16
to golang-nuts, brik...@gmail.com
0xb01dfacedebac1e is a poison pill that usually indicates misuse of unsafe.Pointer. If there is any use of unsafe.Pointer or CGO in the program that would be a good place to start looking.

Interesting. As far as I know, we don't use unsafe.Pointer or cgo anywhere in the code, but I'll poke around. Maybe some dependency of ours does. 

Also, The particular line of code that leads to one of the panics is deep inside Go logger Printf code, so I'm not sure how anything in my code could lead to that?

Thanks,
Jim

Dave Cheney

unread,
Dec 7, 2016, 1:04:23 AM12/7/16
to golang-nuts, brik...@gmail.com


On Wednesday, 7 December 2016 12:52:17 UTC+9, brik...@gmail.com wrote:
0xb01dfacedebac1e is a poison pill that usually indicates misuse of unsafe.Pointer. If there is any use of unsafe.Pointer or CGO in the program that would be a good place to start looking.

Interesting. As far as I know, we don't use unsafe.Pointer or cgo anywhere in the code, but I'll poke around. Maybe some dependency of ours does. 

Also, The particular line of code that leads to one of the panics is deep inside Go logger Printf code, so I'm not sure how anything in my code could lead to that?

The memory corruption probably happened before that line. If there is a data race in the program, then all bets are off.

brik...@gmail.com

unread,
Dec 7, 2016, 12:41:31 PM12/7/16
to golang-nuts, brik...@gmail.com
Ah, I gotcha. OK, off I go to dig for unsafe.Pointer and cgo usages in a dependency :)

Thanks!
Jim
Reply all
Reply to author
Forward
0 new messages