Skip to content

Legacy output routines now only print trace species when there are trace species to print - #184

Open
dfnca wants to merge 1 commit into
nasa:mainfrom
dfnca:fix/legacyPrintUninitMemory
Open

dfnca wants to merge 1 commit into
nasa:mainfrom
dfnca:fix/legacyPrintUninitMemory

Conversation

@dfnca

@dfnca dfnca commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds if statement to ensure unitialized memory isn't printed when using legacy interface if there are no trace species. Fixes #183

Changes

Added if statement around trace specie names output to prevent writing trace_names if there were no trace species to all problems except the rocket problem. The rocket problem code already had this test in place.

Testing

100% pass test_main.py, ctest w/PFUNIT, pytest.
Ran bug reproducibility .inp files from #183; output is attached showing the behavior now replicates CEA 2 without extraneous output.

test_det.out.txt
test_shock.out.txt
test_tp.out.txt

Compatibility / Numerical behavior

  • [ X] No expected changes to numerical results
  • Expected changes (explain and provide validation)

@djkees

djkees commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

I reviewed the diff and built both this branch and the base commit (2f79a64) with gfortran on Windows. I ran small no-trace cases for tp, det, and shock (incd froz eql), using only to restrict the species. On the base build, all three print uninitialized bytes after "WERE LESS THAN … FOR ALL ASSIGNED CONDITIONS". With this PR they print blank lines, and the only difference between the two outputs is that one line.

On this branch, test_main.py passes 14/14, ctest (including pFUnit) passes 15/15, and pytest source/bind/python/tests passes 114/114.

A no-trace rocket case gave identical output before and after. The unguarded second rocket site, which the diff also guards, reads past the end of a zero-size array, which the guard prevents. The description says rocket already had this check, but that second site did not.

This branch has not been deployed

No deployments
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.

[bug] Legacy output prints unitialized memory in some cases

2 participants