Skip to content

Conversation

@davidwendt
Copy link
Contributor

Description

Fixes a racecheck reported by compute-sanitizer in the gpu_debrotli_kernel code found by the COMPRESSION_TEST BrotliDecompressTest/BrotliDecompressTest.HelloWorld/0 gtest:

[ RUN      ] BrotliDecompressTest/BrotliDecompressTest.HelloWorld/0
========= Error: Race reported between Read access at cudf::io::detail::gpu_debrotli_kernel(cudf::device_span<const cudf::device_span<const unsigned char, (unsigned long)18446744073709551615>, (unsigned long)18446744073709551615>, cudf::device_span<const cudf::device_span<unsigned char, (unsigned long)18446744073709551615>, (unsigned long)18446744073709551615>, cudf::device_span<cudf::io::detail::codec_exec_result, (unsigned long)18446744073709551615>, unsigned char *, unsigned int)+0x1900 in debrotli.cu:1956
=========     and Write access at cudf::io::detail::initbits(cudf::io::detail::debrotli_state_s *, const unsigned char *, unsigned long, unsigned long)+0x1c20 in debrotli.cu:200 [8 hazards]

The s->cur variable is read by all threads but may be set by thread 0 in a race condition.
Adding a __syncthreads() right after the s->cur is read ensures it is not reset by any threads before all threads in the block have read it.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@davidwendt davidwendt self-assigned this Dec 8, 2025
@davidwendt davidwendt added bug Something isn't working 2 - In Progress Currently a work in progress libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change labels Dec 8, 2025
@copy-pr-bot
Copy link

copy-pr-bot bot commented Dec 8, 2025

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.

@davidwendt
Copy link
Contributor Author

/ok to test

@davidwendt davidwendt added 3 - Ready for Review Ready for review by team and removed 2 - In Progress Currently a work in progress labels Dec 8, 2025
@davidwendt davidwendt marked this pull request as ready for review December 8, 2025 19:11
@davidwendt davidwendt requested a review from a team as a code owner December 8, 2025 19:11
@davidwendt
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 9d768f7 into rapidsai:main Dec 9, 2025
273 of 275 checks passed
@davidwendt davidwendt deleted the debrotli-racecheck branch December 9, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 - Ready for Review Ready for review by team bug Something isn't working libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants