On Mon, Apr 3, 2023 at 9:26 PM mariappan balraj
<mariappan.bal...@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

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXKqtvRB1CHysZbjeC88pi_tt7LiS4RozWLsV5LHxAszw%40mail.gmail.com.

Reply via email to