Bugs: Browse | Submit New | Admin

[#10191] test_cgi failure on OS X

Date:
2007-04-18 11:12
Priority:
3
Submitted By:
Michal Suchanek (hramrach)
Assigned To:
Akinori MUSHA (knu)
Category:
Network / Comm / Protocols
State:
Open
Platform:
 
Summary:
test_cgi failure on OS X

Detailed description
make check fails for me on OS X.

  1) Failure:
test_cgi(TestWEBrickCGI)
    [./test/webrick/test_cgi.rb:27:in `test_cgi'
     /Users/hramrach/ruby-1.8.6/lib/net/http.rb:1050:in `request'
     /Users/hramrach/ruby-1.8.6/lib/net/http.rb:2133:in `reading_body'
     /Users/hramrach/ruby-1.8.6/lib/net/http.rb:1049:in `request'
     /Users/hramrach/ruby-1.8.6/lib/net/http.rb:1034:in `request'
     /Users/hramrach/ruby-1.8.6/lib/net/http.rb:543:in `start'
     /Users/hramrach/ruby-1.8.6/lib/net/http.rb:1032:in `request'
     ./test/webrick/test_cgi.rb:27:in `test_cgi'
     ./test/webrick/utils.rb:26:in `call'
     ./test/webrick/utils.rb:26:in `start_server'
     ./test/webrick/utils.rb:34:in `start_httpserver'
     ./test/webrick/test_cgi.rb:24:in `test_cgi']:
<"/webrick.cgi"> expected but was
<"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\">\n<HTML>\n
<HEAD><TITLE>Internal Server Error</TITLE></HEAD>\n  <BODY>\n    <H1>Internal Server
Error</H1>\n    Premature end of script headers: /Users/hramrach/ruby-1.8.6/test/webrick/webrick.cgi\n    <HR>\n
<ADDRESS>\n     WEBrick/1.3.1 (Ruby/1.8.6/2007-03-13) OpenSSL/0.9.7l at\n     127.0.0.1:50589\n    </ADDRESS>\n
</BODY>\n</HTML>\n">.

1610 tests, 16577 assertions, 1 failures, 0 errors


ProductName:    Mac OS X
ProductVersion: 10.4.9
BuildVersion:   8P2137

i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5363)

Add A Comment: Notepad

Please login


Followup

Message
Date: 2007-07-09 12:56
Sender: Rod Cater

This error goes away if you install the newly built Ruby and
re-run 'make check'. Actually, there are more serious errors
if you configure with a prefix which is empty - such as
--prefix=/path/to/empty/dir. In this case 'make check' fails
with 52 errors (1 WEBrick and 51 SOAP/WSDL). After 'make install'
completes the checks run correctly.

I'm observing the same behavior on Linux (Gentoo with kernel
2.6.16 and gcc 4.1.2) so it's not unique to OS X.
Date: 2007-07-09 08:02
Sender: Ryan Davis

% ruby -v -e 'p $:; require "socket"'
ruby 1.8.5 (2006-08-25) [i686-darwin8.8.1]
["/usr/local/lib/ruby/site_ruby/1.8",
"/usr/local/lib/ruby/site_ruby/1.8/i686-darwin8.8.1",
"/usr/local/lib/ruby/site_ruby",
"/usr/local/lib/ruby/1.8",
"/usr/local/lib/ruby/1.8/i686-darwin8.8.1",
"."]

% ./ruby -v -e 'p $:; require "socket"'
ruby 1.8.6 (2007-07-06 patchlevel 5000) [i686-darwin8.10.1]
["/usr/local/lib/ruby/site_ruby/1.8",
"/usr/local/lib/ruby/site_ruby/1.8/i686-darwin8.10.1",
"/usr/local/lib/ruby/site_ruby",
"/usr/local/lib/ruby/1.8",
"/usr/local/lib/ruby/1.8/i686-darwin8.10.1",
"."]
-e:1:in `require': no such file to load -- socket (LoadError)
        from -e:1
Date: 2007-07-09 07:25
Sender: Ryan Davis

It boils down to lib/webrick/httpservlet/cgihandler.rb building
its own CGIRunner from Config::CONFIG instead of what was passed
down via the webrick config hash. By using Config::CONFIG, it
forks a cgi handler via /usr/local/bin/ruby instead of the ruby
under test.

This also means the test will fail outright if no previous ruby
is installed at that location, semi-related to a recent ruby
1.9 config/build bug.
Date: 2007-07-09 06:51
Sender: Ryan Davis

yeah. it is failing because it can't load socket from
/usr/local/lib/blahblah instead of .ext, because the .ext one
is already loaded and I assume binaries don't play nice like
that.

you can see this by running test_cgi.rb with -d on.
Date: 2007-07-09 03:44
Sender: Rod Cater

This error goes away if you install the newly built Ruby and
re-run 'make check'. Actually, there are more serious errors
if you configure with a prefix which is empty - such as
--prefix=/path/to/empty/dir. In this case 'make check' fails
with 52 errors (1 WEBrick and 51 SOAP/WSDL). After 'make install'
completes the checks run correctly.

I'm observing the same behavior on Linux (Gentoo with kernel
2.6.16 and gcc 4.1.2) so it's not unique to OS X.
Date: 2007-07-08 18:57
Sender: Rod Cater

I'm seeing the same exact error on OS X 10.4.10 (8R218) with
a slightly later build of GCC 4.0.1 (5367) after running:

./configure --prefix=/usr/local --enable-pthread
make
make check

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
resolution_idNone2007-07-09 07:25zenspider
assigned_tonone2007-06-12 02:25zenspider
category_idMisc / Other Standard Library2007-05-29 20:59zenspider