Skip to content

Fix unable to map dynamic shared memory segment #1196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yjhjstz
Copy link
Member

@yjhjstz yjhjstz commented Jun 26, 2025

Fix type mismatch in dsm_attach() argument by using DatumGetUInt32()

The argument passed to dsm_attach() represents a dynamic shared memory
segment handle, which is defined as a uint32. The existing code incorrectly
used DatumGetInt32(), which may lead to unexpected behavior if the value
exceeds the range of a signed 32-bit integer.

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


The argument passed to dsm_attach() represents a dynamic shared memory
segment handle, which is defined as a uint32. The existing code incorrectly
used DatumGetInt32(), which may lead to unexpected behavior if the value
exceeds the range of a signed 32-bit integer.
@yjhjstz yjhjstz force-pushed the yjh/fix_dsmattach branch from 87c657d to 13b0aa3 Compare June 26, 2025 19:30
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.

1 participant