Skip to content

bandwidth: handle nil bandwidth in CHECK#1222

Merged
squeed merged 1 commit into
containernetworking:mainfrom
squeed:fix-bw-nil
Dec 16, 2025
Merged

bandwidth: handle nil bandwidth in CHECK#1222
squeed merged 1 commit into
containernetworking:mainfrom
squeed:fix-bw-nil

Conversation

@squeed

@squeed squeed commented Dec 15, 2025

Copy link
Copy Markdown
Member

Somehow we missed this case; if CHECK is called with no bandwidth configuration, we segfault. Oops.

Fixes: #1221

Somehow we missed this case; if CHECK is called with no bandwidth
configuration, we segfault. Oops.

Fixes: containernetworking#1221

Signed-off-by: Casey Callendrello <c1@caseyc.net>
@squeed squeed requested a review from mlguerrero12 December 15, 2025 10:32
@brandond

Copy link
Copy Markdown

Thanks for the quick fix - is there an ETA on a new release that might include this? I know v1.9.0 JUST came out.

@squeed squeed merged commit 8c4a6b3 into containernetworking:main Dec 16, 2025
6 checks passed
@squeed

squeed commented Dec 16, 2025

Copy link
Copy Markdown
Member Author

@brandond releases are cheap. I'll take care of it.

@squeed

squeed commented Dec 16, 2025

Copy link
Copy Markdown
Member Author

@brandond any chance you could verify in your environment that this fixes the issue before we cut a release?

@brandond

Copy link
Copy Markdown

This was reported by a k3s community member, using their own cri-o runtime instead of the containerd service that comes with k3s... so already outside something we would normally support.

@adelton you should be able to overwrite the k3s bandwidth plugin binary with one built directly from this project to test - if you are able.

@adelton

adelton commented Dec 16, 2025

Copy link
Copy Markdown

What is the canonical way to build from master, ideally in some containerized fashion so that the environment is the same as the one used to build binaries for releases?

@brandond

brandond commented Dec 16, 2025

Copy link
Copy Markdown

@adelton it's not built in a container, and regardless it shouldn't really matter as this is pure-go and the NPE isn't dependent on go version or anything else. Just run the build script:

- name: Build
env:
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: ./build_linux.sh -ldflags '-extldflags -static -X github.com/containernetworking/plugins/pkg/utils/buildversion.BuildVersion=${{ github.ref_name }}'

@adelton

adelton commented Dec 17, 2025

Copy link
Copy Markdown

I confirm that on the setup described in k3s-io/k3s#13344 (comment), when I run ./build_linux.sh and then

sudo rm -f /var/lib/rancher/k3s/data/cni/bandwidth
sudo cp bin/bandwidth /var/lib/rancher/k3s/data/cni

the stream of SIGSEGV errors in journal stops and the pods all get to either Completed or Running. So the code change causes a positive change in behaviour, and I dare to say, fixes the issue.

@brandond

Copy link
Copy Markdown

Fantastic. @squeed could we get v1.9.1?

@brandond

Copy link
Copy Markdown

ping @squeed - when can we expect to see a new release?

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 this pull request may close these issues.

Segfault possibly because of invalid or nil bandwidth configuration

4 participants