Menu

#2077 Unix SystemInterpreter::processShutdown() calls Interpreter::processStartup()

5.3.0
pending
nobody
None
none
5
2026-08-09
2026-07-25
No

Copy-paste error: the Unix shutdown path calls the startup function.

interpreter/platform/unix/SystemInterpreter.cpp:59
void SystemInterpreter::processShutdown()
{
// now do the platform independent shutdown
Interpreter::processStartup();
}

Compare Windows, which is correct:

interpreter/platform/windows/SystemInterpreter.cpp:179-182
void SystemInterpreter::processShutdown()
{
...
Interpreter::processShutdown();
}

SystemInterpreter::processShutdown() is called from _rexx_fini(), the shared-library destructor
(interpreter/platform/unix/SystemInitialization.cpp:62).

Effect on Unix:

  • Interpreter::processShutdown() never runs, so Interpreter::closeLocks() and
    ActivityManager::closeLocks() are never called — the mutexes are never destroyed.
  • Instead Interpreter::processStartup() runs at library unload, calling createLocks() and
    ActivityManager::createLocks() a second time. These are no-ops in practice because
    SysMutex::create() returns early when already created, but the intent is clearly wrong.

Consequences are mild today (leaked mutexes at process exit, no shutdown processing), but the
asymmetry between platforms is a trap for anyone reasoning about lock lifetime — it misled me while
investigating [bugs:#2071].

Fix: call Interpreter::processShutdown().

Related

Bugs: #2071

Discussion

  • Moritz Hoffmann

    Moritz Hoffmann - 2026-08-02
    • status: open --> closed
     
  • Moritz Hoffmann

    Moritz Hoffmann - 2026-08-02

    Fixed in r13195.

     
  • jfaucher

    jfaucher - 2026-08-09
    • status: closed --> pending
     
  • jfaucher

    jfaucher - 2026-08-09

    Commit [r13195]

     

    Related

    Commit: [r13195]

Anonymous
Anonymous

Add attachments
Cancel