Page 1 of 1
PB 5.41 x86 Win XP SP3: Sudden IMA in WaitWindowEvent loop
Posted: Mon Jan 25, 2016 7:55 pm
by Kurzer
I had a look at Keyas floid steinberg dither example which opens a window, shows 2 pictures an then remain in a repeat - until loop with only one WaitWindowEvent() between. After a minute of running in this Repeat - Until loop the programm crashes with an invalid memory access.
Here is keyas example code:
http://www.purebasic.fr/english/viewtop ... 13&t=64688
And this is the error which occurs approximately after one minute runtime.
This error is reproducable on my system.
Copy keyas code into the IDE, change the path and filename to an existing picture in line 88 and start the programm. After the window appears and the two pictures are shown click into the PB IDE and scroll up and down a few lines. After this get up and make a cup of coffee for example or just wait a while. Without any further intervention the program will crash.
As there are no POKEs or other direct memory access in the code, I think the error have nothing to do with the main function of the programm.
Re: PB 5.41 x86 Win XP SP3: Sudden IMA in WaitWindowEvent lo
Posted: Mon Jan 25, 2016 11:46 pm
by s0ula55a551n
I think if you want it to run forever you need to process all events. So ideally you would have until event. = 0 as your whole condition. And then use a select case to deal with specific events in that loop
Re: PB 5.41 x86 Win XP SP3: Sudden IMA in WaitWindowEvent lo
Posted: Tue Jan 26, 2016 9:30 am
by Kurzer
If you say I (or Keya) needs to process all Events in the loop, then please tell us which events are not processed with the WaitWindowEvent() inside the loop.
"Until Event = #PB_Event_CloseWindow" is a valid code, please have a look into the PBs help file for the "BindEvent" example. You will find exactly the same code:
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
So in my opinion it is a bug.
Re: PB 5.41 x86 Win XP SP3: Sudden IMA in WaitWindowEvent lo
Posted: Tue Jan 26, 2016 10:19 am
by ts-soft
In my opinion, is a problem with your Antivirus and not a PB-Problem.
Re: PB 5.41 x86 Win XP SP3: Sudden IMA in WaitWindowEvent lo
Posted: Tue Jan 26, 2016 10:53 am
by Kurzer
Hmm, after reading your post I tested the code without Avira realtime scanner (I switched it off).
The problem is still existing. Crash after 5 seconds this time. Same IMA, same line in sourcecode.
Re: PB 5.41 x86 Win XP SP3: Sudden IMA in WaitWindowEvent lo
Posted: Tue Jan 26, 2016 11:33 am
by Julian
Re: PB 5.41 x86 Win XP SP3: Sudden IMA in WaitWindowEvent lo
Posted: Tue Jan 26, 2016 11:42 am
by Kurzer
Julian, I have no other problems with my machine or the memory.
To proof it is a PB 5.41 problem, the same code runs now since 25 minutes on my computer -> compiled with the older PB 5.31 version. No crash so far. I will let run the code till the rest of the day and will write down the result here.
Why are you all thinking it is a problem of my computer and not a problem of the new PB version?
I have merely reported an error that I noticed. Other users can confirm this bug or not and fred can decide if he will track this issue or not. But I do not have to prove that is not due to millions of other possible causes releated to my computer. Some easy to be tested causes I have now refuted. That should be enough.
Re: PB 5.41 x86 Win XP SP3: Sudden IMA in WaitWindowEvent lo
Posted: Tue Jan 26, 2016 11:51 am
by Julian
kurzer wrote:Why are you all thinking it is a problem of my computer and not a problem of the new PB version?
We don't think its a problem with your machine, we're just trying to rule out some factors as its not a widely reported issue.
Thanks for the PB 5.31 info.
I'll see if I can roll out a VMware of XP SP3 later today and confirm it.
No issues here on W10 with 5.40 x64 or 5.41 x64. I'll give some other versions a try.
Re: PB 5.41 x86 Win XP SP3: Sudden IMA in WaitWindowEvent lo
Posted: Tue Jan 26, 2016 12:03 pm
by walbus
Hi,
remove for testing code lines above, near the event loop.
I think, you can find on this way quickly the reason.
remove #PB_any and the Image handling inside the code for testing
I think ......
Regards Werner
Re: PB 5.41 x86 Win XP SP3: Sudden IMA in WaitWindowEvent lo
Posted: Tue Jan 26, 2016 12:13 pm
by Julian
walbus wrote:Hi,
remove for testing code lines above, near the event loop.
I think, you can find on this way quickly the reason.
remove #PB_any and the Image handling inside the code for testing
I think ......
Regards Werner
That was going to be my next question, could you run it without a PB_Any in there, as I think there's issues with PB_Any at the moment.
Does it still crash for you without the copyimage ?
Re: PB 5.41 x86 Win XP SP3: Sudden IMA in WaitWindowEvent lo
Posted: Tue Jan 26, 2016 2:29 pm
by Kurzer
I terminated the test with PB 5.31 now. The code ran for 3 hours without any crash.
Now I want to try to reproduce the crash with the 5.41 Version again and strip down the code to a point where the bug does not longer appears. Unfortunately after a restart of the PB 5.41 IDE the bug does no longer appear on my system. It seem to be not reproduceable in every cases.

Re: PB 5.41 x86 Win XP SP3: Sudden IMA in WaitWindowEvent lo
Posted: Tue Jan 26, 2016 2:40 pm
by walbus
Restart your system, the Bug is sure not gone.
Re: PB 5.41 x86 Win XP SP3: Sudden IMA in WaitWindowEvent lo
Posted: Tue Jan 26, 2016 2:43 pm
by Kurzer
I will try this after end of work again. At the moment I have to keep this computer online for my job.
Edit: I restarted my computer now and tried to reproduce the bug. Unfortunately the IMA does not appear anymore, but I think it only a question of time and of memory usage - the IMA was not an illusion.
I suspect that the error will be hard to find, if it is caused by an override of memory.
Re: PB 5.41 x86 Win XP SP3: Sudden IMA in WaitWindowEvent lo
Posted: Wed Jan 27, 2016 8:50 am
by netmaestro
I ran the code here on Mac OSX using PB 5.41 final x64 without a problem. The purifier running alongside finds nothing to complain about and if the procedure doing the drawing has finished, all there is left is the WaitWindowEvent() loop and there's nothing wrong with that. Bit of a head-scratcher this one, but if it's crashing sometimes it's not getting along with something. I'd like to be of more help but I'm coming up empty.