|
Jefflund |
at Jan 24, 2014 at 4:38 pm
|
⇧ |
| |
On Friday, January 24, 2014 7:42:36 AM UTC-7, Ian Lance Taylor wrote:On Fri, Jan 24, 2014 at 12:07 AM, <jeff...@gmail.com <javascript:>>
wrote:
Occasionally I will do something silly and crash with error messages like
this:
panic: runtime error: index out of range
goroutine 1 [syscall]:
syscall.Syscall()
/usr/lib64/golang/src/pkg/syscall/asm_linux_amd64.s:16 +0x5
That is the message in its entirety. Upon further debugging with liberal
print calls,
I can find the source of the errors, but what I don't understand is why the
stack
trace only includes this low level call and not my own calls which caused
the panic.
Shouldn't the stack trace include...well the trace? What am I doing wrong
here?
Yes, I would expect the stack trace to show more. Without more
information it's hard to know what is going wrong. One thing you can
try is setting the environment variable GOTRACEBACK to 2 when running
the program.
Ian
With GOTRACEBACK=2 I get:
panic: runtime error: index out of range
goroutine 1 [syscall]:
syscall.Syscall()
/usr/lib64/golang/src/pkg/syscall/asm_linux_amd64.s:16 +0x5
goroutine 2 [syscall]:
runtime.entersyscallblock()
/usr/lib64/golang/src/pkg/runtime/proc.c:1334 +0x16e
runtime.MHeap_Scavenger()
/usr/lib64/golang/src/pkg/runtime/mheap.c:454 +0xee
runtime.goexit()
/usr/lib64/golang/src/pkg/runtime/proc.c:1223
created by runtime.main
/usr/lib64/golang/src/pkg/runtime/proc.c:165
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit
https://groups.google.com/groups/opt_out.