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

buildkitd SIGSEGV #3040

Closed
spacedub opened this issue Aug 18, 2022 · 1 comment · Fixed by #3043
Closed

buildkitd SIGSEGV #3040

spacedub opened this issue Aug 18, 2022 · 1 comment · Fixed by #3043
Assignees
Milestone

Comments

@spacedub
Copy link

buildkitd running in Lima on macOS (also crashes if in a docker container with Docker Desktop on macOS)

v0.10.3 c8d25d9

Aug 18 01:36:03 lima-codecomet systemd[1]: Starting buildkit.service...
Aug 18 01:36:04 lima-codecomet buildkitd[24847]: time="2022-08-18T01:36:04Z" level=warning msg="using host network as the default"
Aug 18 01:36:04 lima-codecomet buildkitd[24847]: time="2022-08-18T01:36:04Z" level=info msg="found worker \"ls46esfma3579bqbhwmkl3ggf\", labels=map[org.mobyproject.buildkit.worker.containerd.namespace:default org>
Aug 18 01:36:04 lima-codecomet buildkitd[24847]: time="2022-08-18T01:36:04Z" level=info msg="found 1 workers, default=\"ls46esfma3579bqbhwmkl3ggf\""
Aug 18 01:36:04 lima-codecomet buildkitd[24847]: time="2022-08-18T01:36:04Z" level=warning msg="currently, only the default worker can be used."
Aug 18 01:36:04 lima-codecomet buildkitd[24847]: time="2022-08-18T01:36:04Z" level=info msg="running server on /run/buildkit/buildkitd.sock"
Aug 18 01:36:04 lima-codecomet systemd[1]: Started buildkit.service.
Aug 18 01:36:20 lima-codecomet buildkitd[24847]: panic: runtime error: invalid memory address or nil pointer dereference
Aug 18 01:36:20 lima-codecomet buildkitd[24847]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x820244]
Aug 18 01:36:20 lima-codecomet buildkitd[24847]: goroutine 1073 [running]:
Aug 18 01:36:20 lima-codecomet buildkitd[24847]: github.com/moby/buildkit/solver.(*sharedOp).Exec(0x4000b39500, {0x112c900, 0x40010f7900}, {0x40008d9900, 0x1, 0x1})
Aug 18 01:36:20 lima-codecomet buildkitd[24847]:         /src/solver/jobs.go:868 +0x1b4
Aug 18 01:36:20 lima-codecomet buildkitd[24847]: github.com/moby/buildkit/solver.(*edge).execOp(0x40000a8b40, {0x112c900, 0x40010f7900})
Aug 18 01:36:20 lima-codecomet buildkitd[24847]:         /src/solver/edge.go:902 +0x84
Aug 18 01:36:20 lima-codecomet buildkitd[24847]: github.com/moby/buildkit/solver/internal/pipe.NewWithFunction.func2()
Aug 18 01:36:20 lima-codecomet buildkitd[24847]:         /src/solver/internal/pipe/pipe.go:82 +0x40
Aug 18 01:36:20 lima-codecomet buildkitd[24847]: created by github.com/moby/buildkit/solver.(*scheduler).newRequestWithFunc
Aug 18 01:36:20 lima-codecomet buildkitd[24847]:         /src/solver/scheduler.go:290 +0x200
Aug 18 01:36:20 lima-codecomet systemd[1]: buildkit.service: Main process exited, code=exited, status=2/INVALIDARGUMENT

To reproduce:

cat sigsegv.proto | buildctl build

See attached: sigsegv.proto.zip

Although buildctl seems happy with the message (cat sigsegv.proto | buildctl debug dump-llb), I am pretty sure it is somehow not valid (writing a port of LLB that produces these).

Nevertheless, buildkitd should not segfault, right?

Logs with debug=true

Aug 18 01:50:50 lima-codecomet buildkitd[25089]: time="2022-08-18T01:50:50Z" level=debug msg="session started"
Aug 18 01:50:50 lima-codecomet buildkitd[25089]: time="2022-08-18T01:50:50Z" level=debug msg=resolving host=registry-1.docker.io
Aug 18 01:50:50 lima-codecomet buildkitd[25089]: time="2022-08-18T01:50:50Z" level=debug msg="do request" host=registry-1.docker.io request.header.accept="application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, */*" request.header.user-agent=buildkit/v0.10 request.method=HEAD url="https://registry-1.docker.io/v2/library/ubuntu/manifests/16.04"
Aug 18 01:50:50 lima-codecomet buildkitd[25089]: time="2022-08-18T01:50:50Z" level=debug msg="fetch response received" host=registry-1.docker.io response.header.content-length=157 response.header.content-type=application/json response.header.date="Thu, 18 Aug 2022 01:50:50 GMT" response.header.docker-distribution-api-version=registry/2.0 response.header.docker-ratelimit-source=76.14.124.26 response.header.strict-transport-security="max-age=31536000" response.header.www-authenticate="Bearer realm=\"https://auth.docker.io/token\",service=\"registry.docker.io\",scope=\"repository:library/ubuntu:pull\"" response.status="401 Unauthorized" url="https://registry-1.docker.io/v2/library/ubuntu/manifests/16.04"
Aug 18 01:50:50 lima-codecomet buildkitd[25089]: time="2022-08-18T01:50:50Z" level=debug msg=Unauthorized header="Bearer realm=\"https://auth.docker.io/token\",service=\"registry.docker.io\",scope=\"repository:library/ubuntu:pull\"" host=registry-1.docker.io
Aug 18 01:50:50 lima-codecomet buildkitd[25089]: time="2022-08-18T01:50:50Z" level=debug msg="do request" host=registry-1.docker.io request.header.accept="application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, */*" request.header.user-agent=buildkit/v0.10 request.method=HEAD url="https://registry-1.docker.io/v2/library/ubuntu/manifests/16.04"
Aug 18 01:50:51 lima-codecomet buildkitd[25089]: time="2022-08-18T01:50:51Z" level=debug msg="fetch response received" host=registry-1.docker.io response.header.content-length=1418 response.header.content-type=application/vnd.docker.distribution.manifest.list.v2+json response.header.date="Thu, 18 Aug 2022 01:50:51 GMT" response.header.docker-content-digest="sha256:91bd29a464fdabfcf44e29e1f2a5f213c6dfa750b6290e40dd6998ac79da3c41" response.header.docker-distribution-api-version=registry/2.0 response.header.docker-ratelimit-source=76.14.124.26 response.header.etag="\"sha256:91bd29a464fdabfcf44e29e1f2a5f213c6dfa750b6290e40dd6998ac79da3c41\"" response.header.ratelimit-limit="100;w=21600" response.header.ratelimit-remaining="99;w=21600" response.header.strict-transport-security="max-age=31536000" response.status="200 OK" url="https://registry-1.docker.io/v2/library/ubuntu/manifests/16.04"
Aug 18 01:50:51 lima-codecomet buildkitd[25089]: time="2022-08-18T01:50:51Z" level=debug msg=resolved desc.digest="sha256:91bd29a464fdabfcf44e29e1f2a5f213c6dfa750b6290e40dd6998ac79da3c41" host=registry-1.docker.io
Aug 18 01:50:51 lima-codecomet buildkitd[25089]: time="2022-08-18T01:50:51Z" level=debug msg=fetch digest="sha256:91bd29a464fdabfcf44e29e1f2a5f213c6dfa750b6290e40dd6998ac79da3c41" mediatype=application/vnd.docker.distribution.manifest.list.v2+json size=1418
Aug 18 01:50:51 lima-codecomet buildkitd[25089]: time="2022-08-18T01:50:51Z" level=debug msg=fetch digest="sha256:a3785f78ab8547ae2710c89e627783cfa7ee7824d3468cae6835c9f4eae23ff7" mediatype=application/vnd.docker.distribution.manifest.v2+json size=1150
Aug 18 01:50:51 lima-codecomet buildkitd[25089]: time="2022-08-18T01:50:51Z" level=debug msg=fetch digest="sha256:b6f50765242581c887ff1acc2511fa2d885c52d8fb3ac8c4bba131fd86567f2e" mediatype=application/vnd.docker.container.image.v1+json size=3362
Aug 18 01:50:51 lima-codecomet buildkitd[25089]: time="2022-08-18T01:50:51Z" level=debug msg="load cache for docker-image://docker.io/library/ubuntu:16.04 with ls46esfma3579bqbhwmkl3ggf::m7b3br9uj1jwmi7rj2uelyjbh"

@spacedub
Copy link
Author

Thanks a lot @jedevc & @tonistiigi !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants