www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edward Boas <b...@stanford.edu>
Subject general/5306: C++ CGI hangs on system call (but worked correctly under OmniHTTPd 1.01)
Date Sun, 14 Nov 1999 12:07:10 GMT

>Number:         5306
>Category:       general
>Synopsis:       C++ CGI hangs on system call (but worked correctly under OmniHTTPd 1.01)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Sun Nov 14 04:10:00 PST 1999
>Originator:     boas@stanford.edu
>Release:        1.3.6
Windows 98, SR-1
I'm have problems running one particular CGI script that ran fine on the 
OmniHTTPd 1.01 web server (http://www.omnicron.ab.ca/).

The script is a 32-bit command line exe compiled by Microsoft Visual C++ 
version 6.0, and the problem occurs only when the script calls the "system" 
function (to run "dir /b > tmpfile", for instance).  The problems are:

1.  System call pops up a separate "COMMAND.COM" window, and also grinds
the floppy drive (which wastes a whole lot of time), which the script
didn't do when run by OmniHTTPd.

2.  After about four separate system calls in a single run of the script
(which run successfully and generate the expected HTML code), the script
hangs at an additional system call (another directory listing, just run
on a separate directory), leaving the web browser hanging with the HTML
generated up to that point.  The web server does not log any errors.

The following sample demonstrates some of these errors.  With the system call, 
the script hangs without returning any output.  Comment out that line, and
it works as expected.

#include <stdio.h>
#include <process.h>

int main(void) {
  printf("Content-type: text/html\n\n");
  printf("<html><body><h1>Testing ...</h1></body></html>\n");
  system("dir /b > tmpfile.tmp");
  return 0;

[In order for any reply to be added to the PR database, you need]
[to include <apbugs@Apache.Org> in the Cc line and make sure the]
[subject line starts with the report component and number, with ]
[or without any 'Re:' prefixes (such as "general/1098:" or      ]
["Re: general/1098:").  If the subject doesn't match this       ]
[pattern, your message will be misfiled and ignored.  The       ]
["apbugs" address is not added to the Cc line of messages from  ]
[the database automatically because of the potential for mail   ]
[loops.  If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request from a  ]
[developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]

View raw message