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

Closed
LunNova opened this issue Oct 11, 2024 · 1 comment
Closed
Assignees
Labels
generic Build error, or some other issue not caused by an LLVM bug hipcc Related to HIPCC Under Investigation

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
@ppanchad-amd ppanchad-amd added generic Build error, or some other issue not caused by an LLVM bug Under Investigation labels Jan 7, 2025
@tcgu-amd
Copy link

tcgu-amd commented Jan 7, 2025

Hi @LunNova, thanks for reaching out, and sorry for the lack of responses! You PR is approved and will be going through our internal pipeline. I will be closing this issue for now since there is no further actionable items, but please feel free to follow up for further status updates. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generic Build error, or some other issue not caused by an LLVM bug hipcc Related to HIPCC Under Investigation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants