Skip to content
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

[Issue]: hipBinUtilPtr_ never initialized in amd/hipcc/src/hipBin_amd.h #182

Open
LunNova opened this issue Oct 11, 2024 · 0 comments · May be fixed by #183
Open

[Issue]: hipBinUtilPtr_ never initialized in amd/hipcc/src/hipBin_amd.h #182

LunNova opened this issue Oct 11, 2024 · 0 comments · May be fixed by #183
Assignees
Labels
hipcc Related to HIPCC

Comments

@LunNova
Copy link

LunNova commented Oct 11, 2024

Problem Description

The hipBinUtilPtr_ field is never initialized in hipBin_amd.h or hipBin_nvidia.h so all member calls through it are UB. Looks like it's accidentally redefined as a private field instead of reusing the inherited protected field which is initialized correctly.

Detected by UBSAN if hipcc is built with -fsanitize=undefined
Line numbers on rocm-6.2.2 tag:

rocsparse> /build/source/amd/hipcc/src/hipBin_amd.h:507:38: runtime error: member call on null pointer of type 'HipBinUtil'
rocsparse> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /build/source/amd/hipcc/src/hipBin_amd.h:507:38
rocsparse> /build/source/amd/hipcc/src/hipBin_amd.h:543:27: runtime error: member call on null pointer of type 'HipBinUtil'
rocsparse> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /build/source/amd/hipcc/src/hipBin_amd.h:543:27
rocsparse> /build/source/amd/hipcc/src/hipBin_amd.h:558:25: runtime error: member call on null pointer of type 'HipBinUtil'
rocsparse> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /build/source/amd/hipcc/src/hipBin_amd.h:558:25
rocsparse> /build/source/amd/hipcc/src/hipBin_amd.h:589:25: runtime error: member call on null pointer of type 'HipBinUtil'
rocsparse> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /build/source/amd/hipcc/src/hipBin_amd.h:589:25
rocsparse> /build/source/amd/hipcc/src/hipBin_amd.h:592:25: runtime error: member call on null pointer of type 'HipBinUtil'
rocsparse> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /build/source/amd/hipcc/src/hipBin_amd.h:592:25
rocsparse> /build/source/amd/hipcc/src/hipBin_amd.h:619:32: runtime error: member call on null pointer of type 'HipBinUtil'
rocsparse> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /build/source/amd/hipcc/src/hipBin_amd.h:619:32
rocsparse> /build/source/amd/hipcc/src/hipBin_amd.h:622:32: runtime error: member call on null pointer of type 'HipBinUtil'
rocsparse> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /build/source/amd/hipcc/src/hipBin_amd.h:622:32
rocsparse> /build/source/amd/hipcc/src/hipBin_amd.h:629:29: runtime error: member call on null pointer of type 'HipBinUtil'
rocsparse> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /build/source/amd/hipcc/src/hipBin_amd.h:629:29
rocsparse> /build/source/amd/hipcc/src/hipBin_amd.h:765:44: runtime error: member call on null pointer of type 'HipBinUtil'
rocsparse> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /build/source/amd/hipcc/src/hipBin_amd.h:765:44
rocsparse> /build/source/amd/hipcc/src/hipBin_amd.h:771:56: runtime error: member call on null pointer of type 'HipBinUtil'
rocsparse> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /build/source/amd/hipcc/src/hipBin_amd.h:771:56
rocsparse> /build/source/amd/hipcc/src/hipBin_amd.h:904:30: runtime error: member call on null pointer of type 'HipBinUtil'
rocsparse> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /build/source/amd/hipcc/src/hipBin_amd.h:904:30

Operating System

NixOS

CPU

Epyc 7642

GPU

AMD Instinct MI100

ROCm Version

ROCm 6.2.0

ROCm Component

HIPCC

Steps to Reproduce

No response

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

No response

Additional Information

No response

@lamb-j lamb-j added the hipcc Related to HIPCC label Oct 11, 2024
@lamb-j lamb-j assigned lamb-j and david-salinas and unassigned lamb-j Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hipcc Related to HIPCC
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants