Skip to content

zdtm: add test for UDP multicast socket membership restoration#2878

Open
euphoricair7 wants to merge 7 commits intocheckpoint-restore:criu-devfrom
euphoricair7:criu-dev
Open

zdtm: add test for UDP multicast socket membership restoration#2878
euphoricair7 wants to merge 7 commits intocheckpoint-restore:criu-devfrom
euphoricair7:criu-dev

Conversation

@euphoricair7
Copy link
Copy Markdown

This PR adds a test case for UDP multicast socket membership restoration,
documenting that CRIU currently does not support restoring IP_ADD_MEMBERSHIP
socket options.

Summary

While reviewing the ZDTM Test Suite, I noticed there are no tests for UDP
multicast sockets. Multicast group memberships (IP_ADD_MEMBERSHIP) are
kernel-maintained socket state that may be lost across checkpoint/restore
without explicit handling.

Changes

  1. New test: test/zdtm/static/socket_udp_multicast.c

    • Creates a UDP socket that joins a multicast group (224.0.0.250)
    • Tests communication after checkpoint/restore
    • Demonstrates that multicast membership is not preserved
  2. Test descriptor: test/zdtm/static/socket_udp_multicast.desc

    • Marks the test as broken ("broken": true)
    • Documents the limitation in the notes field
  3. Makefile update: Added build rule for the new test

Findings

Through analysis of CRIU's source code, I confirmed that:

  • No protobuf fields exist for multicast memberships in sk-inet.proto
  • No dump/restore code handles IP_ADD_MEMBERSHIP in sk-inet.c
  • The test currently fails as expected, demonstrating the gap

The test is designed to:

  1. Join a multicast group before checkpoint
  2. Attempt to receive multicast packets after restore
  3. Time out (fail) since CRIU doesn't restore the membership

Related Issue

Fixes: #2873 (Missing ZDTM coverage for UDP multicast sockets)

Next Steps

This test serves as:

  1. Documentation of the current limitation
  2. A starting point for implementing multicast support
  3. A test case to verify when support is added

To implement multicast support, the following would be needed:

  • Add multicast membership fields to protobuf definitions
  • Implement dump/restore of IP_ADD_MEMBERSHIP in sk-inet.c
  • Potentially handle other multicast options (IP_MULTICAST_IF, etc.)

Testing

Test can be run with:

sudo ./test/zdtm.py run -t zdtm/static/socket_udp_multicast

test_waitsig();

/* Small delay to ensure everything is ready */
usleep(100000);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why do we need this sleep?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

i added the usleep delay such that more of for the observability while the test runs and eventually fails for now, but when the udp multicast might be added eventually in the future, just to ensure that no packets are dropped.
But if needed we can totally remove/comment it for now, since it doens't affect the current functionality test at all.

@avagin
Copy link
Copy Markdown
Member

avagin commented Feb 10, 2026

This pr breaks CI tests.

@euphoricair7
Copy link
Copy Markdown
Author

This pr breaks CI tests.

I will apply some changes of .desc file and try once again.

@euphoricair7
Copy link
Copy Markdown
Author

euphoricair7 commented Feb 10, 2026

Resolved it.

This test documents that CRIU currently does not restore
IP_ADD_MEMBERSHIP socket options (multicast group memberships).
The test is marked as broken in its .desc file until support
is implemented.

Multicast memberships are stored as socket state in the kernel
but are not currently captured by CRIU's socket dumping code.
This means processes using multicast may lose group memberships
after checkpoint/restore.

The test demonstrates this limitation and serves as a starting
point for implementing multicast support in the future.

Signed-off-by: euphoricair7 <[email protected]>
@euphoricair7
Copy link
Copy Markdown
Author

@avagin all the CI tests except, Cirrus CI / Vagrant Fedora Rawhide based test, failed, is this a test something I should worry about?

@euphoricair7
Copy link
Copy Markdown
Author

euphoricair7 commented Feb 15, 2026

@avagin all the CI tests except, Cirrus CI / Vagrant Fedora Rawhide based test, failed, is this a test something I should worry about?

Here the test is failing on zombie00 with a segfault. This seems unrelated to my UDP changes. Could you verify?

@github-actions
Copy link
Copy Markdown

A friendly reminder that this PR had no activity for 30 days.

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.

Missing ZDTM coverage for UDP multicast sockets

2 participants