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() andActivityManager::closeLocks() are never called — the mutexes are never destroyed.Interpreter::processStartup() runs at library unload, calling createLocks() andActivityManager::createLocks() a second time. These are no-ops in practice becauseSysMutex::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().
Anonymous
Fixed in r13195.
Commit [r13195]
Related
Commit: [r13195]