Skip to content

cmd/nm: crash while processing pe executable built by gcc #7738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alexbrainman opened this issue Apr 9, 2014 · 4 comments
Closed

cmd/nm: crash while processing pe executable built by gcc #7738

alexbrainman opened this issue Apr 9, 2014 · 4 comments
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.

Comments

@alexbrainman
Copy link
Member

Build this

#include <stdio.h>

int main(int argc, char *argv[])
{
    printf("hello\n");
}

C program, by gcc

gcc a.c

Then try to read its symbols with Go nm command:

# go tool nm a.exe
panic: runtime error: index out of range

goroutine 16 [running]:
runtime.panic(0x813bca0, 0x81f533c)
        /root/go/root/src/pkg/runtime/panic.c:279 +0xd7
main.peSymbols(0x18434150, 0x0, 0x0, 0x0)
        /root/go/root/src/cmd/nm/pe.go:27 +0x433
main.nm(0xbfb4c225, 0x5)
        /root/go/root/src/cmd/nm/nm.go:129 +0x286
main.main()
        /root/go/root/src/cmd/nm/nm.go:75 +0x133

goroutine 17 [runnable]:
runtime.MHeap_Scavenger()
        /root/go/root/src/pkg/runtime/mheap.c:507
runtime.goexit()
        /root/go/root/src/pkg/runtime/proc.c:1426

goroutine 18 [runnable]:
bgsweep()
        /root/go/root/src/pkg/runtime/mgc0.c:1930
runtime.goexit()
        /root/go/root/src/pkg/runtime/proc.c:1426

goroutine 19 [runnable]:
runfinq()
        /root/go/root/src/pkg/runtime/mgc0.c:2548
runtime.goexit()
        /root/go/root/src/pkg/runtime/proc.c:1426

# hg id
7be69c14d0f3 tip

a.exe also attached.

Alex

Attachments:

  1. a.exe (48112 bytes)
@ianlancetaylor
Copy link
Member

Comment 1:

Labels changed: added repo-main, release-none, suggested.

@gopherbot
Copy link
Contributor

Comment 2:

CL https://golang.org/cl/85240046 mentions this issue.

@gopherbot
Copy link
Contributor

Comment 3:

CL https://golang.org/cl/87500043 mentions this issue.

@alexbrainman
Copy link
Member Author

Comment 4:

fixed by 
*** Submitted as https://code.google.com/p/go/source/detail?r=a6fc6a6b22ca ***
cmd/nm: windows pe handling fixes
- output absolute addresses, not relative;
- accept negative section numbers.
Update issue #6936
Fixes issue #7738
LGTM=rsc
R=golang-codereviews, bradfitz, ruiu, rsc
CC=golang-codereviews
https://golang.org/cl/85240046
Committer: Russ Cox <rsc@golang.org>

Status changed to Fixed.

@alexbrainman alexbrainman added fixed Suggested Issues that may be good for new contributors looking for work to do. labels May 14, 2014
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

3 participants