Skip to content
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

dist: strip debug information in release version #5450

Closed
dlintw opened this issue May 13, 2013 · 10 comments
Closed

dist: strip debug information in release version #5450

dlintw opened this issue May 13, 2013 · 10 comments

Comments

@dlintw
Copy link

dlintw commented May 13, 2013

I don't know is it still worth to release 'debug info' in the binary file.  But, I never
use it. And guess it is not necessary for end users.

Here I just shows go/bin/ required to strip, but I don't know is there any other files
should do too.

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Download from official download site

Which operating system are you using?
any

Which version are you using?  (run 'go version')
1.1rc3

Please provide any additional information below.
$ ls -l
total 14548
-rwxr-xr-x 1 dlin users 5769193 Sep 24  2012 go*
-rwxr-xr-x 1 dlin users 6759800 Sep 24  2012 godoc*
-rwxr-xr-x 1 dlin users 2360332 Sep 24  2012 gofmt*

$ file go godoc gofmt
go:    ELF 32-bit LSB  executable, Intel 80386, version 1 (SYSV), dynamically linked
(uses shared libs), not stripped
godoc: ELF 32-bit LSB  executable, Intel 80386, version 1 (SYSV), dynamically linked
(uses shared libs), not stripped
gofmt: ELF 32-bit LSB  executable, Intel 80386, version 1 (SYSV), statically linked, not
stripped
$ strip go godoc gofmt
$ ls -l
total 10808
-rwxr-xr-x 1 dlin users 4298728 May 13 13:49 go*
-rwxr-xr-x 1 dlin users 5039632 May 13 13:49 godoc*
-rwxr-xr-x 1 dlin users 1723392 May 13 13:49 gofmt*
@remyoudompheng
Copy link
Contributor

Comment 1:

Why do you think it's not needed?

@dlintw
Copy link
Author

dlintw commented May 13, 2013

Comment 2:

To remyoudo...,
I support, go,godoc,gofmt is just utility.
For Go end users, we don't require to debug into compiler/utility.

@remyoudompheng
Copy link
Contributor

Comment 3:

Stripping binaries is not tested and not guaranteed to work by anyone. It might lead to
strange bugs, and previous attempts have resulted in crashes and buggy executables.
See issue #5200 for example.
So it is a dangerous change and it should not be done so late in the Go 1.1 release
process.
Also end users encounter bugs, so they are required to debug.

@dlintw
Copy link
Author

dlintw commented May 13, 2013

Comment 4:

In fact, as a Go end user. I prefer to strip more debug info in the my Go built binary.
https://golang.org/issue/3467

@dlintw
Copy link
Author

dlintw commented May 13, 2013

Comment 5:

OK, in my case, I often build Go from source on x86_64. And stripped the binary, it
works. But, I don't know is that workable for everyone on x86_64, so I was assume it
should be tested on rcX version.

@dominikh
Copy link
Member

Comment 6:

I don't think it is worth stripping in the first place. The reduction in size is minimal
and there aren't any benefits to it. Not for the Go distribution itself.

@dlintw
Copy link
Author

dlintw commented May 13, 2013

Comment 7:

I think, it just like Go's compiler did not allow 'variable unused'.  If every package
packer treated 3MB(at least) is nothing.  Then a linux distribution may added 300MB and
waste much energy in the earth.  My opinion is: if it is useful, then keep it.  If the
Go developers think it won't be use, then remove it is better.

@minux
Copy link
Member

minux commented May 13, 2013

Comment 8:

please see https://golang.org/issue/5200?c=21
we still have at least two bugs concerning stripped binaries,
so don't do that, it's not guaranteed to work.

@dlintw
Copy link
Author

dlintw commented May 13, 2013

Comment 9:

Hi, minux, only ARM will occurs such problem? (I don't know another issue number).  I
agreed don't do this strip in Go 1.1 final.  There are only a few testing period.

@adg
Copy link
Contributor

adg commented May 13, 2013

Comment 10:

I don't see the point. It will just make it harder to track down issues when debugging
is needed. (Our tools sometimes have bugs.)

Status changed to WontFix.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants