View Issue Details

IDProjectCategoryView StatusLast Update
0000459Apache 2.x Bugpublic2013-04-18 17:49
ReporterDB1 Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformIntel dual P IIIOSECSOS Version2.0
Product Versionv2.2.1 
Summary0000459: 2.2.17 perl cgi scripts fail if any switches are present on the shebang line
Description#!d:/usr/bin/perl.exe

works

#!d:/usr/bin/perl.exe -w

fails:

[Sat Jan 29 18:32:40 2011] [error] [client 127.0.0.1] (123)APR does not
understand this error code: couldn't spawn child process:
H:/home/DB/web2/admin/cgi-bin/test.pl, referer:
http://localhost:40/cgi-bin/test.pl

Steps To ReproduceAdd a switch to the shebang line and try and execute from browser.
Additional InformationSuspect there is a problem parsing the shebang line. Tripped over this trying to get taint mode to work with mod_cgi. Google suggests that, whilst specifying -T on the shebang line fails if executed from the command line, doing so and executing via apache works. There are specific hacks in the code for Win, which does not have a shebang line, to do with registry searching to find perl.
TagsNo tags attached.

Activities

psmedley

2011-02-02 19:01

administrator   ~0001814

is this the only error in the log? it's not particularly useful...

psmedley

2011-02-02 19:34

administrator   ~0001815

please try with http://smedley.info/cgi.zip which should produce some more logging

DB1

2011-02-02 21:09

reporter   ~0001816

Yes, only line in log.

[D:\Apps\apache2\modules]unzip t:/tmp/cgi.zip
Archive: t:/tmp/cgi.zip
replace cgi.dll? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: cgi.dll

[D:\Apps\apache2]apache2.cmd
bin\\httpd.exe: Syntax error on line 72 of ./conf/httpd.conf: Cannot load D:/Apps/apache2/modules/cgi.dll into server: SYS0002: The system cannot find the file specified. (GCC445)

Oh dear :-)

psmedley

2011-02-02 21:35

administrator   ~0001817

You need the latest gcc445.dll from http://smedley.info/gcc445.dll

DB1

2011-02-02 21:46

reporter   ~0001818

404 :-(

psmedley

2011-02-03 06:18

administrator   ~0001819

of course I meant http://smedley.info/gcc445.zip - that's what happens when I type on the blackberry :(

DB1

2011-02-12 21:36

reporter   ~0001834

Last edited: 2011-02-12 21:38

Sorry for delay in testing this. Just tried. Does make a difference. :-(

No change in the error logging.
Page not served. Browser says "waiting for <host>" forever.
Nothing in access.log.
Apache hangs and is unkillable.

Edit: Just noticed this in error.log after various attempts to kill:

[Sat Feb 12 11:01:55 2011] [notice] caught SIGTERM, shutting down
[Sat Feb 12 11:01:55 2011] [error] (OS 10038)Socket operation on non-socket: apr_socket_accept

LIBC fatal error - streams: fmutex_request failed

Killed by SIGABRT
pid=0x00fa ppid=0x0021 tid=0x0001 slot=0x00bd pri=0x0200 mc=0x0001
D:\APPS\APACHE2\BIN\HTTPD.EXE
Process dumping was disabled, use DUMPPROC / PROCDUMP to enable it.

psmedley

2013-04-18 10:24

administrator   ~0002433

still an issue with latest builds?

DB1

2013-04-18 17:49

reporter   ~0002436

Yup

In browser window:

Error message:
couldn't create child process: 123: cars.pl

In error.log

[Thu Apr 18 09:14:11 2013] [error] [client 127.0.0.1] (123)APR does not understand this error code: couldn't create child process: 123: cars.pl
[Thu Apr 18 09:14:11 2013] [error] [client 127.0.0.1] (123)APR does not understand this error code: couldn't spawn child process: H:/home/DB/web2/admin/cgi-bin/
cars.pl

Note this was one attempt to load the script but it logs two messages.

First line of cars.pl is

#!d:/usr/bin/perl.exe -w

Issue History

Date Modified Username Field Change
2011-02-01 04:10 DB1 New Issue
2011-02-02 19:01 psmedley Note Added: 0001814
2011-02-02 19:34 psmedley Note Added: 0001815
2011-02-02 21:09 DB1 Note Added: 0001816
2011-02-02 21:35 psmedley Note Added: 0001817
2011-02-02 21:46 DB1 Note Added: 0001818
2011-02-03 06:18 psmedley Note Added: 0001819
2011-02-12 21:36 DB1 Note Added: 0001834
2011-02-12 21:36 DB1 Note Edited: 0001834
2011-02-12 21:38 DB1 Note Edited: 0001834
2013-04-18 10:24 psmedley Note Added: 0002433
2013-04-18 17:49 DB1 Note Added: 0002436