Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seg fault if user doesn't set par->nSolveIters #262

Closed
allegroLeiden opened this issue Apr 25, 2018 · 0 comments
Closed

Seg fault if user doesn't set par->nSolveIters #262

allegroLeiden opened this issue Apr 25, 2018 · 0 comments

Comments

@allegroLeiden
Copy link
Contributor

This happens because par->doSolveRTE is not set in this case, leading to the call to calcGridMolSpecNumDens() in run_new.c trying to read gp[gi].mol[ispec].pops values, but gp[gi].mol[ispec].pops is never malloc'd.

allegroLeiden pushed a commit that referenced this issue Apr 25, 2018
Two changes have been made.
  - In run.c:parseInput(), a warning is generated if (!par->lte_only && par->nSolveIters<=par->nSolveItersDone && !allBitsSet(par->dataFlags, DS_mask_populations)). I.e. if the user has neither set pops values via a submitted grid file, nor requested any solver iterations.
  - In run.c:run(), gp[gi].mol[si].pops is malloc'd and filled with zeros whether par->doSolveRTE is set or not.

Upshot of the changes are that, where previous the code would seg fault if the user left par->nSolveIters at default, now it will proceed, with a warning message. Any output images will contain zero contribution from line emission.

An additional change: in run.c:run(), formerly the decision to set par->doSolveRTE depended on (par->nSolveIters>0 || par->lte_only), now it depends on (par->nSolveIters>par->nSolveItersDone || par->lte_only).
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

No branches or pull requests

1 participant