Re: Bus error in LWP/Perl5
Gisle Aas (aas@oslonett.no)
Sun, 05 Nov 1995 12:25:10 +0100
Fri, 20 Oct 1995 I wrote:
> > > > It also core dumps for me (SunOS4.1.4) and it seems to be in
> > > > pp_sselect() somewhere. Hans de Graaff once reported a bug
> > > > involving pp_sselect so I guess this is that same problem. I still
> > > > don't know what the problem is.
> > >
> > > > Hans, did you manage to track down this problem any further?
> > >
> > > Nope. I haven't had time to track this down any further. I just worked
> > > around the URL giving me the crash.
> >
> > I tried that. The list of URLs I included is part of a larger list
> > (5,500 or so). It didn't matter whether I deleted the URLs that caused
> > the crash, it seemed to be position dependent.
> >
> > I.e., after n URLs, where n is 17 (as far as I can tell) it dumps core.
>
> I manage to get a core dump with this url-list:
>
> http://alpha.mkn.co.uk/help/flower/info
> #http://anther.learning.cs.cmu.edu/priest.html
> http://artaids.dcs.qmw.ac.uk:8001/entrance/entrance.html
>
> There might be something strange that happens after we have visited
> "flower/info". Some more checking seems to indicate that any URL checked
> after "flower/info" will give a segmentation fault.
This patch makes this problem go away:
--- Socket.pm 1995/10/19 18:11:36 1.16
+++ Socket.pm 1995/11/05 11:16:59
@@ -262,7 +262,8 @@
sub pushback
{
LWP::Debug::trace('(...)');
- substr(shift->{'buffer'}, 0, 0) = shift;
+ my $self = shift;
+ substr($self->{'buffer'}, 0, 0) = shift;
}
=head2 write($data, [$timeout])
Can anybody explain what is going on? Test the code with:
request -mHEAD http://alpha.mkn.co.uk/help/flower/info
> The server itself seems quite normal to me:
It is not very normal if you try the HEAD http method. :-(
>
> $ telnet alpha.mkn.co.uk 80
> Trying 193.118.187.101 ...
> Connected to alpha.mkn.co.uk.
> Escape character is '^]'.
> GET /help/flower/info HTTP/1.0
>
> HTTP/1.0 200 Okeydokey
> Allow: GET POST
> Mime-Version: 1.0
> Content-Type: text/html
>
> <HTML>
> <TITLE>MarketNet - OnLine Florist</TITLE>
> <H1>Flower<I>Net</I> - OnLine Florist</H1>
> ...
>
>
> --Gisle