https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105299

            Bug ID: 105299
           Summary: dereference null pointer
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xw111luoye at gmail dot com
  Target Milestone: ---

My application runs in parallel on Power9 RHEL 8.2 using gcc 9.3. The failure
doesn't show up in small scale runs. However, when running with 24576(4096*6)
MPI processes,

code:
void* ArgMappers; // passed in as a function argument.
...
    if (ArgMappers) {
      fprintf(stderr, "ArgMappers is not nullptr %p, I = %d\n", ArgMappers, I);
      if (ArgMappers[I]) {

segfault happens at the second 'if'.
the print out and failure message is
ArgMappers is not nullptr (nil), I = 3
[g32n01:3164430] *** Process received signal ***
[g32n01:3164430] Signal: Segmentation fault (11)
[g32n01:3164430] Signal code: Address not mapped (1)
[g32n01:3164430] Failing at address: 0x18

It is very strange that the first if check passed while ArgMappers is has a
value NULL as the printf shows.
In a few more runs, I got at least three failing
"Failing at address" 0x8 0x18 0x40
Any insight is welcome.

Reply via email to