go build prints gc traces

93 views
Skip to first unread message

jan.f...@gmail.com

unread,
Sep 13, 2021, 5:09:14 PM9/13/21
to golang-nuts
Hi everyone!

Since I upgraded to Go 1.17.1 on macOS, it seems like whenever I run the compiler, it prints out GC traces just like it was invoked with GODEBUG=gctrace=1.

It might look like this:

$ go build main.go
# github.com/pion/dtls/v2/pkg/crypto/clientcertificate
gc 1 @0.004s 6%: 0.012+1.8+0.013 ms clock, 0.077+0.11/2.1/1.4+0.079 ms cpu, 4->4->3 MB, 5 MB goal, 6 P
# github.com/pion/dtls/v2/pkg/crypto/signature
gc 1 @0.003s 4%: 0.008+1.6+0.087 ms clock, 0.051+0.081/0.91/2.0+0.52 ms cpu, 4->4->3 MB, 5 MB goal, 6 P
...
Many more lines omitted

I cannot for my world understand what is causing this. The GODEBUG environment variable is not set, and I also have no aliases in the shell that could explain this.

Went back to Go 1.16.8 and the problem is gone. Also built my own tool chain from the 1.17 release branch of https://github.com/golang/go.git, and it gives me the same behavior, by printing out GC traces.

I must be missing something really simple, so does anyone have any ideas?

Regards
    //Jan Flyborg

jan.f...@gmail.com

unread,
Sep 13, 2021, 5:40:12 PM9/13/21
to golang-nuts
Hi again,

Removed ~/Library/Caches/go-build and the problem is now gone. Still I would like to know what caused this.

Regards
    //Jan Flyborg

Ian Lance Taylor

unread,
Sep 13, 2021, 8:48:15 PM9/13/21
to jan.f...@gmail.com, golang-nuts
On Mon, Sep 13, 2021 at 2:40 PM jan.f...@gmail.com
<jan.f...@gmail.com> wrote:
>
> Removed ~/Library/Caches/go-build and the problem is now gone. Still I would like to know what caused this.

Sounds related to https://golag.org/issue/27628. The build cache
caches the output of the tools. You may have gotten a build cache
entry with GODEBUG set, and that kept being used even though GODEBUG
was not set later.

Ian


> måndag 13 september 2021 kl. 23:09:14 UTC+2 skrev jan.f...@gmail.com:
>>
>> Hi everyone!
>>
>> Since I upgraded to Go 1.17.1 on macOS, it seems like whenever I run the compiler, it prints out GC traces just like it was invoked with GODEBUG=gctrace=1.
>>
>> It might look like this:
>>
>> $ go build main.go
>> # github.com/pion/dtls/v2/pkg/crypto/clientcertificate
>> gc 1 @0.004s 6%: 0.012+1.8+0.013 ms clock, 0.077+0.11/2.1/1.4+0.079 ms cpu, 4->4->3 MB, 5 MB goal, 6 P
>> # github.com/pion/dtls/v2/pkg/crypto/signature
>> gc 1 @0.003s 4%: 0.008+1.6+0.087 ms clock, 0.051+0.081/0.91/2.0+0.52 ms cpu, 4->4->3 MB, 5 MB goal, 6 P
>> ...
>> Many more lines omitted
>>
>> I cannot for my world understand what is causing this. The GODEBUG environment variable is not set, and I also have no aliases in the shell that could explain this.
>>
>> Went back to Go 1.16.8 and the problem is gone. Also built my own tool chain from the 1.17 release branch of https://github.com/golang/go.git, and it gives me the same behavior, by printing out GC traces.
>>
>> I must be missing something really simple, so does anyone have any ideas?
>>
>> Regards
>> //Jan Flyborg
>>
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/aeffe934-b71c-4fc6-915b-f740eeb00eean%40googlegroups.com.

jan.f...@gmail.com

unread,
Sep 14, 2021, 3:21:13 AM9/14/21
to golang-nuts
tisdag 14 september 2021 kl. 02:48:15 UTC+2 skrev Ian Lance Taylor:
Sounds related to https://golag.org/issue/27628. The build cache
caches the output of the tools. You may have gotten a build cache
entry with GODEBUG set, and that kept being used even though GODEBUG
was not set later.

That explains it. Thanks.

Regards
    //Jan Flyborg
Reply all
Reply to author
Forward
0 new messages