Skip to content

Segmentation fault when running an MPI job on MacOS Monterey with the M1 chip #105

Description

@ktbolt

I have successfully built svSolver on MacOS Monterey / M1 chip using OpenMPI and a local VTK install.

I can run simulations fine on a single processor but when I try to run using multiple processors I get a Segmentation fault in Metis

Signal: Segmentation fault: 11 (11)
Signal code: Invalid permissions (2)
Failing at address: 0x19
[ 0] 0   libsystem_platform.dylib            0x00000001bb9684e4 _sigtramp + 56
[ 1] 0   ???                                 0xffff800100d9657c 0x0 + 18446603340530410876
[ 2] 0   svsolver                            0x0000000100d91bb8 __GrowBisection + 976
[ 3] 0   svsolver                            0x0000000100d9175c __Init2WayPartition + 140
[ 4] 0   svsolver                            0x0000000100d946a4 __MlevelRecursiveBisection + 208
[ 5] 0   svsolver                            0x0000000100d94514 METIS_WPartGraphRecursive + 520
[ 6] 0   svsolver                            0x0000000100d9a3a4 __MlevelKWayPartitioning + 248
[ 7] 0   svsolver                            0x0000000100d9a210 METIS_WPartGraphKway + 456
[ 8] 0   svsolver                            0x0000000100d9a024 METIS_PartGraphKway + 244
[ 9] 0   svsolver                            0x0000000100d19580 _Z17Partition_ProblemiPcS_ + 2380
[10] 0   svsolver                            0x0000000100d2604c main + 1160

It seems that the problem occurs in the function void GKfree(void **ptr1, ...) that frees memory using a variable argument list. The seg fault occurs when processing arguments

  while ((ptr = va_arg(plist, void **)) != LTERM) {
    if (*ptr != NULL) {
      free(*ptr);
    }
   *ptr = NULL;
  }

The first call to va_arg(plist, void **) returns a bad memory address.

If I modify GKfree() to just return then the simulation runs fine.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions