Forums

The specified executable is not a valid Win32 application

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

The specified executable is not a valid Win32 application

Postby shadow » Mon Feb 25, 2008 6:08 pm

Windows Vista Home Premium
Dell Dual-Core Pentium
This program can be complied by Cobra, can be executed by Windows, but not fails when Cobra executes it:

class Hello

def main is shared
print 'hello, world.'

D:\CobraProjects\HelloWorld>cobra -compile HelloWorld.txt
Compilation succeeded
Compilation succeeded
Compilation succeeded

D:\CobraProjects\HelloWorld>HelloWorld.txt.exe
hello, world.

D:\CobraProjects\HelloWorld>cobra HelloWorld.txt
An unhandled exception has occurred.

Cobra debugging tips:
To get file name and line number information for the stack frames, use:
cobra -debug foo.cobra
To get a post-mortem, HTML-formatted report with more details about your obj
ects:
cobra -debug -exception-report foo.cobra
For even more information, try:
cobra -debug -exception-report -detailed-stack-trace foo.cobra
Or use the abbreviations:
cobra -d -er -dst foo.cobra


Unhandled Exception: System.ComponentModel.Win32Exception: The specified executa
ble is not a valid Win32 application.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startIn
fo)
at System.Diagnostics.Process.Start()
at CommandLine.DoRun(List`1 paths)
at CommandLine.Run(List`1 args)
at CommandLine.Run()
at CobraMain.Main()
An unhandled exception has occurred.

Cobra debugging tips:
To get file name and line number information for the stack frames, use:
cobra -debug foo.cobra
To get a post-mortem, HTML-formatted report with more details about your obj
ects:
cobra -debug -exception-report foo.cobra
For even more information, try:
cobra -debug -exception-report -detailed-stack-trace foo.cobra
Or use the abbreviations:
cobra -d -er -dst foo.cobra
shadow
 
Posts: 3

Re: The specified executable is not a valid Win32 application

Postby Charles » Mon Feb 25, 2008 6:41 pm

That's neat. What's your output with verbosity turned on?:

cobra -v:2 -d HelloWord.txt

Also, try renaming your program to HelloWorld.cobra because, honestly, I've never once run a Cobra program with an extension other than ".cobra". I therefore suspect that is the problem.

-Chuck
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: The specified executable is not a valid Win32 application

Postby shadow » Mon Feb 25, 2008 9:25 pm

Of course, you were right about the extension..works as .cobra. Follow up:

===================================================================================
1. With the .cobra extension, it prints the output 3 times. (Actually, with the .txt extension, it fails 3 times, too)

D:\CobraProjects\HelloWorld>cobra HelloWorld.cobra
hello, world.
hello, world.
hello, world.

===================================================================================
2. Here is debug output using .cobra (to explain the triple output?):

D:\CobraProjects\HelloWorld>cobra -v:2 -d HelloWorld.cobra
Cobra Command Line 0.7.3
current directory: D:\CobraProjects\HelloWorld
current exe: C:\Cobra\Cobra-0.7.3\bin\cobra.exe
option dictionary:
verbosity: 2
debug: '+'
contracts: 'inline'
debugging-tips: true
embed-run-time: true
include-tests: true
paths:
HelloWorld.cobra
Reading assembly: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b7
7a5c561934e089 at C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll
Reading assembly: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a
5c561934e089 at C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\Sy
stem.dll
Noting C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs
Parsing C:\Cobra\Cobra-0.7.3\bin\SystemInterfaces.cobra
Parsing C:\Cobra\Cobra-0.7.3\bin\CobraLang.cobra
Noting C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs
Parsing HelloWorld.cobra
Binding use directives
Binding inheritance
Binding interface
Binding implementation
Compiling generated code
Compiling to produce HelloWorld.exe
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc /debug+ "/out:HelloWorld.exe"
/nologo "C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs" "C:\Cobra\Cobra-0.7.3\bin\Cobr
aLang.cobra.cs" "C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs" "HelloWorld.cobra.cs"
Deleting intermediate files.
Running: HelloWorld
-------------------------------------------------------------------------------
hello, world.
Cobra Command Line 0.7.3
current directory: D:\CobraProjects\HelloWorld
current exe: C:\Cobra\Cobra-0.7.3\bin\cobra.exe
option dictionary:
color: true
verbosity: 2
debug: '+'
contracts: 'inline'
debugging-tips: true
embed-run-time: true
include-tests: true
paths:
HelloWorld.cobra
Reading assembly: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b7
7a5c561934e089 at C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll
Reading assembly: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a
5c561934e089 at C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\Sy
stem.dll
Noting C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs
Parsing C:\Cobra\Cobra-0.7.3\bin\SystemInterfaces.cobra
Parsing C:\Cobra\Cobra-0.7.3\bin\CobraLang.cobra
Noting C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs
Parsing HelloWorld.cobra
Binding use directives
Binding inheritance
Binding interface
Binding implementation
Compiling generated code
Compiling to produce HelloWorld.exe
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc /debug+ "/out:HelloWorld.exe"
/nologo "C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs" "C:\Cobra\Cobra-0.7.3\bin\Cobr
aLang.cobra.cs" "C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs" "HelloWorld.cobra.cs"
Deleting intermediate files.
Running: HelloWorld
-------------------------------------------------------------------------------
hello, world.
Cobra Command Line 0.7.3
current directory: D:\CobraProjects\HelloWorld
current exe: C:\Cobra\Cobra-0.7.3\bin\cobra.exe
option dictionary:
color: true
editor: 'uedit32_FILE/LINE'
verbosity: 2
debug: '+'
contracts: 'inline'
debugging-tips: true
embed-run-time: true
include-tests: true
paths:
HelloWorld.cobra
Reading assembly: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b7
7a5c561934e089 at C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll
Reading assembly: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a
5c561934e089 at C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\Sy
stem.dll
Noting C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs
Parsing C:\Cobra\Cobra-0.7.3\bin\SystemInterfaces.cobra
Parsing C:\Cobra\Cobra-0.7.3\bin\CobraLang.cobra
Noting C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs
Parsing HelloWorld.cobra
Binding use directives
Binding inheritance
Binding interface
Binding implementation
Compiling generated code
Compiling to produce HelloWorld.exe
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc /debug+ "/out:HelloWorld.exe"
/nologo "C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs" "C:\Cobra\Cobra-0.7.3\bin\Cobr
aLang.cobra.cs" "C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs" "HelloWorld.cobra.cs"
Deleting intermediate files.
Running: HelloWorld
-------------------------------------------------------------------------------
hello, world.

D:\CobraProjects\HelloWorld>

===================================================================================
3. Here's the debug output for the .txt error (just because you asked :)

D:\CobraProjects\HelloWorld>cobra -v:2 -d HelloWorld.txt
cobra: error: Cannot find "HelloWor;d.txt" as a file.
Run Cobra without options to get full usage information.
cobra: error: Cannot find "HelloWor;d.txt" as a file.
Run Cobra without options to get full usage information.
cobra: error: Cannot find "HelloWor;d.txt" as a file.
Run Cobra without options to get full usage information.

D:\CobraProjects\HelloWorld>cobra -v:2 -d HelloWorld.txt
Cobra Command Line 0.7.3
current directory: D:\CobraProjects\HelloWorld
current exe: C:\Cobra\Cobra-0.7.3\bin\cobra.exe
option dictionary:
verbosity: 2
debug: '+'
contracts: 'inline'
debugging-tips: true
embed-run-time: true
include-tests: true
paths:
HelloWorld.txt
Reading assembly: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b7
7a5c561934e089 at C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll
Reading assembly: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a
5c561934e089 at C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\Sy
stem.dll
Noting C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs
Parsing C:\Cobra\Cobra-0.7.3\bin\SystemInterfaces.cobra
Parsing C:\Cobra\Cobra-0.7.3\bin\CobraLang.cobra
Noting C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs
Parsing HelloWorld.txt
Binding use directives
Binding inheritance
Binding interface
Binding implementation
Compiling generated code
Compiling to produce HelloWorld.txt.exe
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc /debug+ "/out:HelloWorld.txt.
exe" /nologo "C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs" "C:\Cobra\Cobra-0.7.3\bin\
CobraLang.cobra.cs" "C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs" "HelloWorld.txt.cs"
Deleting intermediate files.
Running: HelloWorld.txt
-------------------------------------------------------------------------------
An unhandled exception has occurred.

Cobra debugging tips:
To get file name and line number information for the stack frames, use:
cobra -debug foo.cobra
To get a post-mortem, HTML-formatted report with more details about your obj
ects:
cobra -debug -exception-report foo.cobra
For even more information, try:
cobra -debug -exception-report -detailed-stack-trace foo.cobra
Or use the abbreviations:
cobra -d -er -dst foo.cobra


Unhandled Exception: System.ComponentModel.Win32Exception: The specified executa
ble is not a valid Win32 application.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startIn
fo)
at System.Diagnostics.Process.Start()
at CommandLine.DoRun(List`1 paths)
at CommandLine.Run(List`1 args)
at CommandLine.Run()
at CobraMain.Main()
Cobra Command Line 0.7.3
current directory: D:\CobraProjects\HelloWorld
current exe: C:\Cobra\Cobra-0.7.3\bin\cobra.exe
option dictionary:
color: true
verbosity: 2
debug: '+'
contracts: 'inline'
debugging-tips: true
embed-run-time: true
include-tests: true
paths:
HelloWorld.txt
Reading assembly: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b7
7a5c561934e089 at C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll
Reading assembly: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a
5c561934e089 at C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\Sy
stem.dll
Noting C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs
Parsing C:\Cobra\Cobra-0.7.3\bin\SystemInterfaces.cobra
Parsing C:\Cobra\Cobra-0.7.3\bin\CobraLang.cobra
Noting C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs
Parsing HelloWorld.txt
Binding use directives
Binding inheritance
Binding interface
Binding implementation
Compiling generated code
Compiling to produce HelloWorld.txt.exe
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc /debug+ "/out:HelloWorld.txt.
exe" /nologo "C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs" "C:\Cobra\Cobra-0.7.3\bin\
CobraLang.cobra.cs" "C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs" "HelloWorld.txt.cs"
Deleting intermediate files.
Running: HelloWorld.txt
-------------------------------------------------------------------------------
An unhandled exception has occurred.

Cobra debugging tips:
To get file name and line number information for the stack frames, use:
cobra -debug foo.cobra
To get a post-mortem, HTML-formatted report with more details about your obj
ects:
cobra -debug -exception-report foo.cobra
For even more information, try:
cobra -debug -exception-report -detailed-stack-trace foo.cobra
Or use the abbreviations:
cobra -d -er -dst foo.cobra


Unhandled Exception: System.ComponentModel.Win32Exception: The specified executa
ble is not a valid Win32 application.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startIn
fo)
at System.Diagnostics.Process.Start()
at CommandLine.DoRun(List`1 paths)
at CommandLine.Run(List`1 args)
at CommandLine.Run()
at CobraMain.Main()
Cobra Command Line 0.7.3
current directory: D:\CobraProjects\HelloWorld
current exe: C:\Cobra\Cobra-0.7.3\bin\cobra.exe
option dictionary:
color: true
editor: 'uedit32_FILE/LINE'
verbosity: 2
debug: '+'
contracts: 'inline'
debugging-tips: true
embed-run-time: true
include-tests: true
paths:
HelloWorld.txt
Reading assembly: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b7
7a5c561934e089 at C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll
Reading assembly: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a
5c561934e089 at C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\Sy
stem.dll
Noting C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs
Parsing C:\Cobra\Cobra-0.7.3\bin\SystemInterfaces.cobra
Parsing C:\Cobra\Cobra-0.7.3\bin\CobraLang.cobra
Noting C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs
Parsing HelloWorld.txt
Binding use directives
Binding inheritance
Binding interface
Binding implementation
Compiling generated code
Compiling to produce HelloWorld.txt.exe
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc /debug+ "/out:HelloWorld.txt.
exe" /nologo "C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs" "C:\Cobra\Cobra-0.7.3\bin\
CobraLang.cobra.cs" "C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs" "HelloWorld.txt.cs"
Deleting intermediate files.
Running: HelloWorld.txt
-------------------------------------------------------------------------------
An unhandled exception has occurred.

Cobra debugging tips:
To get file name and line number information for the stack frames, use:
cobra -debug foo.cobra
To get a post-mortem, HTML-formatted report with more details about your obj
ects:
cobra -debug -exception-report foo.cobra
For even more information, try:
cobra -debug -exception-report -detailed-stack-trace foo.cobra
Or use the abbreviations:
cobra -d -er -dst foo.cobra


Unhandled Exception: System.ComponentModel.Win32Exception: The specified executa
ble is not a valid Win32 application.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startIn
fo)
at System.Diagnostics.Process.Start()
at CommandLine.DoRun(List`1 paths)
at CommandLine.Run(List`1 args)
at CommandLine.Run()
at CobraMain.Main()
shadow
 
Posts: 3

Re: The specified executable is not a valid Win32 application

Postby Charles » Mon Feb 25, 2008 10:30 pm

The triple output is amazing; I haven't seen anything like it. Are you using a cobra.bat that you made? Could it have extra lines in it, maybe from a copy and paste with too many pastes?

Does anyone else experience Cobra running in triplicate?
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: The specified executable is not a valid Win32 application

Postby Charles » Mon Feb 25, 2008 10:31 pm

Btw for really long output like that, I think an attachment(s) would work best. These are available under the text box that you compose your messages in.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: The specified executable is not a valid Win32 application

Postby shadow » Mon Mar 03, 2008 8:25 am

Wow, how I ever managed that I don't know...ya, triple entries in the.bat. Hope you didn't chase that one more than a minute. Sorry 'bout the huge paste...I'll take the time to review this board's capabilities before posting again.

Best regards,
Shadow
shadow
 
Posts: 3


Return to Discussion

Who is online

Users browsing this forum: No registered users and 42 guests