NVIDIA/nvcomp

[BUG] Deflate Undefined Behavior with Data Size Below Manager Chunk Size

NicolasDenoyelle opened this issue · 2 comments

Describe the bug

nvcomp deflate manager runs into illegal memory access when compressing data smaller than manager chunk size.
Note that all other managers did not report error in the same test case.

Steps/Code to reproduce bug

Reproducer:
nvcomp-deflate-reproducer.cpp.txt

Compile with:

g++ -g -Wall -Wextra -Wall -std=c++17 -I/usr/local/cuda/include -I<path_to_nvcomp.h> nvcomp-deflate-reproducer.cpp -o reproducer -lcudart -lnvcomp

Run with:

compute-sanitizer ./reproducer

Expected behavior

The reproducer I attached compresses a buffer of size 33B with DeflateManager and recommended chunk size.
When ran through compute-sanitizer the tool will report illegal memory access.
You can run the same code with other managers (adjusting to the recommended chunk size) and there will be no error reported.

If this is intended, please add some documentation about it.

Environment details:

Bare-metal
Cuda Driver Version: 535.154.05
CUDA Version: 12.2
NVIDIA GeForce RTX 3050
nvcomp Version: 3.0.4 (no extensions)

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.