LCL seems has bug with IdleTimer lazarus / 31-LCL ---------------------------------------------------------------------- AlexTP · 2020-04-30 20:42 CudaText with last Laz 2.1 trunk shows new bug: SigFPE crash on Linux x64 gtk2, qt5. reason: CreateHandle called too much and gives raise. reason: Createhandle called too early with Form's handle not created. reason: IdleTimer.OnTimer fires too early when form handle not created. added check "if HandleAllocated" in CudaText r63051 ---------------------------------------------------------------------- marcov · 2020-04-30 20:52 Afaik idle is a property of Application, not form?!?! ---------------------------------------------------------------------- AlexTP · 2020-04-30 20:56 ExtCtrls   TIdleTimer = class(TCustomIdleTimer) ---------------------------------------------------------------------- jamie · 2020-04-30 21:01 I timer is a very poor place to be creating and managing handles and code that rely of other classes to be initiated..   On top of all that, you must ensure that the timer code does not get re-entered while doing so..  I don't know how they work in Linux but in windows you have two options, a message or a direct call..  If Linux is dong a directly call then I would say that maybe things could be re-entering. Like I said, its a bad place to be doing such things.. ---------------------------------------------------------------------- AlexTP · 2020-04-30 21:06 TIdleTimer worked long time before. it updated ATSynEdit control (creating its handle). all worked. now it gives that crash. ---------------------------------------------------------------------- jamie · 2020-04-30 21:20 But you are just throwing stones, have you tested for re-entries ? have you done any real debugging ? ---------------------------------------------------------------------- AlexTP · 2020-05-03 06:36 no re-entires. I see the stack trace. it shows no re-entries. it shows that TIdleTImer is called too early. since last Lazarus versions ---------------------------------------------------------------------- jamie · 2020-05-03 11:21 I don't know what to tell you except for me I wouldn't be creating items in that event.  Are you using any form of exception (try, except, end etc) while in that event ? ---------------------------------------------------------------------- MarkMLl · 2020-05-03 12:11 Quote from: Alextp on April 30, 2020, 10:42:02 pmCudaText with last Laz 2.1 trunk shows new bug: SigFPE crash on Linux x64 gtk2, qt5. reason: CreateHandle called too much and gives raise. reason: Createhandle called too early with Form's handle not created. reason: IdleTimer.OnTimer fires too early when form handle not created. added check "if HandleAllocated" in CudaText r63051 Don't write your code like that. At the end of the form's OnCreate handler put something like Code: [Select]...   Application.QueueAsyncCall(@OnAfterShow, WatchCodeMagicNumber) (* Keep at end *) end { TWatchForm.FormCreate } ; The OnAfterShow() procedure won't be invoked until after the message loop is running and you can be confident that all forms etc. are fully initialised, that's where you put anything that relies on them and finally you start your timers. In older versions of the LCL you could put a ReadLn() loop into the OnAfterShow() procedure to read and execute locally-entered commands, that doesn't work reliably any more. I mention that only because it's a good illustration that there are areas where mere users are not supposed to tread, and you appear to have strayed into them wearing heavy boots. MarkMLl