Fix: panic in from_pin().attach() for cgroup program types#1516
Open
hieuit095 wants to merge 2 commits into
Open
Fix: panic in from_pin().attach() for cgroup program types#1516hieuit095 wants to merge 2 commits into
hieuit095 wants to merge 2 commits into
Conversation
… cgroup_sock_addr
✅ Deploy Preview for aya-rs-docs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
tamird
requested changes
Apr 2, 2026
Member
tamird
left a comment
There was a problem hiding this comment.
Please write an integration test.
hieuit095
added a commit
to hieuit095/aya
that referenced
this pull request
Apr 3, 2026
Adds integration test for aya-rs#1516 fix - CgroupSockAddr::from_pin now correctly sets expected_attach_type so attach() does not panic. The test loads a CgroupSockAddr program (connect4 from sk_storage ebpf), pins it, then loads from pin and attaches. Without the fix, attach() would panic at expected_attach_type.unwrap().
Author
|
added integration test. |
Member
|
Thanks. I opened #1517 with an alternative fix that removes the |
Adds a test that verifies CgroupSockAddr::from_pin() correctly sets expected_attach_type before attach() is called. Without the fix, attach() would panic with unwrap on None. Addresses maintainer request (tamird) for an integration test on PR aya-rs#1516.
Author
|
Added an integration test (cgroup_sock_addr_from_pin_attach) that verifies CgroupSockAddr::from_pin() correctly sets expected_attach_type before �ttach() is called. The test pins a cgroup_sock_addr program, reloads it via rom_pin(), and attaches it to a cgroup — without the fix this would panic at the unwrap() of expected_attach_type inside �ttach(). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
was debugging a user's report about a panic when re-attaching a pinned cgroup program. the issue is that rom_pin doesnt set expected_attach_type on the program data, so calling �ttach() later hits an unwrap on None. fixed by setting it in the three affected rom_pin methods (cgroup_sock, cgroup_sockopt, cgroup_sock_addr).
note: tests cant run locally on windows due to aya-obj using unix-only std::os::fd APIs. this is a pre-existing platform constraint, not related to this change.
This change is