1. EXWC not quitting when prog quits

I have a weird one here. I'm running on Windows XP, and I am running a Euphoria program as a CGI app from a web page. The program runs OK and returns good html, and terminates. But the exwc.exe interpreter still continues - so the server sits and waits for it to end and times out. The Eu program copies what it sends to stdout to a file, and logs the fact that it is about to end, all quite OK. And the program does end. But task manager (set to high speed updating) shows exwc.exe as still executing. Durr! I can't get my head around how this can happen, or how to ensure exwc dies off once the *.exw program has terminated. If anyone has any ideas I will be glad to know them, even if I do a Homer and hit myself and go Doh!

new topic     » topic index » view message » categorize

2. Re: EXWC not quitting when prog quits

Are you testing your code on the command line manually with exwc? Perhaps it's leaving a "Press Enter..." prompt, waiting for something to happen.

Here's a couple things every Euphoria CGI program should have:

without warning

This will prevent the interpreter from reporting unused variables.

flush(1)
    abort(0) 

The Interpreter will hit this, forcibly flush its console output and exit immediately.

-Greg

new topic     » goto parent     » topic index » view message » categorize

3. Re: EXWC not quitting when prog quits

When Ctrl+C is pressed it doesn't exit either, just displays "Press Enter..." and keeps running.
Pressing enter terminates the program, but if the program does wait_key(), that gets the enter instead, and theres no way to exit without resorting to Task Manager.

new topic     » goto parent     » topic index » view message » categorize

4. Re: EXWC not quitting when prog quits

I thought the same thing. At the very very end of the prog it writes "End" to a little debug file just to show that it got there. Does that. I even used time() to timestamp these messages, and the program runs to completion in 0.2secs. There is nothing after that last line (by definition, I suppose). I added abort(0) and still the same. So no, I don't think it is waiting for a Press any key.." prompt. Any other thoughts?

new topic     » goto parent     » topic index » view message » categorize

5. Re: EXWC not quitting when prog quits

AndyDrummond said...

I thought the same thing. At the very very end of the prog it writes "End" to a little debug file just to show that it got there. Does that. I even used time() to timestamp these messages, and the program runs to completion in 0.2secs. There is nothing after that last line (by definition, I suppose). I added abort(0) and still the same. So no, I don't think it is waiting for a Press any key.." prompt. Any other thoughts?

Did you try adding "without warning"?
Also try running it directly, without CGI so you can see if anything odd happens.

new topic     » goto parent     » topic index » view message » categorize

6. Re: EXWC not quitting when prog quits

Arghh! Or was it Doh without warning, I was warned to include that. I forgot. Now exwc quits as expected and I merely have to go and undo all the damage I have done in the last few hours because of a warning. I wonder if warnings could be dumped into a file?

Thanks a lot - what would I do without you guys pointing out the obvious??

new topic     » goto parent     » topic index » view message » categorize

7. Re: EXWC not quitting when prog quits

AndyDrummond said...

I wonder if warnings could be dumped into a file?

Version 4 has a new warning_file() statement that causes warnings to be directed to a file.

new topic     » goto parent     » topic index » view message » categorize

8. Re: EXWC not quitting when prog quits

Version 4 also has a -BATCH command line option that is designed for programs running in an automated environment. It causes any "Press Enter" type prompt due to error, to be suppressed.

new topic     » goto parent     » topic index » view message » categorize

9. Re: EXWC not quitting when prog quits

And I forgot, it also has as -WF command line option that specifies the file that will capture warning messages, instead of having them go to the console.

exwc -WF captured.txt -BATCH myapp.exw 
In addition, you now have finer control about which warnings to report on.

new topic     » goto parent     » topic index » view message » categorize

10. Re: EXWC not quitting when prog quits

DerekParnell said...

Version 4 also has a -BATCH command line option that is designed for programs running in an automated environment. It causes any "Press Enter" type prompt due to error, to be suppressed.

On the latest build for Windows (973), -BATCH only suppresses "press enter" for syntax errors, not runtime errors.
Has this been fixed yet, and if not, will it be fixed?

new topic     » goto parent     » topic index » view message » categorize

11. Re: EXWC not quitting when prog quits

CoJaBo said...

On the latest build for Windows (973), -BATCH only suppresses "press enter" for syntax errors, not runtime errors.
Has this been fixed yet, and if not, will it be fixed?

I thought it was ok. Can you write the smallest program that exhibits the behaviour that you want corrected? Also, exactly what are you expecting instead of what it is currently doing?

new topic     » goto parent     » topic index » view message » categorize

12. Re: EXWC not quitting when prog quits

DerekParnell said...

I thought it was ok. Can you write the smallest program ...

Nevermind. I found the problem. I'll see what can be done.

new topic     » goto parent     » topic index » view message » categorize

13. Re: EXWC not quitting when prog quits

AndyDrummond said...

Arghh! Or was it Doh without warning, I was warned to include that. I forgot. Now exwc quits as expected and I merely have to go and undo all the damage I have done in the last few hours because of a warning. I wonder if warnings could be dumped into a file?

Thanks a lot - what would I do without you guys pointing out the obvious??

Eu4.0 has a warning_file(file_name) for exactly this purpose. There is also a nuke'em all warning_file(-1) to suppress any kind of warning generation or output.

CChris

new topic     » goto parent     » topic index » view message » categorize

14. Re: EXWC not quitting when prog quits

These wonderful advances in Eu 4 sound very exciting. I suspect I will hold off using it until it reaches a pukka issue (I suppose the successor to a beta release is the gamma release?). Then I can play with them - if I get time. CChris, you seem to have put in a lot, so thank you!

new topic     » goto parent     » topic index » view message » categorize

15. Re: EXWC not quitting when prog quits

CoJaBo said...

On the latest build for Windows (973), -BATCH only suppresses "press enter" for syntax errors, not runtime errors.
Has this been fixed yet, and if not, will it be fixed?

In the latest SVN, -BATCH now suppresses "press enter" prompts for parse and runtime errors/warnings.

Jeremy

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu