Skip to content

cephfs: Add backward compatible ceph_open_snapdiff dlsym call - #1310

Closed
anoopcs9 wants to merge 1 commit into
ceph:masterfrom
anoopcs9:fix-open-snapdiff-crash
Closed

anoopcs9 wants to merge 1 commit into
ceph:masterfrom
anoopcs9:fix-open-snapdiff-crash

Conversation

@anoopcs9

@anoopcs9 anoopcs9 commented Aug 6, 2026 •

Copy link
Copy Markdown
Collaborator

The ceph_open_snapdiff function signature changed on Ceph main (ceph/ceph@9c958c66f5c4) gaining a new diff_mask parameter, and struct ceph_snapdiff_info gained a new mask field. This causes a SIGSEGV in TestSnapDiff due to argument misalignment when calling via dlsym.

Use #ifdef CEPH_SNAPDIFF_MODE to select the correct function pointer cast at compile time, passing diff_mask=0 for the new API. The Go calling convention remains unchanged.

fixes #1309

The ceph_open_snapdiff function signature changed [1] on Ceph main
gaining a new 'diff_mask' parameter, and struct ceph_snapdiff_info
gained a new `mask` field. This causes a SIGSEGV in TestSnapDiff due
to argument misalignment when calling via dlsym.

Use #ifdef CEPH_SNAPDIFF_MODE to select the correct function pointer
cast at compile time, passing diff_mask=0 for the new API. The Go
calling convention remains unchanged.

[1] ceph/ceph@9c958c66f5c4

Signed-off-by: Anoop C S <[email protected]>
@phlogistonjohn

Copy link
Copy Markdown
Collaborator

Did they change a public API in a backwards incompatible way? Shouldn't we report this as an issue to them? This will break other users of the C api too right?
Unless I'm mistaken and they accounted for this in a way I'm not seeing they should take the opportunity to fix this on main and we shouldn't work around a mistake like that.

@phlogistonjohn

phlogistonjohn commented Aug 6, 2026 •

Copy link
Copy Markdown
Collaborator

I found the ceph pr and replied there too: ceph/ceph#68054 (comment)

@anoopcs9
anoopcs9 marked this pull request as draft August 6, 2026 18:14
@anoopcs9

anoopcs9 commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator Author

This workaround will no longer be needed once ceph/ceph#70912 is merged; therefore, closing the issue.

@anoopcs9 anoopcs9 closed this Aug 8, 2026
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.

cephfs: TestSnapDiff SIGSEGV on Ceph main

2 participants