Thanks and Sorry for not providing more details. I'm on 1.9. No unsafe package is used. Main program is a c program which calls into go functions where some analytics are performed.
All calls to the golang use only strings and ints/floats/char. No structs are passed. In Go all strings are converted to go strings using C.GoString, while int/doubles/chars are converted to values using int64(x) float64(x) uint8(x), etc.. Ok, will run with the debug commands you provided. On Friday, September 15, 2017 at 1:23:37 PM UTC-4, Ian Lance Taylor wrote: > > On Fri, Sep 15, 2017 at 7:30 AM, <webus...@gmail.com <javascript:>> > wrote: > > > > This program runs for about an hour and consumes about 1Gig of memory. I > was > > getting a lot of these errors, but they were significantly reduced when > I > > reduced the golang memory usage. (by reducing the in memory state that > I > > was keeping) > > > > Any idea on how I can go about debugging this? > > You neglected to tell us which version of Go you are running. If it's > 1.9 then it looks like some form of memory corruption. Have you tried > running the program under the race detector? Do you use the unsafe > package, or cgo? If you use cgo, try running with GODEBUG=cgocheck=2. > Either way, try running with GODEBUG=gccheckmark=1. With luck those > may help you focus in on where the problem occurs. > > Ian > > > > > > ---------------------------------- > > > > fatal error: unexpected signal during runtime execution > > [signal SIGSEGV: segmentation violation code=0x1 addr=0x9 pc=0x427b64] > > > > runtime stack: > > runtime.throw(0x687143, 0x2a) > > /go/src/runtime/panic.go:605 +0x97 > > runtime.sigpanic() > > /go/src/runtime/signal_unix.go:351 +0x2bc > > runtime.newArenaMayUnlock(0xad3800) > > /go/src/runtime/mheap.go:1683 +0x34 > > runtime.newMarkBits(0x55, 0x55) > > /go/src/runtime/mheap.go:1598 +0xb5 > > runtime.(*mspan).sweep(0x7fd0c05133a0, 0xc420000f00, 0xc420000f00) > > /go/src/runtime/mgcsweep.go:311 +0x4ed > > runtime.sweepone(0x4355e8) > > /go/src/runtime/mgcsweep.go:113 +0x126 > > runtime.gosweepone.func1() > > /go/src/runtime/mgcsweep.go:137 +0x2d > > runtime.systemstack(0xc4204964b8) > > /go/src/runtime/asm_amd64.s:344 +0x72 > > runtime.mstart() > > /go/src/runtime/proc.go:1125 > > > > goroutine 3 [running]: > > runtime.systemstack_switch() > > /go/src/runtime/asm_amd64.s:298 fp=0xc42003ef70 sp=0xc42003ef68 > pc=0x458730 > > runtime.gosweepone(0x0) > > /go/src/runtime/mgcsweep.go:136 +0x4c fp=0xc42003efa0 sp=0xc42003ef70 > > pc=0x4223cc > > runtime.bgsweep(0xc420070000) > > /go/src/runtime/mgcsweep.go:55 +0xc1 fp=0xc42003efd8 sp=0xc42003efa0 > > pc=0x421ee1 > > runtime.goexit() > > /go/src/runtime/asm_amd64.s:2337 +0x1 fp=0xc42003efe0 sp=0xc42003efd8 > > pc=0x45b351 > > created by runtime.gcenable > > /go/src/runtime/mgc.go:216 +0x5a > > > > goroutine 6 [chan receive, 9 minutes]: > > database/sql.(*DB).connectionOpener(0xc4200c5040) > > /go/src/database/sql/sql.go:871 +0x55 > > created by database/sql.Open > > /go/src/database/sql/sql.go:609 +0x1f0 > > > > goroutine 17 [running, locked to thread]: > > goroutine running on other thread; stack unavailable > > > > goroutine 5 [chan receive, 2 minutes]: > > github.com/golang/glog.(*loggingT).flushDaemon(0xad3b80) > > /src/github.com/golang/glog/glog.go:879 +0xa1 > > created by github.com/golang/glog.init.0 > > /src/github.com/golang/glog/glog.go:410 +0x205 > > > > > > -- > > 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...@googlegroups.com <javascript:>. > > For more options, visit https://groups.google.com/d/optout. > -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.