1. Euphoria and Windows XP SP2
- Posted by Tommy Carlier <tommy.carlier at telenet.be> Sep 18, 2004
- 477 views
I just updated to Windows XP SP2, and there were some problems with Euphoria. My computer is only a few months old, and has an AMD Athlon64 CPU, which has builtin DEP (data execution protection). When enabled, this prevents data from being executed. In SP2, DEP is by default enabled only for critical services and applications. This causes no problems with Euphoria. However, when I enable it for ALL applications, Euphoria-programs get machine errors. Like suggested in previous posts, the manually constructed assembly-routines cause problems. But there were also problems with c_func and c_proc: I can show a message_box from Euphoria, but I can't open a window (CreateWindow and CreateWindowEx throw an error). This even happens with the small demos that come with Euphoria (WINDOW.EXW, WINWIRE.EXW). As I said, the default settings of SP2 cause no problems, but if DEP is enabled for all applications, even the simplest Euphoria Win32-application crashes (leaves with a machine error). Below, you find EX.ERR produced by WINDOW.EXW: C:\EUPHORIA\DEMO\WIN32\WINDOW.EXW:228 in procedure WinMain() A machine-level exception occurred during execution of this statement szAppName = 682872 hwnd = <no value> msg = 682824 wndclass = 682768 WndProcAddress = 683000 class = 704865 id = 0 icon_handle = 590457 ... called from C:\EUPHORIA\DEMO\WIN32\WINDOW.EXW:254 Global & Local Variables C:\EUPHORIA\include\misc.e: pretty_end_col = <no value> pretty_chars = <no value> pretty_start_col = <no value> pretty_level = <no value> pretty_file = <no value> pretty_ascii = <no value> pretty_indent = <no value> pretty_ascii_min = <no value> pretty_ascii_max = <no value> pretty_fp_format = <no value> pretty_int_format = <no value> pretty_line = <no value> C:\EUPHORIA\include\machine.e: mem = 666392 check_calls = 1 C:\EUPHORIA\DEMO\WIN32\WINDOW.EXW: LoadIcon = 0 LoadCursor = 1 GetStockObject = 2 RegisterClassEx = 3 CreateWindow = 4 ShowWindow = 5 UpdateWindow = 6 GetMessage = 7 TranslateMessage = 8 DispatchMessage = 9 PlaySound = 10 BeginPaint = 11 GetClientRect = 12 DrawText = 13 EndPaint = 14 PostQuitMessage = 15 DefWindowProc = 16 wav_file = 529352 Euphoria = 682000 ps = 682048 rect = 682120 my_title = 682248 -- tommy online: http://users.telenet.be/tommycarlier tommy.blog: http://tommycarlier.blogspot.com Euphoria Message Board: http://uboard.proboards32.com
2. Re: Euphoria and Windows XP SP2
- Posted by CoJaBo <cojabo at suscom.net> Sep 18, 2004
- 443 views
You will have to disable it for Euphoria. I am getting an Athlon64 DTR laptop, it will probably have the same problem. Tommy Carlier wrote: > > I just updated to Windows XP SP2, and there were some > problems with Euphoria. My computer is only a few months > old, and has an AMD Athlon64 CPU, which has builtin DEP > (data execution protection). When enabled, this prevents > data from being executed. > In SP2, DEP is by default enabled only for critical > services and applications. This causes no problems with > Euphoria. However, when I enable it for ALL applications, > Euphoria-programs get machine errors. Like suggested in > previous posts, the manually constructed assembly-routines > cause problems. But there were also problems with c_func > and c_proc: I can show a message_box from Euphoria, but > I can't open a window (CreateWindow and CreateWindowEx > throw an error). This even happens with the small demos > that come with Euphoria (WINDOW.EXW, WINWIRE.EXW). > > As I said, the default settings of SP2 cause no problems, > but if DEP is enabled for all applications, even the simplest > Euphoria Win32-application crashes (leaves with a machine error). > > Below, you find EX.ERR produced by WINDOW.EXW: > > C:\EUPHORIA\DEMO\WIN32\WINDOW.EXW:228 in procedure WinMain() > A machine-level exception occurred during execution of this statement > szAppName = 682872 > hwnd = <no value> > msg = 682824 > wndclass = 682768 > WndProcAddress = 683000 > class = 704865 > id = 0 > icon_handle = 590457 > > ... called from C:\EUPHORIA\DEMO\WIN32\WINDOW.EXW:254 > > Global & Local Variables > > C:\EUPHORIA\include\misc.e: > pretty_end_col = <no value> > pretty_chars = <no value> > pretty_start_col = <no value> > pretty_level = <no value> > pretty_file = <no value> > pretty_ascii = <no value> > pretty_indent = <no value> > pretty_ascii_min = <no value> > pretty_ascii_max = <no value> > pretty_fp_format = <no value> > pretty_int_format = <no value> > pretty_line = <no value> > > C:\EUPHORIA\include\machine.e: > mem = 666392 > check_calls = 1 > > C:\EUPHORIA\DEMO\WIN32\WINDOW.EXW: > LoadIcon = 0 > LoadCursor = 1 > GetStockObject = 2 > RegisterClassEx = 3 > CreateWindow = 4 > ShowWindow = 5 > UpdateWindow = 6 > GetMessage = 7 > TranslateMessage = 8 > DispatchMessage = 9 > PlaySound = 10 > BeginPaint = 11 > GetClientRect = 12 > DrawText = 13 > EndPaint = 14 > PostQuitMessage = 15 > DefWindowProc = 16 > wav_file = 529352 > Euphoria = 682000 > ps = 682048 > rect = 682120 > my_title = 682248 > > -- > tommy online: <a > href="http://users.telenet.be/tommycarlier">http://users.telenet.be/tommycarlier</a> > tommy.blog: <a > href="http://tommycarlier.blogspot.com">http://tommycarlier.blogspot.com</a> > Euphoria Message Board: <a > href="http://uboard.proboards32.com">http://uboard.proboards32.com</a> >
3. Re: Euphoria and Windows XP SP2
- Posted by Robert Craig <rds at RapidEuphoria.com> Sep 18, 2004
- 433 views
Tommy Carlier wrote: > In SP2, DEP is by default enabled only for critical > services and applications. This causes no problems with > Euphoria. However, when I enable it for ALL applications, > Euphoria-programs get machine errors. Like suggested in > previous posts, the manually constructed assembly-routines > cause problems. But there were also problems with c_func > and c_proc: I can show a message_box from Euphoria, but > I can't open a window (CreateWindow and CreateWindowEx > throw an error). This even happens with the small demos > that come with Euphoria (WINDOW.EXW, WINWIRE.EXW). Internally, for Windows call-backs, Euphoria allocates data segment space and copies executable code into it. This lets me provide an "infinite" number of call-back routines, with numbers of arguments from 0 to 9. In practice, no Win32Lib-based program that I've tried uses more than about 20 unique call-back routines, most taking 4 arguments. If there were fixed limits on the number of call-back routines with a given number of arguments, I could avoid using the data segment to store code. In the new open source version of Euphoria written 100% in Euphoria, I've taken the approach of having a fixed number (20) of call-back routines, and it runs every Windows program I throw at it (including Judith's IDE). I could support "infinite" call-backs there too, but it's extra work, and people want me to hurry up (If 20 isn't enough, just edit the interpreter to make it 30, 40 ...) I have no idea how many people are going to fully enable DEP. I imagine there are other important apps that will die if it's turned on. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com
4. Re: Euphoria and Windows XP SP2
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Sep 18, 2004
- 439 views
On Sat, 18 Sep 2004 06:43:15 -0700, Tommy Carlier <guest at RapidEuphoria.com> wrote: >Like suggested in >previous posts, the manually constructed assembly-routines >cause problems. But there were also problems with c_func I suspect the call_back function (line 199) is essentially the same. Platform.htm states "each call-back address that you create requires a small block of memory." At a guess that will be allocated on the heap (so will be a data segment not a code segment) and will contain machine code, not data (so it can be called). Is there anything in DEP which permits a program to deliberately change a data segment into a code segment, or is that fixed on initial program load? Pete PS I too, have just acquired another computer - it has a whopping 16MB of ram and runs at a staggering 133MHz )
5. Re: Euphoria and Windows XP SP2
- Posted by "Elliott S. de Andrade" <quantum_analyst at hotmail.com> Sep 18, 2004
- 413 views
- Last edited Sep 19, 2004
>From: Pete Lomax <petelomax at blueyonder.co.uk> >Reply-To: EUforum at topica.com >To: EUforum at topica.com >Subject: Re: Euphoria and Windows XP SP2 >Date: Sat, 18 Sep 2004 17:53:21 +0100 > >On Sat, 18 Sep 2004 06:43:15 -0700, Tommy Carlier ><guest at RapidEuphoria.com> wrote: > > >Like suggested in > >previous posts, the manually constructed assembly-routines > >cause problems. But there were also problems with c_func >I suspect the call_back function (line 199) is essentially the same. >Platform.htm states "each call-back address that you create requires a >small block of memory." At a guess that will be allocated on the heap >(so will be a data segment not a code segment) and will contain >machine code, not data (so it can be called). > >Is there anything in DEP which permits a program to deliberately >change a data segment into a code segment, or is that fixed on initial >program load? > When you call VirtualAlloc (not malloc or HeapAlloc), you should set= =20 the PAGE_EXECUTE, PAGE_EXECUTE_READ, PAGE_EXECUTE_READWRITE, or PAGE_EXECUTE_WRITECOPY flags to indicate that the allocated page be executable. To be nice (you just know MS will make DEP on by default in the= =20 next version in "the user's best interests"), Eu should do that for call_backs (and c_func, too, though I suspect the problem with CreateWindowEx was really just Windows trying to call the WindowProc.) Also= ,=20 certain code would need some way of fixing itself (ie fptr.e). You can't= =20 just turn on execute privileges for everything returned by allocate() of= =20 course, because that would just defeat the purpose of DEP. >Pete > ~[ WingZone ]~ http://wingzone.tripod.com/ s=20 to offer.=20 http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=10= 34&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines=20 Start enjoying all the benefits of MSN=AE Premium right now and get the= =20 first two months FREE*.
6. Re: Euphoria and Windows XP SP2
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Sep 18, 2004
- 428 views
- Last edited Sep 19, 2004
On Sat, 18 Sep 2004 10:07:26 -0700, Robert Craig <guest at RapidEuphoria.com> wrote: <snip> >In the new open source version of Euphoria written 100% in Euphoria, >I've taken the approach of having a fixed number (20) of fine by me. >I could support "infinite" call-backs >there too, but it's extra work, and people want me to hurry up You've piqued my interest on how you think you might do that. I'm only asking to learn, you understand. Regards, Pete
7. Re: Euphoria and Windows XP SP2
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Sep 19, 2004
- 441 views
On Sat, 18 Sep 2004 16:40:34 -0400, Elliott Sales de Andrade <quantum_analyst at hotmail.com> wrote: <snip> >VirtualAlloc (not malloc or HeapAlloc), set PAGE_EXECUTE <snip> Yep, seeing it again, of course. (only use HeapAlloc meself). >To be nice (you just know MS will make DEP on by default in the >next version in "the user's best interests"), To be fair: Done well, this may really help stop older viruses spreading. if M$ do it OTT, everyone will quickly learn how to turn it off. If they get it "right", there will be yet more, gradual, leaning towards the M$-only solution, which is what they want... But hey, getting it "right" could be a first ) >Eu should do that for call_backs Rob already did! Call me a hopeless optimist, but I do think 2.5 could see a huge improvement in the speed of change (admittedly 500% might not be all that impressive, scnr) You cannot not hope though, and user tweaks/feedback, I think, will increase tenfold. Whether Rob or this list can deal with the load is another matter... >Also,certain code would need some way of fixing itself (ie fptr.e). Pass, I can't remember what fptr.e is. >You can't just turn on execute privileges for everything returned by >allocate(), because that would just defeat the purpose of DEP. Agreed, but as above you must have some way when really needed. Thanks, Pete
8. Re: Euphoria and Windows XP SP2
- Posted by Robert Craig <rds at RapidEuphoria.com> Sep 19, 2004
- 420 views
Pete Lomax wrote: > > On Sat, 18 Sep 2004 10:07:26 -0700, Robert Craig > <guest at RapidEuphoria.com> wrote: > > <snip> > >In the new open source version of Euphoria written 100% in Euphoria, > >I've taken the approach of having a fixed number (20) of > fine by me. > >I could support "infinite" call-backs > >there too, but it's extra work, and people want me to hurry up > You've piqued my interest on how you think you might do that. > I'm only asking to learn, you understand. I haven't worked out the details, but just as I manufacture call-back machine code at run-time in the current (C-coded) interpreter, I could manufacture intermediate language (IL) for additional Euphoria routines, at run-time, in the Euphoria-coded interpreter. When you see the source in a few weeks, you'll understand better what I'm talking about. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com
9. Re: Euphoria and Windows XP SP2
- Posted by Robert Craig <rds at RapidEuphoria.com> Sep 19, 2004
- 439 views
Robert Craig wrote: > I haven't worked out the details, but just as I manufacture > call-back machine code at run-time in the current (C-coded) > interpreter, I could manufacture intermediate language (IL) > for additional Euphoria routines, at run-time, in the > Euphoria-coded interpreter. When you see the source in a > few weeks, you'll understand better what I'm talking about. Hmmm... Now that I've looked into the details, I can see that it wouldn't work. Fortunately, my current solution, using a fixed number of call-backs in the Euphoria-coded back-end, works fine for all programs I'm aware of. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com