From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8BB663858D1E; Tue, 24 Jan 2023 06:54:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BB663858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674543266; bh=zXlnSO6MoSJgj7c3KY4QQniEd4sObhQsWwqJGZogDS4=; h=From:To:Subject:Date:From; b=ofl46pzDJKLe80h3TlFaGD5+8t+gMrPWl3CC/3LyhcfS0To0LLHQFU+RCQogm+uzu lrcnTA/68NR+G6jrcCE6LLsvMoOpX93LQZy77G+nPEI1xi2i9vn8GUXMBnKSDwqdTj TC/XlfnnLHS8eNM2DKHRnmdLf/XwW8GSWtwNcQqU= From: "mariappan.balraj at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug go/30038] New: When using CGO and C code is calling GO function, not getting call stack of C from core dump. Only getting call stack of GO. Date: Tue, 24 Jan 2023 06:54:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: go X-Bugzilla-Version: 12.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: mariappan.balraj at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30038 Bug ID: 30038 Summary: When using CGO and C code is calling GO function, not getting call stack of C from core dump. Only getting call stack of GO. Product: gdb Version: 12.1 Status: UNCONFIRMED Severity: critical Priority: P2 Component: go Assignee: unassigned at sourceware dot org Reporter: mariappan.balraj at gmail dot com Target Milestone: --- Following is the source code: //test.go package main /* #include extern void Test4(void); void test1(void) { Test4(); } void test2(void) { int val =3D 2; test1(); } void test3(void) { int val =3D 3; test2(); } */ import "C" func main() { C.test3() } //export.go import "C" //export Test4 func Test4() { panic("Panic inside Test4") } Process crashed because of PANIC from Test4(). test3() is called from GO code. test3() is calling test2() and which is cal= ling test1() and which is calling Test4() Go function. Not seeing test3(), test2= () and test1() in the back trace of core dump. This is very important for debugging when CGO is used.=20 #gdb ./test core.242083 //Back trace (gdb) bt #0 runtime.raise () at /usr/local/go/src/runtime/sys_linux_amd64.s:159 #1 0x0000000000443385 in runtime.dieFromSignal (sig=3D6) at /usr/local/go/src/runtime/signal_unix.go:871 #2 0x000000000044391e in runtime.sigfwdgo (sig=3D6, info=3D, ctx=3D, ~r0=3D) at /usr/local/go/src/runtime/signal_unix.go:1087 #3 0x0000000000442027 in runtime.sigtrampgo (sig=3D0, info=3D0x0, ctx=3D0x= 458401 ) at /usr/local/go/src/runtime/signal_unix.go:432 #4 0x00000000004586e6 in runtime.sigtramp () at /usr/local/go/src/runtime/sys_linux_amd64.s:359 #5 #6 runtime.raise () at /usr/local/go/src/runtime/sys_linux_amd64.s:159 #7 0x0000000000443385 in runtime.dieFromSignal (sig=3D6) at /usr/local/go/src/runtime/signal_unix.go:871 #8 0x000000000042f9a9 in runtime.crash () at /usr/local/go/src/runtime/signal_unix.go:963 #9 runtime.fatalpanic (msgs=3D) at /usr/local/go/src/runtime/panic.go:1170 #10 0x000000000042f07a in runtime.gopanic (e=3D...) at /usr/local/go/src/runtime/panic.go:987 #11 0x000000000045ac07 in main.Test4 () at /home/ubuntu/mbalraj/GO/TEST/TEST4/export.go:7 #12 _cgoexp_040b784f82f8_Test4 (a=3D) at _cgo_gotypes.go:51 #13 0x0000000000404a82 in runtime.cgocallbackg1 (fn=3D0x45abe0 <_cgoexp_040b784f82f8_Test4>, frame=3D0x7fff8d239d27, ctxt=3D0) at /usr/local/go/src/runtime/cgocall.go:316 #14 0x0000000000404709 in runtime.cgocallbackg (fn=3D0x45abe0 <_cgoexp_040b784f82f8_Test4>, frame=3D0x7fff8d239d27, ctxt=3D0) at /usr/local/go/src/runtime/cgocall.go:235 #15 0x0000000000458d8f in runtime.cgocallbackg (fn=3D0x45abe0 <_cgoexp_040b784f82f8_Test4>, frame=3D0x7fff8d239d27, ctxt=3D0) at :1 #16 0x0000000000456934 in runtime.cgocallback () at /usr/local/go/src/runtime/asm_amd64.s:994 #17 0x0000000000456600 in ?? () #18 0x0000000000404585 in runtime.cgocall (fn=3D0x45acb0 <_cgo_040b784f82f8_Cfunc_test3>, arg=3D0xc000058f70, ~r0=3D)= at /usr/local/go/src/runtime/cgocall.go:168 #19 0x000000000045ab85 in main._Cfunc_test3 (r1=3D...) at _cgo_gotypes.go:41 #20 0x000000000045abb7 in main.main () at /home/ubuntu/mbalraj/GO/TEST/TEST4/test.go:25 --=20 You are receiving this mail because: You are on the CC list for the bug.=