Hi folks,
I have a problem with one of my Windows programs I developed for one of my clients.
It is running 100% stable when compiled with PB 5.46 LTS but will crash randomly after 5 - 30 min in use when compiled with all later versions. Crash means the program window freezes. Sometimes the you can still close the program by the window exit button sometimes you have to you the task manager to kill it. The behavior is the same if you run it in the IDE debugger or as standalone compiled program. OnError or debugger is not triggered at all. The crash can't be reproduced by a certain action in the program.
Can I get information from Windows what caused the crash? Windows 32 and 64 bit show the same behavior.
Since there is a lot of Canvas Gadget event handling involved can it be that the updates to the Canvas Gadget (container) might cause the crashes?
All ideas are welcome!
Erich
Non reproducable crash with PB 5.6 and later
Non reproducable crash with PB 5.6 and later
e-biker using Purebasic since 2009 for hobby and business
Re: Non reproducable crash with PB 5.6 and later
Without code it's hard to say... but 5.46 was the latest Version with ASCII support.
Maybe you use an extern lib that requires ASCII values... maybe you are using threads ?
Many things....
Maybe you use an extern lib that requires ASCII values... maybe you are using threads ?
Many things....
Re: Non reproducable crash with PB 5.6 and later
My mistake; it's not a crash situation in the manner I was describing. Pointless tips removed.
Last edited by BarryG on Sat Sep 14, 2019 12:06 pm, edited 1 time in total.
Re: Non reproducable crash with PB 5.6 and later
The description sounds like it's not a crash at all, but rather a freezing (unresponsive). Maybe there is some event processing done wrong?
Re: Non reproducable crash with PB 5.6 and later
First try running it with the purifier enabled and see what happens. Alternatively you can run a tracer. I think the purebasic forum had two of them as tools, but they might be years old. I personally use my own version, but its not ready for release.
If it is a message processing problem, you might just use a bunch of debug commands to find the reason, or something like a windows message debugging tool. The one on my website includes a purebasic source interface to debug message processing from the inside of your application.
If you still dont know what is the cause : make it crash while running it from WinAPIOverride. Then check the bottom log of what happened.
If it is a message processing problem, you might just use a bunch of debug commands to find the reason, or something like a windows message debugging tool. The one on my website includes a purebasic source interface to debug message processing from the inside of your application.
If you still dont know what is the cause : make it crash while running it from WinAPIOverride. Then check the bottom log of what happened.
Re: Non reproducable crash with PB 5.6 and later
To elaborate on this..#NULL wrote:The description sounds like it's not a crash at all, but rather a freezing (unresponsive). Maybe there is some event processing done wrong?
If you react to events by doing things that trigger other events, this could lead to endless (or at least very long) loops. For example with the following code on Linux if you resize the window with the mouse by making it smaller, this will trigger events repeatedly and the window becomes unresponsive, at least for a while.
Code: Select all
win = OpenWindow(#PB_Any, 50,100, 800, 600, "..", #PB_Window_SystemMenu | #PB_Window_SizeGadget)
Repeat
While WaitWindowEvent(10)
Select Event()
Case #PB_Event_CloseWindow
quit = #True
Case #PB_Event_SizeWindow
Debug "size event, " + Random(999)
ResizeWindow(win, #PB_Ignore, #PB_Ignore, 810, #PB_Ignore)
EndSelect
Wend
Debug "events done"
Until quit
With the following code all events are processed first and only then are new events triggered:
Code: Select all
win = OpenWindow(#PB_Any, 50,100, 800, 600, "..", #PB_Window_SystemMenu | #PB_Window_SizeGadget)
Repeat
sized = #False
While WaitWindowEvent(10)
Select Event()
Case #PB_Event_CloseWindow
quit = #True
Case #PB_Event_SizeWindow
sized = #True
Debug "size event, " + Random(999)
EndSelect
Wend
Debug "events done"
If sized
ResizeWindow(win, #PB_Ignore, #PB_Ignore, 810, #PB_Ignore)
EndIf
Until quit
Re: Non reproducable crash with PB 5.6 and later
Yes, for cases like this, would a log file and healthy delay()'s,10-100ms help?
If the log file is blocking, that slows down the rat race.
If the log file is blocking, that slows down the rat race.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: Non reproducable crash with PB 5.6 and later
Thank you all!
Your comments are great and now I think so too, that the error is an unresponsive freezing.
I have the admit that the error occurred now once also with PB 5.46 LTS, so my assumption and the topic of this thread is not correct.
I will have to scrutinize the event handling and try to separate the different events in the loop.
You all really helped me a lot!
Erich
Your comments are great and now I think so too, that the error is an unresponsive freezing.
I have the admit that the error occurred now once also with PB 5.46 LTS, so my assumption and the topic of this thread is not correct.
I will have to scrutinize the event handling and try to separate the different events in the loop.
You all really helped me a lot!
Erich
e-biker using Purebasic since 2009 for hobby and business


