[DNM] test: add regression coverage for the RGW datalog segfault - #818
Closed
johnramsden wants to merge 2 commits into
Closed
[DNM] test: add regression coverage for the RGW datalog segfault#818johnramsden wants to merge 2 commits into
johnramsden wants to merge 2 commits into
Conversation
A signed GET to RGW's datalog admin endpoints segfaults radosgw when Ceph is built against a Boost whose asio spawn handler rethrows a completion's std::exception_ptr without first checking it holds an exception. rgw::run_coro's stackful-yield branch is the only co_spawn(..., yield) user in the Ceph tree and the datalog admin ops are its only callers, so every GET /admin/log?type=data&id=N kills the gateway. Multisite data sync polls those endpoints each cycle, which is how it surfaced in the field, but RGWDataChangesLog starts for every non-raw driver, so one node and one zone are enough to trigger it. Cover both vulnerable handlers: ShardInfo (id and info) and List (id alone), which drives the same branch twice. The synchronous Info endpoint (no id) runs as a control, so a broken cluster or a bad signature is distinguishable from the bug itself. A crash is detected from the rgw log's fatal-signal banner plus a frame from the crashing path, read only from what the daemon wrote since the request so a stale banner cannot match, and corroborated by systemd's restart counter, which owes nothing to log wording. The response body is then checked for the shape the handler emits, so a request that never reached it cannot pass for lack of a crash. The admin request needs no --caps: RGW falls back to is_admin() when the per-op cap is absent, which is true for a --system user. This suite fails against the ceph build snap/snapcraft.yaml currently names. The next commit repoints it. Ref: canonical#810 Assisted-by: claude-code:claude-opus-5 Signed-off-by: John Ramsden <john.ramsden@canonical.com>
lmlogiudice/ceph-tentacle-rc builds 20.2.1 with nothing applied for the null exception_ptr rethrow, so every RGW datalog admin request segfaults the gateway and paired zones never replicate object data. johnramsden/noble-caracal-ceph-tentacle is the same upstream 20.2.1 with d/p/fix-run-coro-null-exception-rethrow.patch on top. That patch takes the co_spawn completion as a tuple so asio never selects the spawn handler that dereferences the stored exception_ptr unconditionally, then checks the exception_ptr itself before rethrowing it into the existing catch block. Return values and error handling are unchanged, and it is correct against both the affected and unaffected Boost versions, so it does not have to be reverted when the base moves on. Neither PPA rebuilds boost; this is a Ceph-side patch. The new PPA publishes noble only, which is what core24 builds against, and noble is the only affected series. The rgw-datalog-crash-tests suite added in the previous commit passes against this build. Fixes: canonical#810 Assisted-by: claude-code:claude-opus-5 Signed-off-by: John Ramsden <john.ramsden@canonical.com>
johnramsden
force-pushed
the
fix/rgw-datalog-segfault-810
branch
from
August 17, 2026 21:51
77752a2 to
cd5fe07
Compare
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.
Test for #810 to verify PPA.