Bug in LWP::Socket.pm?

Hans de Graaff (J.J.deGraaff@twi.tudelft.nl)
Wed, 4 Oct 1995 14:56:52 +0100


Yesterday I mailed about a perl5.001m crash when using
libwwwperl-5b5. I've found some additional information on this crash
(appended below, also sent to perlbug@perl.com).

I've also noticed that the crash happens after accessing a particular
URL. When I get this URL using the 'GET' script, I get:

I assume the use of an unitizialized value might be the cause for the
crash (which still should not occur).

Hans
-- 
Hans de Graaff                              J.J.deGraaff@TWI.TUDelft.NL
Delft University of Technology        Department of Information Systems
----- <a href=http://is.twi.tudelft.nl/~graaff/>Hans de Graaff</a> ----


---- GET request ----
dutifp:~: GET -ex http://c.gp.cs.cmu.edu:5103/prog/webster
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::simpleRequest: ()
LWP::UserAgent::_needProxy: (http://c.gp.cs.cmu.edu:5103/prog/webster)
LWP::UserAgent::_needProxy: Not proxied
LWP::Protocol::http::request: LWP::http::request(HTTP::Request=HASH(0x20705c), <undef>, <undef>)
LWP::Socket::new: (LWP::Socket)
LWP::Socket::new: Socket LWP::Socket::SOCKET000
LWP::Socket::connect: (c.gp.cs.cmu.edu, 5103)
LWP::Socket::_getaddress: resolving host 'c.gp.cs.cmu.edu'...
LWP::Socket::_getaddress:    ...128.2.209.153
LWP::Socket::connect: Connecting to host 'c.gp.cs.cmu.edu' on port '5103'...
LWP::Protocol::http::request: request line: GET /prog/webster HTTP/1.0
LWP::Socket::write: ()
LWP::IO::write: Write 56 bytes: 'GET /prog/webster HTTP/1.0
User-Agent: LWP-GET/1.19
 
'
LWP::Protocol::http::request: reading response
LWP::Socket::readUntil: (...)
LWP::IO::read: Read 1024 bytes: '<html>
<head><title>Hypertext Webster Interface</title></head><body>
<h1>Hypertext Webster Interface</h1>
 
<hr>
<form action="http://c.gp.cs.cmu.edu:5103/prog/webster">
Enter word here:<input name="isindex" size=40 value=""><br>
<input type="submit" value="Look up definition">
<input type="reset" name="Clear entry">
</form>
<hr>
<p>
This hypertext Webster interface provides a point-and-click client interface
(for non-linemode browsers)
for accessing the various Webster's dictionary services on the Internet.
First, <em>type</em> the word for which you want the definition
in the search window and hit return.
Words in the resulting definition are hypertext linked
back into the dictionary, allowing you to use your mouse
to access the definition of those related (and unrelated) words.
<p>
 
If you misspell the word, the webster server may offer a list of close
matches as alternatives.  If you know the prefix of the word, a list
of potential matches may be obtained by entering a <samp>*</samp> after
the prefix, e.g.'
LWP::Protocol::http::request: HTTP/0.9 server
LWP::Socket::pushback: (...)
Use of uninitialized value at /export/graaff/lib/perl5/LWP/Socket.pm line 265.
LWP::UserAgent::request: Simple result: Internal Server Error
 
An Error Occurred

An Error Occurred

Modification of a read-only value attempted.



---- Perl bug report -----

I'm getting a segmentation fault with perl5.

Details: perl5.001m, Solaris 2.4, compiled with gcc 2.5.8,
	 using libwwwperl-5b5.

Backtrace:

(gdb) bt
#0  0x72e70 in pp_sselect () at pp_sys.c:571
#1  0x476ec in run () at run.c:56
#2  0x1cc40 in perl_run (sv_interp=0x9f008) at perl.c:516
#3  0x1bb34 in main (argc=0, argv=0xeffff6dc, env=0xeffff6ec) at perlmain.c:34

567         SP -= 4;
568         for (i = 1; i <= 3; i++) {
569             if (!SvPOK(SP[i]))
570                 continue;
571             j = SvCUR(SP[i]);
572             if (maxlen < j)
573                 maxlen = j;
574         }

i == 2; sp[i] exists, as does SvCUR (which evaluates to 2). I don't
really see why a segmentation fault occurs here, but maybe somebody
else does?