Skip to content

[BUG] Fix Segfault Caused by Incorrect Dereferencing of Renumber Map - #5632

Merged
rapids-bot[bot] merged 2 commits into
rapidsai:mainfrom
alexbarghi-nv:agent/fix-sample-edge-map-accessors
Aug 19, 2026
Merged

[BUG] Fix Segfault Caused by Incorrect Dereferencing of Renumber Map#5632
rapids-bot[bot] merged 2 commits into
rapidsai:mainfrom
alexbarghi-nv:agent/fix-sample-edge-map-accessors

Conversation

@alexbarghi-nv

Copy link
Copy Markdown
Member

Summary

  • check the optional edge renumber map pointers before dereferencing them in
    the sampling-result C API accessors
  • add regression coverage for accessing absent edge renumber maps on a
    renumbered homogeneous sampling result

Problem

cugraph_sample_result_get_edge_renumber_map() and
cugraph_sample_result_get_edge_renumber_map_offsets() currently check whether
the vertex renumber_map_ is null, then dereference the corresponding optional
edge renumber map pointer.

A sampling result can validly contain a vertex renumber map without an edge
renumber map. In particular, heterogeneous sampling with one edge type returns
that layout. Calling either accessor then dereferences a null pointer and
segfaults while pylibcugraph marshals an otherwise completed sampling result.

Fix

Each accessor now checks the pointer it actually dereferences:

  • edge_renumber_map_
  • edge_renumber_map_offsets_

The accessors return null for absent optional results, matching the behavior of
the other sampling-result accessors and the existing pylibcugraph null handling.

Validation

  • repository pre-commit hooks pass for both changed files
  • the cuGraph-GNN heterogeneous disjoint neighbor-loader reproducer passes
    end-to-end against an exact-baseline libcugraph build containing only this
    accessor fix
  • the same reproducer still segfaults with cuGraph PR Fix bug found in how we handle empty frontiers in sampling #5629 alone, confirming
    that the empty-frontier fix is independent

@copy-pr-bot

copy-pr-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@alexbarghi-nv alexbarghi-nv self-assigned this Aug 18, 2026
@alexbarghi-nv alexbarghi-nv added bug Something isn't working non-breaking Non-breaking change labels Aug 18, 2026
@ChuckHastings

Copy link
Copy Markdown
Collaborator

/ok to test 3cae514

@ChuckHastings
ChuckHastings marked this pull request as ready for review August 19, 2026 19:57
@ChuckHastings
ChuckHastings requested a review from a team as a code owner August 19, 2026 19:57
@ChuckHastings

Copy link
Copy Markdown
Collaborator

/merge

@rapids-bot
rapids-bot Bot merged commit 528ddde into rapidsai:main Aug 19, 2026
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants