I can’t even tell which goroutine is at fault. Is the top most listed goroutine supposed to be the bad guy? Does signal 0xb mean it’s a SIGSEGV? Is there a way that I can use printf to debug the situation? Or do I have to use a debugger such as gdb? (I really know close to zero about gdb.)
BTW, when I have Chinese/Japanese in the path name, and also uses cgo, then golang runtime cannot get the path correct. For example, panic outputs prints wrong path, and runtime.Caller() returns bad path, etc. This has troubled me for quite a few months now.
The faulting goroutine is at the top. It caused the problem.
0xb is sigbus, which is caused by dereferencing a field of a pointer which is nil. The faulting address is 8, so 8 bytes beyond the start of the structure.
You cut off important part of the stack trace which tells you where in your code the fault happened. Upload the full trace for that goroutine and we can probably tell you what went wrong.
It’s a race condition now resolved. I had a number of destroy operations hooked upon various channel closes and I failed to see that, when I close those channels one after another, those destroy operations would be in a race!