Skip to content

Prevent a segfault in ccpp tuvx wrapper#399

Merged
cacraigucar merged 1 commit into
mainfrom
terminator_debug
May 27, 2026
Merged

Prevent a segfault in ccpp tuvx wrapper#399
cacraigucar merged 1 commit into
mainfrom
terminator_debug

Conversation

@K20shores
Copy link
Copy Markdown
Collaborator

Tag name (The PR title should also include the tag name):
Originator(s): Kyle SHores

Description (include issue title and the keyword ['closes', 'fixes', 'resolves'] and issue number):

In testing the terminator configuration of musica, I found with gcc 14.3.0, that the tuvx ccpp wrapper code would segfault. This is because the result of the size(...) call, and the math around it, was coming back either as zero or a negative number ( I can't remember which now). This results in a segfault. I guess this was the result of an overzealous optimizer path, or maybe some fortran language specification that I'm unaware of.

Either way, saving the math result to a local variable resolved the segfault.

List all namelist files that were added or changed:

List all files eliminated and why:

List all files added and what they do:

List all existing files that have been modified, and describe the changes:
(Helpful git command: git diff --name-status main...<your_branch_name>)

schemes/musica/tuvx/musica_ccpp_tuvx.F90

List all automated tests that failed, as well as an explanation for why they weren't fixed:

Is this an answer-changing PR? If so, is it a new physics package, algorithm change, tuning change, etc?

If yes to the above question, describe how this code was validated with the new/modified features:

@K20shores K20shores changed the title saving index to variable Prevent a segfault in ccpp tuvx wrapper May 27, 2026
Copy link
Copy Markdown
Member

@jimmielin jimmielin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a odd compiler bug. Thanks for fixing this.

@cacraigucar cacraigucar merged commit 50e1aaa into main May 27, 2026
4 checks passed
@cacraigucar cacraigucar deleted the terminator_debug branch May 27, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants