Skip to content

Conversation

@PhelanShao
Copy link

@PhelanShao PhelanShao commented Oct 9, 2025

Reproduction

crest struc.xyz \
  --qcg water.xyz --nsolv 6 \
  --gfnff --T 12 --alpb water \
  --ensemble --md --mdtime 10 --wscal 1.0

Example command taken from https://crest-lab.github.io/crest-docs/page/examples/qcg/example_5.html.

On master (c39758d) this workflow aborts during the first CREGEN pass with:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
#0  ... cregen_conffile_ at src/cregen.f90:2196

Any pure GFN‑FF QCG run that skips the RMSD/rotamer grouping step exhibits the same crash: degen is never populated, yet cregen_conffile dereferences xyz(:,:,degen(2,i)), so a zero index triggers the SIGSEGV.

Summary

  • Provide a trivial 1:1 group mapping whenever sortRMSD is false.
  • Guard cregen_conffile against invalid group indices so we never read outside [1, nall].

Details

  1. If the RMSD branch is bypassed, allocate degen(:,i) = i (or a single zeroed entry when the ensemble is empty).
  2. In the writer, skip any group whose degen(2,i) falls outside the valid index range before calling wrc0.

Testing

  • CREST 3.0.2 (c39758d) + xtb 6.6.1
  • The command above now completes the CREGEN stage without errors.

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.

1 participant