Repository navigation
Preserve NVRTC lowered-name errors before converting output - #66
Draft
RicheyWorks wants to merge 1 commit into
Draft
RicheyWorks wants to merge 1 commit into
RicheyWorks wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
nvrtcGetLoweredNamefails (for example, before compilation), the JNI wrapper still passes its uninitialized output pointer toNewStringUTF. With NVRTC 12.6.85 on Windows this produces a misleadingOutOfMemoryError, hiding the actual NVRTC error and preventing the normal exceptions-enabled path.Return native failures before reading the output pointer or changing the Java result array. Release the temporary input string immediately after the native call, including on the later Java string allocation failure path. Successful names remain copied into Java-owned strings.
Validation: six isolated child-JVM cases with
-Xcheck:jni: before compilation, invalid program, unregistered expression after compilation, exceptions enabled, successful name surviving program destruction, and null/empty output argument controls. Four fail against the published 12.6.0 JNI baseline; all six pass after rebuilding only JNvrtc against pristine upstream jcuda-common. The two controls pass before too. The error cases preserve the output sentinel and tail entry.Windows x86_64, Temurin 22, existing MSVC/CMake, checksum-verified official CUDA/NVRTC 12.6 workspace headers/import libraries/DLLs. Library logging confirms the rebuilt JNI DLL. These are CPU-only compiler calls: no CUDA context, loaded module, GPU allocation or kernel launch. Maven uses the separately proposed Java 8 compiler baseline in jcuda-parent PR2; that build change is not included here.
Run with NVRTC DLLs available to the test process:
No full suite, other operating systems, or compiler versions tested. This draft is limited to lowered-name error handling; other NVRTC output functions are outside its scope. Upstream master and open PRs were checked for overlap.