Page 1 of 1
PB 4.51 x86 - Memory page error
Posted: Wed Oct 06, 2010 12:37 am
by Mistrel
I've been getting a lot of these; at least several a day. The IDE will crash at random for almost anything with no consistency as to the cause.
Like just now, I tried to compile/run from the IDE, but the PB compiler crashed. The IDE restarted it, I tried to compile again, it reported an error in my code. Fixed that, compile/run, crash.
Another time it crashed after I attempted to resize the procedure window. And another when I changed the font in the debug window.
I am running both the IDE and the loaded project (just files, not an actual "project") over a network, if that might be related.
---------------------------
Error
---------------------------
An Error has been detected in the IDE!
Error: Memory page error
IDE build on 09/07/2010 [21:57] by Fred
Branch: v4.50 Revision: 1261
---------------------------
OK
---------------------------
Re: PB 4.51 x86 - Memory page error
Posted: Wed Oct 06, 2010 1:26 am
by freak
> I am running both the IDE and the loaded project (just files, not an actual "project") over a network, if that might be related.
Yes, that is probably the reason. Looks like your network connection is failing and therefore the system is not able to page in parts of the executable from the network source.
This error is the EXCEPTION_IN_PAGE_ERROR exception. Here is what the MS docs say about it:
The thread tried to access a page that was not present, and the system was unable to load the page. For example, this exception might occur if a network connection is lost while running a program over the network.
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
So i'd say this is not an IDE problem.
Re: PB 4.51 x86 - Memory page error
Posted: Wed Oct 06, 2010 3:49 am
by Mistrel
Also:
This one was while I attempted to change the indentation type to block in the IDE. I did so, hit ok, then ok again, and crash.
---------------------------
Error
---------------------------
An Error has been detected in the IDE!
Error: Invalid memory access
IDE build on 09/07/2010 [21:57] by Fred
Branch: v4.50 Revision: 1261
---------------------------
OK
---------------------------
Yes, that is probably the reason. Looks like your network connection is failing and therefore the system is not able to page in parts of the executable from the network source.
It sounds plausible however I've been working for hours every day in NetBeans over the same network from the same computer-to-computer without a problem. And NetBeans will throw a fit if it can't access something.
Is there any way to get more information about this problem? I will copy PureBasic over to my local machine and see if that helps. Merely accessing the project itself should safely tell me that it can't save/read the file without crashing.
Since it's an exception you could try catching it and reinitializing whatever it was you were trying to access and report a "I can't open file such-and-such" error instead of crashing.
Thinking about this a little bit more, I think the problem has to do with some object or handle "timing out". For example, this last error occurred when I tried to do something after being idle for a while. Possibly a named pipe or file handle?
Re: PB 4.51 x86 - Memory page error
Posted: Wed Oct 06, 2010 4:11 am
by freak
See also:
http://blogs.msdn.com/b/oldnewthing/arc ... 72708.aspx
This exception is raised because the OS is not able to load a requested page into memory. That is no the program's fault. The problem is in the medium from which the data comes (in your case the network).
Re: PB 4.51 x86 - Memory page error
Posted: Wed Oct 06, 2010 4:39 am
by Mistrel
I'll have a look at my router. Maybe there is something else timing out that I'm not aware of. Thank you for the links.
There is a great suggestion from Raymond's blog, if your compiler supports the switch:
We started seeing this problem a while back when running our software across the network (from a mapped drive). The answer I came up with was to use the /SWAPRUN:NET linker flag which instructs windows to make a local copy of the program first before loading it. Not seen the error since.
I would be happy to test it if you send me an IDE compiled with this flag.
Re: PB 4.51 x86 - Memory page error
Posted: Wed Oct 06, 2010 11:55 am
by Mistrel
I've been running the IDE locally now and I haven't had a crash in hours. So it's probably due to the network. Too bad. I wish I knew what was wrong.

Re: PB 4.51 x86 - Memory page error
Posted: Wed Oct 06, 2010 4:31 pm
by freak
This should have the flag set:
http://freak.purearea.net/stuff/PureBasic.exe
This only affects the IDE. The compiler (or any DLL that the IDE needs for that matter) can still be swapped, so this is no guarantee for success.
Keep in mind though that this only hides your real problem. You should try to figure out why the network has trouble in the first place.
edit:
If this error happens again, try running "net statistics workstation" from a commandline. It should give you some information on errors with the network connection.
Re: PB 4.51 x86 - Memory page error
Posted: Thu Oct 07, 2010 2:54 am
by Mistrel
I've managed to duplicate one error. It's an "Invalid memory access", not a memory page error. However I may have confused the two as they were occurring so as far as bug hunting, I think we should work on combating one at a time. They may even be related.
The behavior is slightly inconsistent but readily duplicable when the IDE is run over a network. The bug still exists even when I tried the new "SWAPRUN" version. I do not have any problem when I run the IDE on this machine instead of over the network.
The bug is triggered by opening the IDE, File -> Preferences -> Indentation, and changing the code indentation. It may take two or three tries but it's definitely duplicable if you're persistent.
Here is a video demonstrating the error, if for some reason it doesn't appear when you test it. I am using PureBasic 4.51 x86. My local computer is XP x64 and the remote computer is Windows 7 Professional x64.
http://3dfolio.com/files/pb_network_crash.zip
Here is the video codec you will need to view the file. It should play fine in Windows Media Player:
http://download.techsmith.com/ensharpen ... versal.zip
If you can confirm this as a real bug and send me another version, I will see if I can get any more memory access errors and also try to locate the elusive memory page error.