Unable to run compiler. Error=193

Get help with installation and running Multi-Edit here. Bug reports can be posted here but please not post feature requests here.

Moderator: Moderators

Unable to run compiler. Error=193

Postby spacetime on Sun Nov 18, 2007 11:21 am

Suddenly I can not run compilers in Multiedit. Each time I try to run it I get error "Unable to run compiler. Error=193".
This worked for years and I did not change anything.
Any idea?
spacetime
Registered User
 
Posts: 10
Joined: Tue Jun 12, 2007 12:48 pm

Postby deleyd on Sun Nov 18, 2007 6:29 pm

Does it do it with all compilers, or just one particular compiler?
User avatar
deleyd
Developer
 
Posts: 1019
Joined: Tue Jul 29, 2003 4:27 pm
Location: Santa Barbara, CA

Postby spacetime on Sun Nov 18, 2007 7:21 pm

With all compilers - all are Win32 console applications.
The only "major" thing I remember since last successful run was a Windows XP update which required reboot.
If I set Exe type to Windows it runs the compiler - of course without any output and error processing. If the Exe type is set to Win32 console or Auto I get error 193.
This used to work last week and before and I don't know what this error=193 means.
spacetime
Registered User
 
Posts: 10
Joined: Tue Jun 12, 2007 12:48 pm

Postby deleyd on Sun Nov 18, 2007 8:12 pm

It's an error returned from CreateProcess. The error is:

ERROR_BAD_EXE_FORMAT
%1 is not a valid Win32 application.


Let's debug this as follows:
  1. Find file WinExec.s
    It's usually in C:\Program Files\Multi-Edit 2006\Src\WinExec.s
  2. Make a copy called WinExecTEST.s
    We'll edit the copy and leave the original alone.
  3. Edit WinExecTEST.s
  4. Find this code (around line 187) and add these two DEBUGLOG statements after it:
    Code: Select all
        Result = CreateProcess(
                    0,                      // filename
                    Path,                   // full command line for child
                    Null,                   // process security descriptor
                    Null,                   // thread security descriptor
                    false,                  // inherit handles?
                    0,                      // creation flags
                    Null,                   // inherited environment address
                    Working_Dir,            // startup dir; NULL = start in current
                    &SI,                    // pointer to startup info (input)
                    &PI                     // pointer to process info (output)
                    );
    DEBUGLOG(2,"WinExecAndWait","Command Line="+Path);
    DEBUGLOG(2,"WinExecAndWait","Working_Dir="+Working_Dir);
  5. Compile:
    go to TOOLS -> EXECUTE COMPILER
    Select: Compile CMacWin Macro (admin debug)
    (I'm assuming you're using ME2006 10.05.
    If you're using an earlier version which doesn't have (admin) as an option
    then select whatever option has the word "Debug" in it, such as: CMacWin -M Debug Compile

Now run your compiler. A new window MSG-2.LOG will appear. Go to that window and see what it says for the command line and working dir. Hopefully the problem is apparent.

When you're done. Load the original WinExec.s and compile using the admin option without the debug:

Compile CMacWin Macro (admin)
or if an earlier version:
CMacWin -M Compile
User avatar
deleyd
Developer
 
Posts: 1019
Joined: Tue Jul 29, 2003 4:27 pm
Location: Santa Barbara, CA

Postby spacetime on Sun Nov 18, 2007 8:56 pm

The compilation of WinExecTest.s was successful, I have also checked the WinExec.mac in the MAC folder and it is a little bigger.

However, no new debug widow appeared.
I have tested with many compilers and there is no change - still error 193.
But it seems that this code (macro WinExec) is not executed since I have placed some additional code at the beginning and it is also not executed when I run the compiler.
I am using ME 9.10.03.
spacetime
Registered User
 
Posts: 10
Joined: Tue Jun 12, 2007 12:48 pm

Postby deleyd on Mon Nov 19, 2007 5:15 pm

Maybe it won't use the new code until you do the "Rebuild Macro Library" thing.

1. Exit Multi-Edit
2. START -> PROGRAMS -> MULTI-EDIT -> REBUILD MACRO LIBRARY.

(If you don't have a Rebuild Macro Library under the start menu, then execute this command at a DOS prompt:
"C:\Program Files\Multi-Edit 2006\CmacWin.exe" -L Utils\MewMcl32.lst -PMac -ISrc )
User avatar
deleyd
Developer
 
Posts: 1019
Joined: Tue Jul 29, 2003 4:27 pm
Location: Santa Barbara, CA

Postby spacetime on Mon Nov 19, 2007 6:44 pm

Well, thanks a lof for help. Now I know what is going wrong.

This is a copy from the log:
WinExecAndWait: Command Line=C:\Program Files\File Utilities\Multi-Edit\UTILS\W32EXEC.EXE C:\PROGRA~1\FILEUT~1\MULTI-~1\Config\W32EXEC.INI C:\PROGRA~1\FILEUT~1\MULTI-~1\Config\W32EXEC.OUT C:\PROGRA~1\FILEUT~1\MULTI-~1\Config\W32EXEC.GO
WinExecAndWait: Working_Dir=D:\Projects\_INITRA\EOTI7

The problem is the path to the W32EXEC.EXE which contains spaces: C:\Program Files\File Utilities\Multi-Edit\UTILS\W32EXEC.EXE
It should be something like this: C:\PROGRA~1\FILEUT~1\MULTI-~1\UTILS\W32EXEC.EXE

Where can I correct this?

Thanks again.
spacetime
Registered User
 
Posts: 10
Joined: Tue Jun 12, 2007 12:48 pm

Postby deleyd on Mon Nov 19, 2007 10:29 pm

Looks like double quotation marks are missing. Click 'Edit' and check for double quotes around the command. (See images below. I marked them in red.)
Attachments
compiler1.gif
compiler1.gif (13.79 KiB) Viewed 10735 times
compiler2.gif
compiler2.gif (18.01 KiB) Viewed 10735 times
User avatar
deleyd
Developer
 
Posts: 1019
Joined: Tue Jul 29, 2003 4:27 pm
Location: Santa Barbara, CA

Postby spacetime on Tue Nov 20, 2007 8:26 pm

No, the problem is not the compiler path. The problem is how the WINEXEC32.EXE is called. I have searched and found the following code in WinExec.s:

Code: Select all
      if ( Win32 || ( DosExecMethod == _DosExec_Direct ) ) {
      Result = WinExecAndWait( _UtilsDir + ExeName + ".EXE " + Ini_File + " " +
               Out_File + StartFile, Working_Dir, Flags, Path, Semiphore_File );
      }



I have changed it into:

Code: Select all
      if ( Win32 || ( DosExecMethod == _DosExec_Direct ) ) {
      Result = WinExecAndWait( """" + _UtilsDir + ExeName + ".EXE"" " + Ini_File + " " +
               Out_File + StartFile, Working_Dir, Flags, Path, Semiphore_File );
      }


and it works!!

Problem solved, thank you.

However one question remains:
Why this happened?
ME worked for years and now bang, it does not work?!
As I said, the only thing I remember from the last successful run before the problem was a windows update.
I don't know.

Thanks again.
spacetime
Registered User
 
Posts: 10
Joined: Tue Jun 12, 2007 12:48 pm

Postby Michal Vodicka on Tue Nov 20, 2007 9:02 pm

spacetime wrote:As I said, the only thing I remember from the last successful run before the problem was a windows update.

Interesting. Can you identify what exactly was updated? Installed updates can be shown using some Control Panel applet I guess.

Anyway, it Windows update is a culprit, I'd expect more people reporting the problem soon. It is good to be conservative and not use Program Files nonsense ;-)
Michal Vodicka
Developer
 
Posts: 425
Joined: Fri Jul 25, 2003 8:16 pm
Location: Prague, Czech Republic

Postby spacetime on Tue Nov 20, 2007 10:00 pm

This update (KB943460) was installed on November 15th:

http://support.microsoft.com/?kbid=943460

It looks as a "candidate" for the mentioned problem in ME.
spacetime
Registered User
 
Posts: 10
Joined: Tue Jun 12, 2007 12:48 pm

Postby deleyd on Tue Nov 20, 2007 10:11 pm

Thank you for pointing that out. Sure looks like we should add double-quotes there where you did.

Maybe something changed which changed how the compiler is executed. There are like 6 different ways to execute a program in Multi-Edit. I see this is using DosExec, the DOS option, though I think most nowadays use the "Windows" option.

The code for this appears to be basically the same since ME version 8.0. 8.0 has that same call to WinExecAndWait in the DosExec macro. I'll submit this as a code change. Thank you for pointing it out.
Attachments
exetypes.gif
exetypes.gif (14.81 KiB) Viewed 10690 times
User avatar
deleyd
Developer
 
Posts: 1019
Joined: Tue Jul 29, 2003 4:27 pm
Location: Santa Barbara, CA

Postby deleyd on Wed Nov 21, 2007 6:20 am

Wow, thank you spacetime for finding that update. Looks like Microsoft is doing it to us again.
User avatar
deleyd
Developer
 
Posts: 1019
Joined: Tue Jul 29, 2003 4:27 pm
Location: Santa Barbara, CA

Postby Michal Vodicka on Wed Nov 21, 2007 6:38 pm

spacetime wrote:This update (KB943460) was installed on November 15th:

http://support.microsoft.com/?kbid=943460

It looks as a "candidate" for the mentioned problem in ME.


I'm unsure if the update can cause it. It is somewhat related but it doesn't seem MEW uses ShellExexute() function which should be only affected. However, they could make change which influences more calls.

It'd be nice if you can verify the update really causes it. There are two possibilities. Disable fix for MEW (mew32.exe) as described in the article or uninstall the fix temporarily.

However, David is right, it is strange you're using DosExec. Isn't it possible you mistakenly changed executable type?
Michal Vodicka
Developer
 
Posts: 425
Joined: Fri Jul 25, 2003 8:16 pm
Location: Prague, Czech Republic

Postby spacetime on Wed Nov 21, 2007 9:18 pm

You were right. Disabling this update does not fix the problem.
But I am not using DosExec. I am running Win32 console compilers and exe type is set to Auto (or Win32 console).

The problem was that W32exec.exe was called with spaces in path and without double quotes. Adding double quotes (as explained above) in WinExec.s fixed the problem.
spacetime
Registered User
 
Posts: 10
Joined: Tue Jun 12, 2007 12:48 pm

Next

Return to Support

Who is online

Users browsing this forum: wild, Yahoo [Bot] and 0 guests