Hi,
this bug was originally found by Andrew Sayers, who
reported it in the Debian bug tracker as bug #292071.
See http://bugs.debian.org/292071 for the report.
Summary: speedy dies with SIGSEGV if it can't read the
script supplied on the command line, eg. if the user
has no permission to read it or it is a directory. This
happens on Debian GNU/Linux stable (sarge), with Perl
5.8.4, and unstable with Perl 5.8.7. An easy testcase
is 'speedy /'.
I'll quote my comment on the Debian bug report:
---
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, but haven't tested
it on anything else than Debian.
Cheers,
--
Niko Tyni
ntyni@iki.fi
Patch: move from strerror() to strerror_r().