On Mon, Apr 3, 2023 at 9:26 PM mariappan balraj
<
mariappa...@gmail.com> wrote:
>
> Hi Kurtis Rader,
>
> Thanks for your response. I am working on it. I will quickly share it. Before that one more update. I have commented the below two lines. Now from the core, I am able to see the correct stack trace.
>
> 326 func unwindm(restore *bool) {
> 327 if *restore {
> 328 // Restore sp saved by cgocallback during
> 329 // unwind of g's stack (see comment at top of file).
> 330 mp := acquirem()
> 331 //sched := &mp.g0.sched
> 332 //sched.sp = *(*uintptr)(unsafe.Pointer(sched.sp + alignUp(sys.MinFrameSize, sys.StackAlign)))
> 333
> 334 // Do the accounting that cgocall will not have a chance to do
> 335 // during an unwind.
> 336 //
> 337 // In the case where a Go call originates from C, ncgo is 0
> 338 // and there is no matching cgocall to end.
> 339 if mp.ncgo > 0 {
> 340 mp.incgo = false
> 341 mp.ncgo--
> 342 osPreemptExtExit(mp)
> 343 }
> 344
> 345 releasem(mp)
> 346 }
> 347 }
Just a note that in general we can't make that change, as it will
break the case where a Go function calls a C function calls a Go
function and that Go function calls panic.
Ian