cgi script doesn't import bogofilter output
relson at osagesoftware.com
Fri Jan 23 07:47:52 EST 2004
On Fri, 23 Jan 2004 11:15:43 +0100
Matthias Andree wrote:
> On Thu, 22 Jan 2004, Chris Fortune wrote:
> > This is probably a *nix permissions question, but maybe not, since
> > bogofilter is the only program that gives me this problem. I have a
> > perl script that calls bogofilter in this way:
> > $res = `bogofilter -T < $filename`;
> > $exitcode = $? >> 8;
> > It works well from the command line, spitting out the expected Terse
> > output (eg: "H 0.00804545"), and exitcode 0 or 1. But, when I run
> > it from the web (a cgi demo for my partner), $res is empty and
> > exitcode is always 139.
> 139 is usually SIGSEGV + 128, +128 indicates a core dump has been
> written. Please find the core file and obtain a stack backtrace (find
> /server/root -name '*core*'), the - otherwise unrelated - leafnode FAQ
> tells you how to do this,
> - see "Obtaining a stack backtrace/From a core file".
As mentioned last night, it's likely you're missing a crucial
environment variable. If bogofilter can't find the wordlist directory,
for example if HOME isn't set, you _will_ get a segfault. In a quick
test, adding "-d /your/wordlist/directory/" to the bogofilter command
fixes the problem.
P.S. I've just released 0.16.4 so the segfault fix will have to wait
for the next release.
More information about the Bogofilter