Opened 21 years ago

Closed 21 years ago

Last modified 14 years ago

#458 closed defect (fixed)

MapServer hangs with Apache 2.x — at Version 6

Reported by: dmorissette Owned by: dmorissette
Priority: high Milestone:
Component: MapServer CGI Version: 4.1
Severity: normal Keywords:
Cc: mko

Description (last modified by dmorissette)

This problem was found while working on bug 418, but since this could affect
many users I think it deserves its own bug so that the issue is properly documented.

Apache 2.x has a problem with CGIs that hang when they generate more than 4096
bytes of output to stderr: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22030

When --enable-debug is enabled MapServer can generate quite a bit of output to
stderr which causes it to hang when running under Apache 2.x.  The current
version is Apache 2.0.47 and the stderr bug is still not fixed so we need to
work around the problem.

Note that this problem does not affect Apache 1.3.x users, it happens only with
Apache 2.x.  This will affect all versions of MapServer but we will implement
the workaround only in 4.0.1 (current stable release) and 4.1 (CVS dev).

Change History (6)

comment:1 by dmorissette, 21 years ago

Status: newassigned
I made the following changes for this in version 4.0.1 and will apply the same
changes to 4.1 in a few minutes:

- configure attempts to detect the version of Apache that you are running by
looking for httpd in some default locations.  You can force it to find a
specific copy of httpd using --with-httpd=/path/to/httpd

- If you happen to be running a version of Apache >= 2.0 then stderr will be set
to be non-blocking in msDebug().  This is controlled by the
NEED_NONBLOCKING_STDERR compilation flag.  

When stderr is set to non-bloking then MapServer doesn't hang any more after
4096 bytes of output to stderr but you may lose some stderr output (still better
than nothing).

Assefa: can you please checkout the latest 'branch-4-0' source and confirm that
it builds properly on Windows when you add -DNEED_NONBLOCKING_STDERRR to the
compile flags.

comment:2 by dmorissette, 21 years ago

Resolution: fixed
Status: assignedclosed
Marking fixed, changes committed to both the 4.0 and 4.1 branches and everything
seems to work fine for me.

comment:3 by assefa, 21 years ago

Daniel,

 4.1 maperror.c builds properly on windows after doing a small modification
(#include <unistd.h> not used on windows). I have commited this change.
 Would you mind updating the eralier branched with the same fix and retag I guess ?

comment:4 by dmorissette, 21 years ago

Thanks Assefa, I've applied your fix to the 4.0 branch and re-tagged the 4.0.1
release.  

Steve: I think you can go ahead with the 4.0.1 release now.

comment:5 by mko, 15 years ago

Cc: mko added

Wonder why the configure script still says

configure: checking HTTPD server (Apache) version...
        using user-supplied httpd (/usr/local/apache2/bin/httpd)
        /usr/local/apache2/bin/httpd version is Apache/2.2.11 (2002011).
        Your system is apparently running Apache/2.2.11.  Setting stderr to non-blocking for msDebug() due to Apache 2.x bug (see MapServer bug 458 or Apache bug 22030).

Apache marked the bug fixed since Version 2.0.49.

comment:6 by dmorissette, 15 years ago

Description: modified (diff)

I committed a new configure.in in r9301 that will check if the version is lower than 2.0.49.

(Unfortunately I could not commit the generated "configure" script because I've got autoconf 2.63 on my system which has a problem: the generated "configure" file contains an "ac_cr='M'" line which causes SVN to complain about "Inconsistent line ending style".)

Note: See TracTickets for help on using tickets.