tests/ampi/privatization pieglobals-f90 aborts at exit in free from a libgfortran destructor during dlclose

Aperta
#4,157 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
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp, fortran, linux

Direzione di ricerca

Start by tracing how tests/ampi/privatization/pieglobals-f90 loads and unloads each rank’s program copy with dlmopen and dlclose, then inspect how libgfortran state is handled across namespaces. Compare the Fortran case with pieglobals-cxx, which exits cleanly. Confirm a change by running make -C tests/ampi test and the two-process mode; both must finish without the exit-time abort.

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

Descrizione

What

tests/ampi/privatization pieglobals-f90 aborts at exit on Linux, in one process and in two, after passing its tests. The abort is in glibc's free ("munmap_chunk(): invalid pointer") called from a libgfortran destructor while the dynamic loader unloads the program's pie copy (dlclose, the ld-linux frames below _dl_catch_exception). The C++ variant pieglobals-cxx exits cleanly. The run also prints "AMPI> Warning: Use of thread_local detected in pieglobals binary!".

Where it was seen

Delta (x86_64, GCC 14.2, reconverse debug build, recharm 6fb111516 plus #4148), make -C tests/ampi test and TESTRUN_PROCS=2: the only failure in tests/ampi in both modes. Also reported on earlier Delta runs of #4124 and #4142 (2026-11-03) and on Anvil. The Mac has no Fortran compiler, so it is not seen there.

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.so.6(free+0x99)
libgfortran.so.5(+0x25d12b)
libgfortran.so.5(+0x25d2c9)
ld-linux-x86-64.so.2(+0x2601)
ld-linux-x86-64.so.2(_dl_catch_exception+0x115)
...

The abort is inside realCkExit from TCharm::atExit, so every rank's test output has already been printed and checked; the harness still reports Error 134.

Where to look

pieglobals loads a private copy of the program per rank with dlmopen and unloads them at exit. libgfortran keeps per-namespace state (its I/O unit list, allocated with the namespace's malloc) that its destructor frees with the base namespace's free; that is the pattern the error message names. Possible outcomes: skip the dlclose of the pie copies at exit (the process is exiting anyway), or exclude libgfortran from the per-rank namespace. The warning about thread_local is a separate observation and may be a false positive from libgfortran itself.

Touches the charm++ core: no.

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.