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

driver(container): fix conditional statement for error handling #2176

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

crazy-max
Copy link
Member

@crazy-max crazy-max commented Jan 5, 2024

fixes #2177

When creating a builder and setting memory limit, it panics:

$ docker --debug buildx create --name foo --driver-opt "memory=3g"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0x120c656]

goroutine 46 [running]:
github.com/docker/buildx/builder.(*Node).loadData(0xc000429d40, {0x266fc00, 0xc00025ebd0})
        github.com/docker/buildx/builder/node.go:254 +0x56
github.com/docker/buildx/builder.(*Builder).LoadNodes.(*Builder).LoadNodes.func2.func3()
        github.com/docker/buildx/builder/node.go:154 +0x625
golang.org/x/sync/errgroup.(*Group).Go.func1()
        golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1
        golang.org/x/[email protected]/errgroup/errgroup.go:72 +0x96

Conditional statement for error handling was not set correctly.

@crazy-max crazy-max force-pushed the fix-builder-creation branch from 8eeada0 to 57d737a Compare January 5, 2024 15:35
@crazy-max crazy-max marked this pull request as ready for review January 5, 2024 15:41
Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is bit weird construction as it always sets the value and then error in handled later. But coming from cli so nothing we can do about it.

@tonistiigi tonistiigi merged commit 6b63e7e into docker:master Jan 5, 2024
61 checks passed
@crazy-max crazy-max deleted the fix-builder-creation branch January 5, 2024 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Buildx causing DD to crash when trying to set driver opts
2 participants