AMPI pieglobals-f90 aborts at exit in libgfortran's destructor with gfortran 11.2 (Anvil)

Aperta
#4,189 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, cpp, fortran, linux

Direzione di ricerca

Start by reproducing tests/ampi/privatization's pieglobals-f90 variant on Anvil with gfortran 11.2.0; the issue suggests using gdb with MALLOC_CHECK_ or glibc debug symbols to identify the invalid pointer in libgfortran's destructor. Determine whether the destructor runs against shared state across loaded copies or a thread-local block is freed too early, then confirm the fix by rerunning the failing variant.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What

tests/ampi/privatization, the pieglobals-f90 variant, aborts at exit on Anvil (Purdue) with gfortran 11.2.0. The program's work completes; the abort happens in the loader's teardown, inside libgfortran's destructor:

AMPI> Warning: Use of thread_local detected in pieglobals binary!
munmap_chunk(): invalid pointer
[0] Fatal signal 6 (SIGABRT); stack trace (most recent call first):
  libc abort <- libc free <- libgfortran.so.5 (+0x251a3b, +0x251bd9) <- ld-linux-x86-64.so.2 (+0x6334)
  ... TCharm::atExit <- CkIndex_TCharm::_call_atExit_CkReductionMsg <- CkDeliverMessageFree ... CsdScheduler
srun: error: b028: task 0: Aborted

First run of the variant, +pe 1 +vp2 +balancer RandCentLB, fails this way in one process and in two (a one-PE test runs as one process either way). make then stops, so the later privatization variants in that directory never run there.

Where it does and does not happen

  • Anvil: Rocky Linux 8.10, gcc/gfortran 11.2.0 (Spack), reconverse-linux-x86_64 debug build at recharm 2a2d1ac67 (plain build) and at the #4186 branch (syncft build): fails identically on both, so it is independent of #4186.
  • The fsglobals-cxx, fsglobals-f90, pipglobals-cxx, pipglobals-f90 and pieglobals-cxx variants pass there (four runs each).
  • The Linux CI job runs the same test on Ubuntu with its newer gfortran and passes.
  • macOS has no gfortran, so the Fortran variants are skipped there.

Reading

pieglobals loads the executable itself as a shared object once per rank so that each rank gets its own copy of the globals. libgfortran 11 uses thread-local storage (hence AMPI's startup warning) and its destructor, run by the loader at exit, frees a pointer that is no longer valid, which glibc reports as munmap_chunk(): invalid pointer. The exact pointer is not yet identified; a run under gdb with MALLOC_CHECK_ or a glibc with debug symbols would show which libgfortran object it belongs to. Candidates: the destructor running once per loaded copy against one shared state, or a thread-local block freed with the rank's copy before the destructor runs.

A Fortran user of -pieglobals on a gcc 11 system should expect this abort at exit until it is understood. Low priority: it does not affect the program's results, the other privatization modes work, and CI's toolchain is unaffected.

Logs: Anvil $PROJECT/memckpt-pra-20261107/logs/f1/privatization.log (and f2/, plain/), Slurm job 22021046, 2026-11-07.

🤖 Generated with Claude Code

Lingua principale
C++
Stelle
241
Fork
62
Merge medio
1g 1h
PR unite (30g)
121

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di charmplusplus/charm

Tutte le issue di charmplusplus/charm

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.