Hi Mark,
Mark Hindley via RT wrote:
Show quoted text> Hi,
>
> I maintain Debian apt-cacher which has recently started to use
> libwww-curl.
>
> Since upgrading to version 4.00 and libdb4.6 users (and I) have been
> getting intermittent segfaults. I haven't managed to nail down a minimal
> test case.
I've recently released WWW::Curl 4.01 through 4.04, these fix a bunch of
bugs. Could you please install 4.04 from CPAN and check whether the
issue still occurs?
Show quoted text
At the moment the only known bug that I know about is duphandle not
working correctly on some systems.
I haven't seen intermittent segfaults with WWW::Curl yet, in my
experience it is either hit or miss, depending on Perl version and
platform. I've been slowly improving upon the situation though.
If the bug exists in 4.04, then unfortunately it'll be pretty hard to
track down, because it depends on some combination of perl, libcurl and
WWW::Curl. For example, I'm running WWW::Curl in some pretty demanding
environments, where a single process is making 200-300 thousand requests
in a few hours' space. I haven't had a segfault yet. Since the latest
release, I'm also testing with different combinations of perl and
libcurl on debian sid.
Btw, I've noticed that you've got this at line 1234 in the file apt-cacher2:
$curl->setopt(CURLOPT_WRITEHEADER, [\$response, ($pkfdref ? 1 : 0)]);
This parameter expects a filehandle, or a reference to a filehandle. I'm
not sure what happens if an arrayref gets assigned, but things could get
gravely messed up. In future WWW::Curl versions this will probably croak.
Also, please note that WWW::Curl 4.01 fixed the bug where if something
was not assigned to CURLOPT_WRITEHEADER, header content appeared on
STDOUT. That is no longer the case, however if you do set a filehandle
to WRITEHEADER, then you'll get the header output.
Regards,
Bálint Szilakszi