# Segmentation fault with pairdist

**URL:** <https://gromacs.bioexcel.eu/t/segmentation-fault-with-pairdist/1006>\
**Category:** User discussions\
**Created:** [October 26, 2020, 9:05am UTC](https://gromacs.bioexcel.eu/t/segmentation-fault-with-pairdist/1006 "2020-10-26T09:05:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yasser.almeida](https://avatars.discourse-cdn.com/v4/letter/y/76d3ee/32.png) [@yasser.almeida](https://gromacs.bioexcel.eu/u/yasser.almeida)\
**Post date:** [October 26, 2020, 9:05am UTC](https://gromacs.bioexcel.eu/t/segmentation-fault-with-pairdist/1006/1 "2020-10-26T09:05:11Z")

</div>

GROMACS version: 2020.1  
GROMACS modification: No

Hi all,

I want to compute the min/max distance between each oxygen atoms in a group and the COM of the system with pairdist, but I get a Segmentation fault error. The command and the output are:

```
$ gmx_mpi pairdist -s system.tpr -f system.xtc -n system_index.ndx

Available static index groups:
 Group 0 "System" (20523 atoms)
 Group 1 "Other" (20523 atoms)
 Group 2 "TIP3" (20523 atoms)
 Group 3 "OH2_around_10_of_COM" (137 atoms)
Specify a selection for option 'ref'
(Reference positions to calculate distances from):
(one per line, <enter> for status/groups, 'help' for help)
> [2.194, 2.368, 0.150]
Selection '[2.194, 2.368, 0.150]' parsed
Available static index groups:
 Group 0 "System" (20523 atoms)
 Group 1 "Other" (20523 atoms)
 Group 2 "TIP3" (20523 atoms)
 Group 3 "OH2_around_10_of_COM" (137 atoms)
Specify any number of selections for option 'sel'
(Positions to calculate distances for):
(one per line, <enter> for status/groups, 'help' for help, Ctrl-D to end)
> 3
Selection '3' parsed
> Reading file md_1ns_equil_10A_sphere_restrained_10000.tpr, VERSION 2020.1 (single precision)
Reading file md_1ns_equil_10A_sphere_restrained_10000.tpr, VERSION 2020.1 (single precision)
[login:13575] ***Process received signal***
[login:13575] Signal: Segmentation fault (11)
[login:13575] Signal code: Address not mapped (1)
[login:13575] Failing at address: (nil)
[login:13575] [0] /lib64/libpthread.so.0(+0xf630)[0x7f3e81962630]
[login:13575] [1] /home/adi865j/Softwares/gromacs-2020.1/gromacs-2020.1_built/lib64/libgromacs_mpi.so.5(_Z33gmx_ana_indexmap_init_orgid_groupP18gmx_ana_indexmap_tPK10gmx_mtop_t9e_index_t+0x224)[0x7f3e82d8c6c4]
[login:13575] [2] /home/adi865j/Softwares/gromacs-2020.1/gromacs-2020.1_built/lib64/libgromacs_mpi.so.5(_ZN3gmx9Selection22initOriginalIdsToGroupEPK10gmx_mtop_t9e_index_t+0x22)[0x7f3e82dbea02]
[login:13575] [3] /home/adi865j/Softwares/gromacs-2020.1/gromacs-2020.1_built/lib64/libgromacs_mpi.so.5(+0x965977)[0x7f3e82a0d977]
[login:13575] [4] /home/adi865j/Softwares/gromacs-2020.1/gromacs-2020.1_built/lib64/libgromacs_mpi.so.5(+0x9525d1)[0x7f3e829fa5d1]
[login:13575] [5] /home/adi865j/Softwares/gromacs-2020.1/gromacs-2020.1_built/lib64/libgromacs_mpi.so.5(+0x43dc24)[0x7f3e824e5c24]
[login:13575] [6] /home/adi865j/Softwares/gromacs-2020.1/gromacs-2020.1_built/lib64/libgromacs_mpi.so.5(_ZN3gmx24CommandLineModuleManager3runEiPPc+0x20f)[0x7f3e824dff7f]
[login:13575] [7] gmx_mpi[0x404d4c]
[login:13575] [8] /lib64/libc.so.6(__libc_start_main+0xf5)[0x7f3e80d88555]
[login:13575] [9] gmx_mpi[0x404e11]
[login:13575] ***End of error message***
Segmentation fault (core dumped)

```

Any thoughts?

Thanks in advance.

Best.

---

<div class="post-metadata">

**Author:** ![cblau](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/cblau/32/5_2.png) [@cblau](https://gromacs.bioexcel.eu/u/cblau)\
**Post date:** [October 26, 2020, 11:12am UTC](https://gromacs.bioexcel.eu/t/segmentation-fault-with-pairdist/1006/2 "2020-10-26T11:12:43Z")

</div>

Hi Yasser,

The tool should not segfault, that is a bug to report.

> **[Issues · GROMACS / GROMACS](https://gitlab.com/gromacs/gromacs/-/issues)**
>
> The GROMACS molecular simulation toolkit.

If you can, can you share the system.tpr and `system.xtc` (if it’s large just the first frame should suffice)

If you shared the files, I’ll have a closer look at what caused the issue and if we’re lucky I might be able to give you a hint on how to work around it.

---

<div class="post-metadata">

**Author:** ![yasser.almeida](https://avatars.discourse-cdn.com/v4/letter/y/76d3ee/32.png) [@yasser.almeida](https://gromacs.bioexcel.eu/u/yasser.almeida)\
**Post date:** [October 26, 2020, 12:22pm UTC](https://gromacs.bioexcel.eu/t/segmentation-fault-with-pairdist/1006/3 "2020-10-26T12:22:35Z")

</div>

Thanks for your reply!

---

<div class="post-metadata">

**Author:** ![cblau](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/cblau/32/5_2.png) [@cblau](https://gromacs.bioexcel.eu/u/cblau)\
**Post date:** [October 26, 2020, 12:43pm UTC](https://gromacs.bioexcel.eu/t/segmentation-fault-with-pairdist/1006/4 "2020-10-26T12:43:24Z")

</div>

Hi Yasser,

I just saw that you reported the issue on gitlab! Thanks a lot, that’s very useful!

---

<div class="post-metadata">

**Author:** ![yasser.almeida](https://avatars.discourse-cdn.com/v4/letter/y/76d3ee/32.png) [@yasser.almeida](https://gromacs.bioexcel.eu/u/yasser.almeida)\
**Post date:** [October 26, 2020, 1:26pm UTC](https://gromacs.bioexcel.eu/t/segmentation-fault-with-pairdist/1006/5 "2020-10-26T13:26:45Z")

</div>

You’re welcome.
