Hello,
I’m using TROEventReceiver
from version 10.0.0.1489 of the SDK to allow my server to notify its clients (nodes) of new events.
While this works most of the time, it happens that the one of the node experiences a series of exceptions originating in TROEventReceiver.OnTimerTick
that calls TROEventReceiver.Invoke_GetEventsData
.
Here is an extract of a bug report generated by madExcept:
exception class : EPrivilege
exception message : Privileged instruction.
thread $2938 (TROThreadTimer):
00450043 +113 AGNode.exe System.SysUtils .TThreadLocalCounter
008474f9 +0cd AGNode.exe uROEventReceiver 569 +27 TROEventReceiver.OnTimerTick
77ec3be1 +021 ntdll.dll KiUserExceptionDispatcher
0076a9dc +0d8 AGNode.exe uROTransportChannel 797 +21 TROTransportChannel.Dispatch
00846d29 +135 AGNode.exe uROEventReceiver 419 +20 TROEventReceiver.Invoke_GetEventsData
008474a4 +078 AGNode.exe uROEventReceiver 562 +20 TROEventReceiver.OnTimerTick
0076600c +014 AGNode.exe uROThreadTimer 170 +3 TROThreadTimer.RunEvent
00765fd1 +049 AGNode.exe uROThreadTimer 152 +28 TROThreadTimer.IntExecute
0076543f +07f AGNode.exe uROInitializedThread 58 +7 TROInitializedThread.Execute
004b08ff +02b AGNode.exe madExcept HookedTThreadExecute
0054cfdd +049 AGNode.exe System.Classes ThreadProc
0040b1bc +028 AGNode.exe System 1556 +0 ThreadWrapper
004b07e5 +00d AGNode.exe madExcept CallThreadProcSafe
004b084a +032 AGNode.exe madExcept ThreadExceptFrame
77aa0417 +017 KERNEL32.DLL BaseThreadInitThunk
>> created by thread $282c (TROPooledThread) at:
0054d0a0 +018 AGNode.exe System.Classes TThread.Create
thread $2938 (TROThreadTimer), inner exception level 1:
>> EAccessViolation, Access violation at address 0053E0A7 in module 'AGNode.exe'. Read of address 00000000
0053e0a7 +00b AGNode.exe System.Classes TStream.SetPosition
00934fef +0bf AGNode.exe uROBinMessage 494 +12 TROBinMessage.WriteStream
00934a8a +04e AGNode.exe uROBinMessage 395 +4 TROBinMessage.WriteToStream
0076a9dc +0d8 AGNode.exe uROTransportChannel 797 +21 TROTransportChannel.Dispatch
00846d29 +135 AGNode.exe uROEventReceiver 419 +20 TROEventReceiver.Invoke_GetEventsData
008474a4 +078 AGNode.exe uROEventReceiver 562 +20 TROEventReceiver.OnTimerTick
0076600c +014 AGNode.exe uROThreadTimer 170 +3 TROThreadTimer.RunEvent
00765fd1 +049 AGNode.exe uROThreadTimer 152 +28 TROThreadTimer.IntExecute
0076543f +07f AGNode.exe uROInitializedThread 58 +7 TROInitializedThread.Execute
004b08ff +02b AGNode.exe madExcept HookedTThreadExecute
0054cfdd +049 AGNode.exe System.Classes ThreadProc
0040b1bc +028 AGNode.exe System 1556 +0 ThreadWrapper
004b07e5 +00d AGNode.exe madExcept CallThreadProcSafe
004b084a +032 AGNode.exe madExcept ThreadExceptFrame
77aa0417 +017 KERNEL32.DLL BaseThreadInitThunk
0054d0a0 +018 AGNode.exe System.Classes TThread.Create
The outer exception is raised as a consequence of the first one which looks as if the fStream
private field from the TROBinMessage
instance is nil
Note that this exception has a tragic consequence because it is not caught anywhere in the call stack and thus leads to the death of the timer thread.
In the default case, this means no further event will ever be received, but because I configured madExcept to do so, my nodes are instantly killed whenever an uncaught exception is triggered.
Is this something that you have already experienced? Is there a workaround?