tags 292071 patch
thanks

Hi,

speedy actually segfaults when it has any problems reading the perl
script specified on the command line. Furthermore, its command-line
parsing is not quite compatible with the real Perl, and in the '-I .'
case it's treating the dot as the script filename.

The segfault happens in src/speedy_util.c:just_die(), in the strerror()
call. The reason is a bit complicated: including "perl.h" makes
strerror() a wrapper that needs a running embedded perl interpeter to
work. The wrapper resides in /usr/lib/perl/5.8.4/CORE/reentr.inc.  It
tries to access an interpreter-specific area for global variables, in
this case the strerror buffer, but this area is not allocated yet since
no interpreter has been started.

The easiest workaround I could come up with (aside from starting an
interpreter in the frontend, which I guess would make SpeedyCGI more or
less useless with the increased overhead) is to switch from strerror()
to strerror_r(). The attached dpatch does this and fixes the issue for
me.

I tried to make the patch portable to other operating systems, but at
least it does work for Debian (sarge and sid). I'll report this
upstream as well, FWIW.

The command-line parsing incompatibilities with the real Perl aren't
very easy to fix, as even the perlrun manpage isn't quite accurate on
which parameters can be separated (like '-I') and which can't (like
'-C').  Speedy doesn't allow any of them to be separated. It considers
the first option without a leading dash as the script filename.

Cheers,
-- 
Niko Tyni               [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to