Skip to content

DAOS-19495 object: fix segfault on max epoch query in a transaction - #18858

Merged
mchaarawi merged 2 commits into
masterfrom
mschaara/dtx_fix_segv
Aug 16, 2026
Merged

DAOS-19495 object: fix segfault on max epoch query in a transaction#18858
mchaarawi merged 2 commits into
masterfrom
mschaara/dtx_fix_segv

Conversation

@mchaarawi

Copy link
Copy Markdown
Contributor

daos_obj_query_max_epoch() has neither dkey nor akey, but dc_tx_attach() cached it as a read with nr=1, so dc_tx_add_read() left dcsr_nr=1 while dcr_iods stayed NULL. The commit then crashed dereferencing dcr_iods in dc_tx_cpd_sub_reqs_size(). Record it as an object level read (nr=0) and force nr=0 whenever no dkey is given. Add DTX42 regression test.

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

daos_obj_query_max_epoch() has neither dkey nor akey, but dc_tx_attach()
cached it as a read with nr=1, so dc_tx_add_read() left dcsr_nr=1 while
dcr_iods stayed NULL. The commit then crashed dereferencing dcr_iods in
dc_tx_cpd_sub_reqs_size(). Record it as an object level read (nr=0) and
force nr=0 whenever no dkey is given. Add DTX42 regression test.

Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@hpe.com>
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

Ticket title is 'SEGV seen in DTX operation involving daos_obj_query_max_epoch'
Status is 'In Review'
https://daosio.atlassian.net/browse/DAOS-19495

@mchaarawi
mchaarawi marked this pull request as ready for review August 13, 2026 12:46
@mchaarawi
mchaarawi requested review from a team, Nasf-Fan and wangshilong August 13, 2026 12:46
wangshilong
wangshilong previously approved these changes Aug 13, 2026
Comment thread src/object/obj_tx.c Outdated
if (dkey == NULL)
/* Set read TS on object shard, without dkey there is no akey/iod to record. */
if (dkey == NULL) {
nr = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why need this since the patch has already checked if (qu->flags == 0) at line 3553?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

you are right, this is redundant. ill remove

Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@hpe.com>
@mchaarawi
mchaarawi merged commit 7d4289b into master Aug 16, 2026
38 checks passed
@mchaarawi
mchaarawi deleted the mschaara/dtx_fix_segv branch August 16, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants