Bug 1192721 - Fix debugging - fix runtime-gdb.py
Summary: Fix debugging - fix runtime-gdb.py
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: golang
Version: 23
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Vincent Batts
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-14 17:20 UTC by Jan Kratochvil
Modified: 2015-08-27 19:09 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-27 19:09:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Fedora packaging + runtime-gdb.py fix (15.26 KB, patch)
2015-02-14 17:20 UTC, Jan Kratochvil
no flags Details | Diff
Fedora packaging + runtime-gdb.py fix #2 (15.26 KB, patch)
2015-02-14 18:23 UTC, Jan Kratochvil
no flags Details | Diff
/etc/gdbinit.d/golang.gdb fix (269 bytes, patch)
2015-02-21 17:44 UTC, Jan Kratochvil
no flags Details | Diff

Description Jan Kratochvil 2015-02-14 17:20:58 UTC
Created attachment 991759 [details]
Fedora packaging + runtime-gdb.py fix

Description of problem:
Currently golang GDB support script is not loaded at all.  Load it and fix its obsolete parts.

Version-Release number of selected component (if applicable):
golang-1.4.1-1.fc22.x86_64

How reproducible:
Always.

Steps to Reproduce:
$ gdb golang-produced binary
(gdb) start
(gdb) info goroutines 
(gdb) goroutine 4 bt

Actual results:
Undefined info command: "goroutines".  Try "help info".

Expected results:
Loading Go Runtime support.
(gdb) start
[...]
(gdb) info goroutines 
* 1 running  fname=runtime.switchtoM faddr=0x437a60 &g=0xc208000120 
  2 runnable fname=runtime.forcegchelper faddr=0x412010 &g=0xc208000480 
  3 runnable fname=runtime.bgsweep faddr=0x40dcd0 &g=0xc2080005a0 
  4 runnable fname=runtime.runfinq faddr=0x40d3f0 &g=0xc2080006c0 
(gdb) goroutine 4 bt
#0  runtime.runfinq () at /usr/lib/golang/src/runtime/malloc.go:712
#1  0x0000000000439ca1 in runtime.goexit () at /usr/lib/golang/src/runtime/asm_amd64.s:2232
#2  0x0000000000000000 in ?? ()

Additional info:
Probably some interfaces pretty printer there also needs to be fixed.
Backtraces need to be fixed etc.
https://sourceware.org/gdb/wiki/GoDebugging

Comment 1 Jan Kratochvil 2015-02-14 17:26:08 UTC
After rebuild of golang using for tests:

rpm -e --nodeps golang golang-src golang-pkg-bin-linux-amd64;rpm -i golang-1.4.1-1.fc22.x86_64.rpm golang-src-1.4.1-1.fc22.noarch.rpm golang-pkg-bin-linux-amd64-1.4.1-1.fc22.x86_64.rpm;alternatives --set go /usr/lib/golang/bin/linux_amd64/go

Comment 2 Jan Kratochvil 2015-02-14 18:23:45 UTC
Created attachment 991771 [details]
Fedora packaging + runtime-gdb.py fix #2

Comment 3 Jan Kratochvil 2015-02-21 17:44:28 UTC
Created attachment 994184 [details]
/etc/gdbinit.d/golang.gdb fix

The Comment 2 patch is still valid for golang-1.4.x but otherwise upstream (1.5) has already implemented almost all of the fixes in last month.

The remaining tiny ones I have posted as:
  https://go-review.googlesource.com/#/c/5522/
  https://go-review.googlesource.com/#/c/5521/

This attachment still needs to be applied even for future golang-1.5 as it is Fedora GDB specific packaging: /etc/gdbinit.d/golang.gdb

Comment 4 Jan Kurik 2015-07-15 14:32:50 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23

Comment 5 Vincent Batts 2015-08-27 19:09:06 UTC
your upstream commits and the gdb path fix are included in http://koji.fedoraproject.org/koji/taskinfo?taskID=10858659

Thanks!


Note You need to log in before you can comment on or make changes to this bug.