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

[BUG] version check SEGV in toolexec mode on go 1.23 #371

Closed
eliottness opened this issue Oct 30, 2024 · 1 comment · Fixed by #372
Closed

[BUG] version check SEGV in toolexec mode on go 1.23 #371

eliottness opened this issue Oct 30, 2024 · 1 comment · Fixed by #372
Labels
bug Something isn't working

Comments

@eliottness
Copy link
Contributor

eliottness commented Oct 30, 2024

Version of orchestrion

Latest & main

Describe what happened:

The call tools/packages.Load will return with no errors with pkg.Module being nil. This being not checked create this error:

❯ go test -v -tags=integration,buildtag -shuffle=on -toolexec "$PWD/../orchestrion toolexec" ./tests/redigo
# github.com/docker/docker/errdefs
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xdeaed6]

goroutine 1 [running]:
github.com/DataDog/orchestrion/internal/ensure.goModVersion({0x0?, 0xc00023bc38?})
        /home/eliott/dd/orchestrion/internal/ensure/requiredversion.go:150 +0x116
github.com/DataDog/orchestrion/internal/ensure.requiredVersion(0x10fb8bf?, 0x11548e0, 0x1155108, {0xc0001b8000, 0xe, 0xe})
        /home/eliott/dd/orchestrion/internal/ensure/requiredversion.go:66 +0x6a
github.com/DataDog/orchestrion/internal/ensure.RequiredVersion(...)
        /home/eliott/dd/orchestrion/internal/ensure/requiredversion.go:44
github.com/DataDog/orchestrion/internal/pin.init.0()
        /home/eliott/dd/orchestrion/internal/pin/pin.go:146 +0x68

Describe what you expected:

I guess we expect orchestrion execution to not happen in this case because we have no way to make sure we are running the right version of orchestrion.

Steps to reproduce the issue:

This issue only happen on certain conditions:

  • Need at least go 1.23
  • Need to use orchestrion in TOOLEXEC mode (meaning with -toolexec, not with orchestrion go ...)
  • Only some packages of the github.com/docker/docker repository are reproductiing this issue

Then running any integration test trying to build github.com/docker/docker reproduce the issue

@eliottness eliottness added the bug Something isn't working label Oct 30, 2024
@eliottness eliottness changed the title [BUG] Self-exec SEGV in toolexec mode on go 1.23 on repository with no go.mod file [BUG] version check SEGV in toolexec mode on go 1.23 Oct 30, 2024
@eliottness
Copy link
Contributor Author

eliottness commented Oct 30, 2024

Ok so for some reasons, on certain builds, the go toolchain is calling go tool vet. And since the version check happen in an init function, it runs before we are able bail out. So we only have to NOT crash and return an error in the version check code and nothing more should be happening

github-merge-queue bot pushed a commit that referenced this issue Nov 4, 2024
Fixes #371 

See golang/go#65816

---------

Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>
Co-authored-by: Romain Marcadier <romain@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant