Seriously, somebody remind me NOT to use a Timer in the Compact Framework. Ever again...
Situation: I've got a timer ticking every 250 ms, and somehow checking a previous timestamp vs the current timestamp has blown my stack. On a whim I'd say I'm encountering threading problems... but who could tell looking at the stack trace? (I've pasted the entire strack trace here for your enjoyment - that, and because I really can't believe how large it is for such a piddly piece of functionality)
Stack Trace:
at System.CurrentSystemTimeZone.GetDayOfWeek()\r\nat System.CurrentSystemTimeZone.GetDaylightChanges()\r\nat System.CurrentSystemTimeZone.GetUtcOffsetFromUniversalTime()\r\nat System.CurrentSystemTimeZone.ToLocalTime()\r\nat System.DateTime.ToLocalTime()\r\nat System.DateTime.get_Now()\r\nat DeviceApplication2.LogonForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\
nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._Internal
ContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\n
at System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat Device
Application2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceAp
plication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windo
ws.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.Applica
tionThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsof
t.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Applicat
ion.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.LogonForm.UpdateStatus()\r\nat DeviceApplication2.LogonForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r
\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.LogonForm.UpdateStatus()\r\nat DeviceApplication2.LogonForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Window
s.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.LogonForm.UpdateStatus()\r\nat DeviceApplication2.LogonForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.Yield()\r\nat System.Windows.Forms.Application.DoEvents()\r\nat DeviceApplication2.UserPatientsForm.UpdateStatus()\r\nat DeviceApplication2.UserPatientsForm.Timer_Tick()\r\nat System.Windows.Forms.Timer._WnProc()\r\nat System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()\r\nat Microsoft.AGL.Forms.EVL.EnterMainLoop()\r\nat System.Windows.Forms.Application.Run()\r\nat DeviceApplication2.Program.Main()\r\n"
UPDATE: I don't believe it. After all these years of being sarcastic, and complaining - it looks like this time it might have helped. After posting this piglet, and looking at it on something large enough to read the trace, it sure looks like something is recursing on me. (And speaking of cursing, that's what I'd be doing right now if this trace wasn't so comical.) At any rate... I'm now off to see what/why a Timer Tick looks like it's recursing... (mmmmm, stack-popping goodness...)




Thanks, you broke my rss reader.
Posted by: Carson | March 01, 2006 at 02:11 PM
I would start by finding out what the DoEvents() thingie does, and why this is called.
It looks like while the timer is running a DoEvent is called, and that causes problems.
I suspect that the problem is: Microsoft.AGL.Forms.EVL.Yield()
Posted by: Ayende Rahien | March 01, 2006 at 03:56 PM