Skip to content

Initialize standard JSON pair_pos sentinel#12

Open
SRO-SA wants to merge 1 commit into
masterfrom
fix/issue-3-standard-pair-pos-init
Open

Initialize standard JSON pair_pos sentinel#12
SRO-SA wants to merge 1 commit into
masterfrom
fix/issue-3-standard-pair-pos-init

Conversation

@SRO-SA

@SRO-SA SRO-SA commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Fixes #3

Summary:

  • Zero-initializes the pinned host result buffer in parse_standard_json.
  • Explicitly initializes the artificial root/sentinel slot shared by structural[result_size + 1] and pair_pos[0].
  • Preserves the existing parser layout where real structural data starts at structural[1] and real pair_pos data starts at pair_pos[1].

Testing:

  • I could not run CUDA or compute-sanitizer locally because my laptop does not have CUDA access.
  • I reviewed the standard JSON result-buffer layout manually.
  • Please rerun the initcheck reproducer from the issue to confirm the uninitialized read is resolved.

Note:

  • I kept the existing +2 pair_pos copy offset because the code reserve pair_pos[0] for the artificial root/sentinel entry. Moving the copy destination to +1 would shift real pair_pos entries and may break iterator semantics.

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.

Uninitialized memory read in depth_init_MathAPI from pair_pos buffer off-by-one

1 participant