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

Alloy when compiled with go 1.23 crashes #1540

Closed
bschnei opened this issue Aug 23, 2024 · 8 comments
Closed

Alloy when compiled with go 1.23 crashes #1540

bschnei opened this issue Aug 23, 2024 · 8 comments
Labels
bug Something isn't working frozen-due-to-age

Comments

@bschnei
Copy link

bschnei commented Aug 23, 2024

What's wrong?

Attempting to run alloy 1.3.1 produces the following error:

panic: pattern "GET /debug/pprof/" (registered at /usr/lib/go/src/net/http/pprof/pprof.go:100) conflicts with pattern "/debug/pprof/delta_heap" (registered at /home/ben/repos/aur/grafana-alloy/src/pkg/mod/github.com/grafana/pyroscope-go/[email protected]/http/pprof/pprof.go:24):
	GET /debug/pprof/ matches fewer methods than /debug/pprof/delta_heap, but has a more general path pattern

goroutine 1 [running]:
net/http.(*ServeMux).register(...)
	/usr/lib/go/src/net/http/server.go:2797
net/http.HandleFunc({0xc002f3baa0?, 0x80b1934?}, 0x6e3b9e0?)
	/usr/lib/go/src/net/http/server.go:2791 +0x86
net/http/pprof.init.0()
	/usr/lib/go/src/net/http/pprof/pprof.go:100 +0x85

This error is new as of v1.3.1 and was not experienced following the same build process with v1.3.

Steps to reproduce

  1. clone v1.3.1 from github
  2. make alloy to compile
  3. ./build/alloy --version to test

System information

Linux 6.10.6

Software version

v1.3.1

Configuration

GOEXPERIMENT= GOOS=linux GOARCH=amd64 GOARM= CGO_ENABLED=1 go build  -ldflags "-X github.com/grafana/alloy/internal/build.Branch=makepkg -X github.com/grafana/alloy/internal/build.Version=v1.3.1 -X github.com/grafana/alloy/internal/build.Revision=e4979b2a2 -X github.com/grafana/alloy/internal/build.BuildUser=ben@desky -X github.com/grafana/alloy/internal/build.BuildDate=2024-08-23T17:00:54Z" -tags "" -o build/alloy .

Logs

No response

@bschnei bschnei added the bug Something isn't working label Aug 23, 2024
@jkroepke
Copy link
Contributor

Having the same error, running from source

panic: pattern "GET /debug/pprof/" (registered at C:/Program Files/Go/src/net/http/pprof/pprof.go:100) conflicts with pattern "/debug/pprof/delta_heap" (registered at C:/Users/jok/go/pkg/mod/github.com/grafana/pyroscope-go/[email protected]/http/pprof/pprof.go:24):
        GET /debug/pprof/ matches fewer methods than /debug/pprof/delta_heap, but has a more general path pattern

goroutine 1 [running]:
net/http.(*ServeMux).register(...)
        C:/Program Files/Go/src/net/http/server.go:2797
net/http.HandleFunc({0xc001fc6288?, 0x7ff7cb45ef8a?}, 0x7ff7ca2ab260?)
        C:/Program Files/Go/src/net/http/server.go:2791 +0x86
net/http/pprof.init.0()
        C:/Program Files/Go/src/net/http/pprof/pprof.go:100 +0x85

@defanator
Copy link
Contributor

Downgrading to go 1.22 fixed this for me. The issue seems to be somewhere in go 1.23.

(I tried multiple versions of alloy, every single one was panic'ing with the same result if built with go 1.23.)

@defanator
Copy link
Contributor

See also grafana/agent#6972.

@bschnei bschnei changed the title v1.3.1 built from github source is crashing v1.3.1 compiled with go>1.22 crashes Aug 24, 2024
@bschnei
Copy link
Author

bschnei commented Aug 24, 2024

@defanator confirmed. Title updated. Thank you!

@SpectatorNan
Copy link

image
the same in 1.22.6

@bschnei
Copy link
Author

bschnei commented Aug 24, 2024

Hm. I built with go 1.22.5 and didn't get the error. Perhaps there was a breaking change in go from .5 to .6?! In any case, it seems like grafana has been addressing the issue on their side: https://github.com/grafana/pyroscope-go/releases/tag/godeltaprof%2Fv0.1.8

@mattdurham
Copy link
Collaborator

Fixed by forcing go 1.22 in the brew formula. Will keep this open so in 1.4 when we update go to 1.23 it doesnt get lost in the shuffle. (Though since that would affect everything everywhere it would be hard to miss!). This was caused by depends_on go pull 1.23. Changed to depends_on [email protected].

@mattdurham mattdurham changed the title v1.3.1 compiled with go>1.22 crashes Alloy when compiled with go 1.23 crashes Aug 26, 2024
@bschnei
Copy link
Author

bschnei commented Sep 25, 2024

This is no longer an issue in v1.4.0.

@bschnei bschnei closed this as completed Sep 25, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working frozen-due-to-age
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants