OPAL/PTLib 3.18.8/2.18.8 release bundle on Linux arm.
When an OPAL application is terminated, a piece of trace log looks like:
2022/06/02 15:48:57.340 Opal Garbage:28449 call.cxx(103) Call Destroyed Call[Ccf9ba3ed1] ptr=0xb6305c28
...
2022/06/02 15:48:59.793 SIP Pool:28474 sippdu.cxx(4614) SIP Handling timeout for transaction using id=z9hG4bK003f3707e0e0ec11af444b397f7293a6
2022/06/02 15:48:59.794 SIP Pool:28474 sippdu.cxx(3732) SIP Set state Terminated_Success for Response transaction id=z9hG4bK003f3707e0e0ec11af444b397f7293a6
2022/06/02 15:48:59.794 SIP Pool:28474 sippdu.cxx(3759) SIP Completed state for transaction id=z9hG4bK003f3707e0e0ec11af444b397f7293a6
2022/06/02 15:48:59.794 SIP Pool:28474 sippdu.h(930) SIP Handled timeout
2022/06/02 15:49:00.348 Opal Garbage:28449 sippdu.cxx(3343) SIP Transaction id=z9hG4bK003f3707e0e0ec11af444b397f7293a6 destroyed.
...
2022/06/02 15:49:24.545 PTLib Housekeeper:28447 osutils.cxx(2990) PTLib Received signal SIGTERM from pid=28580, cmdline="/data/sos95gw -t"
...
2022/06/02 15:49:24.985 PTLib Housekeeper:28447 manager.cxx(447) OpalMan Shutting down manager.
2022/06/02 15:49:24.985 PTLib Housekeeper:28447 manager.cxx(804) OpalMan Clearing all calls and waiting, primary thread.
2022/06/02 15:49:25.396 PTLib Housekeeper:28447 manager.cxx(822) OpalMan All calls cleared.
2022/06/02 15:49:25.396 PTLib Housekeeper:28447 manager.cxx(460) OpalMan Shutting down endpoints.
2022/06/02 15:49:25.396 PTLib Housekeeper:28447 sipep.cxx(123) SIP Shutting down.
...
But if I try to terminate the program immediately after the last call is cleared, the process cannot exit. Analyzing trace logs, I noticed that in this case no messages "Handling timeout for transaction using id=..." appear in the log and the following messages are repeatedly written:
Opal Garbage:30193 sipep.cxx(570) SIP Garbage collection: transactions=1, connections=0
Opal Garbage:30193 safecoll.cxx(100) SafeColl 11SIPResponse 0xb6315610 incremented reference count to 2
Opal Garbage:30193 safecoll.cxx(100) SafeColl 11SIPResponse 0xb6315610 incremented reference count to 3
Opal Garbage:30193 safecoll.cxx(137) SafeColl 11SIPResponse 0xb6315610 decremented reference count to 2
Opal Garbage:30193 safecoll.cxx(137) SafeColl 11SIPResponse 0xb6315610 decremented reference count to 1
And this continues permanently preventing the process to terminate properly.
I'm not attaching a full trace log since at level 7 it is very large. I guess a "SIPResponse" object created for "BYE" transaction can't be removed by the OPAL garbage collector without setting its correct state shown in the log as "Set state Terminated_Success for Response transaction id=..." This can happen if for some reason "Handling timeout for transaction..." is not executed.