Skip to content

Check if pcp_schedule is allocated before assigning pi_p values#32

Closed
immamex wants to merge 1 commit intonasa:mainfrom
immamex:fix_sup_sigsegv
Closed

Check if pcp_schedule is allocated before assigning pi_p values#32
immamex wants to merge 1 commit intonasa:mainfrom
immamex:fix_sup_sigsegv

Conversation

@immamex
Copy link

@immamex immamex commented Feb 17, 2026

Summary

Running a rocket problem with legacy style input files would create a sigsegv if a pip value was not explicitly assigned. This has been fixed in this branch
Fixes #30

Changes

rocket problem checks if pcp_schedule is allocated before assigning to pi_p

Testing

test_results appended
Tested on a windows installation compiled with MinGW64-

Compatibility / Numerical behavior

  • No expected changes to numerical results
  • Expected changes (explain and provide validation)
    test_results.csv

Some numerical results are slightly different (relative error ~1e-4) but I would attribute this to a different building environment, I can't see how this change would affect that

@dfnca
Copy link
Contributor

dfnca commented Feb 18, 2026

I think that there is more work to be done to get this and the associated behavior lying flat. For example, there are instances in the solver where pi_p is used whether or not it's allocated, e.g., line 809 of rocket.f90 and a similar occurance in the fac subroutine. There may be other instances.

In general, none of pi_p, subar, or supar should be required. CEA2 will happily compute the chamber and throat if no contraction or expansion conditions are requested, but CEA3 crashes.

@immamex
Copy link
Author

immamex commented Feb 18, 2026

going through rocket.f90 it looks like the only instances where pi_p is required are at line 809 (IAC) and 997 (FAC). In that case, I guess the solution would be to go from

num_pts = 2 + size(pi_p)

and

num_pts = 4 + size(pi_p)

to

num_pts = 2
if (present(pi_p)) num_pts = num_pts + size(pi_p)

and

num_pts = 4
if (present(pi_p)) num_pts = num_pts + size(pi_p)

However the input to all the RocketSolver functions should then also allow for pi_p to be an optional argument and this might have a cascade effect on other routines.

I wonder why it was written in such a way to always require pi_p though, seems like it would have been easily avoidable

@markleader
Copy link
Contributor

I am closing this and replacing with PR #36. This is a work-in-progress - the fortran side seems stable, and I am making updates to C and Python interfaces and added testing

@markleader markleader closed this Feb 19, 2026
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] SIGSEGV fault in rocket problem when supersonic area ratio is specified

3 participants

Comments