Repository navigation
fix(csp-batch): pass extents, not absent optional arrays, to batch_check_shapes - #145
Open
elijahmathews wants to merge 1 commit into
Open
elijahmathews wants to merge 1 commit into
elijahmathews wants to merge 1 commit into
Conversation
…eck_shapes gfortran 13 at -O0 builds a new descriptor from an absent optional array that is passed on, reading its undefined bounds; UBSan reports the arithmetic as a signed overflow (csp_batch.f90:610, nightly ASan+UBSan: csp_batch, csp_batch_grad). The driver takes the extents under present() and passes integers. The checks are unchanged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MXDRCs7ATQiqhT6RLPLXR5
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (67.44%) is below the target coverage (85.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #145 +/- ##
==========================================
+ Coverage 74.93% 74.98% +0.04%
==========================================
Files 51 51
Lines 14481 14497 +16
Branches 6089 6103 +14
==========================================
+ Hits 10852 10871 +19
Misses 1482 1482
+ Partials 2147 2144 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
What
The nightly ASan+UBSan job failed
csp_batchandcsp_batch_gradwithcsp_batch.f90:610:95: runtime error: signed integer overflow(run 44587837204).Cause
batch_check_shapes(split out of the driver in #134) took the driver's optional arrays as optional dummies. With gfortran 13 at -O0, passing an absent optional assumed-shape array on makes the compiler read the bounds of its undefined descriptor to build a new one; UBSan reports the arithmetic as a signed overflow. The values are not used, so results were unaffected, but the sanitizer aborts. It showed only with CI's compiler (Ubuntu 24.04, gfortran 13.3) and an unoptimised build; Fedora's gfortran 16 at -O2 did not reproduce it.Fix
The driver takes the extents under
present()and passes an integer arrayext; the checks are unchanged (same conditions, same statuses).Verification
-Db_sanitize=address,undefined, default build type,-fno-sanitize-recover=all:test_csp_batch,test_csp_batch_grad,test_batch_equivalenceexit 0, no runtime errors. Before the change, the same build aborted atcsp_batch.f90:610:95.🤖 Generated with Claude Code
https://claude.ai/code/session_01MXDRCs7ATQiqhT6RLPLXR5