Skip to content

Fix segmentation fault in gmx pairdist

Paul Bauer requested to merge fix-segfault-in-pairdist into release-2020

When using the pairdist tool with a coordinate in space as selection, the tool would overwrite the selection group of the selection by default to implement reference grouping. This would change the selection type of the coordinate from INDEX_UNKNOWN to INDEX_ALL by default (or to any other user supplied reference grouping). The change of the selection type would then later cause a segmentation fault, as the underlying machinery would try to access the non-existing atoms belonging to the selection.

This changes the mechanism to no longer overwrite the selection group type if the current one is INDEX_UNKNOWN.

Introduces test case with command line selection that would crash without the fix.

Fixes #3762 (closed)

Edited by Paul Bauer

Merge request reports