http://www.perlmonks.org?node_id=755615

rpnoble419 has asked for the wisdom of the Perl Monks concerning the following question:

I have an application that i run as a local web service using Microweb. It has worked for years. All of the perl code is complied into standalone exes using perlapp from activestate. In running it on a new computer running Windows XP SP2 I noticed I was getting two copies of the application starting when the CGI form was called. The issue is that the smaller version of the application 76KB fails to exit, but the larger version of the application exits just fine. Over time it causes the system to become unstable. Any ideas on what the stub application might be? or how I can check it while its running in memory. While expermenting, I tried the same application running on the same computer, but using Apache 2.0.58 and the stubs exit just fine.....
  • Comment on two copies of my application launched under CGI

Replies are listed 'Best First'.
Re: two copies of my application launched under CGI
by bilfurd (Hermit) on Apr 06, 2009 at 02:08 UTC
    Howdy, rpnoble419 -

    I had the same problem with an XP server a few years ago. I feel your pain!

    Try running through the server MAPI settings and make sure that your scripts are mapped to the right version of Perl, no duplicates exist, etc. It might be helpful to go through the old server settings and make sure everything maps exactly.

    I suspect there may be a different version of Perl on each box, not to mention server patches, etc.

    I know you put "use strict;" in your code, so can you post the scripts in question? Someone may spot something that gave them trouble in the past.

    Good luck!

    -Bilfurd

      I fall on my sword for this. It turns out to be a double call to the application from the HTML code. The HTML file has a textarea that gets data from a scanner via the keyboard buffer. This input is checked via a javascript function called by the onkeyup event. This function is being called twice and the zombie is the result of the second call overriding the first.

      Thanks to Bilfurd for your reply. And I'm strict on use Strict.

        And I'm strict on use Strict.

        Strictly speaking, it's use strict :) — module names are generally case-sensitive (even on Windows).

        > perl -e "use strict; $foo=1" Global symbol "$foo" requires explicit package name at -e line 1. Execution of -e aborted due to compilation errors. > > perl -e "use Strict; $foo=1" >

        Reason is that - if you use Strict - the use will implicitly attempt to call Strict->import, which isn't found, as the respective namespace is declared with package strict; in the module's source (this must 'fail' silently, as a module is not obliged to supply an import method).  Thus, any code in an existing import() isn't executed, which in turn renders some modules (and in particular pragmata) non-functional, or makes them behave differently...

        Update: just in case...  for whoever downvoted without saying what's wrong (: this of course only applies to Windows, where the respective file is found at all, due to the filesystem being case-insensitive.  Geez...