accept error on Ubuntu 8.04

7 views
Skip to first unread message

jwilkins

unread,
May 30, 2008, 7:25:02 PM5/30/08
to ebbebb
I'm seeing "accept(): Invalid argument" when running on Ubuntu 8.04
Hardy.

The gem installs fine and builds without error but the tests fail.
Loaded suite basic_test
Started
accept(): Invalid argument
Eaccept(): Invalid argument
Eaccept(): Invalid argument
Eaccept(): Invalid argument
Eaccept(): Invalid argument
Eaccept(): Invalid argument
Eaccept(): Invalid argument
Eaccept(): Invalid argument
Eaccept(): Invalid argument
Eaccept(): Invalid argument
Eaccept(): Invalid argument
Eaccept(): Invalid argument
E....
Finished in 1.739958 seconds.

1) Error:
test_get_bytes(BasicTest):
EOFError: end of file reached
/usr/local/lib/ruby/1.8/net/protocol.rb:135:in `sysread'
/usr/local/lib/ruby/1.8/net/protocol.rb:135:in `rbuf_fill'
/usr/local/lib/ruby/1.8/timeout.rb:62:in `timeout'
/usr/local/lib/ruby/1.8/timeout.rb:93:in `timeout'
/usr/local/lib/ruby/1.8/net/protocol.rb:134:in `rbuf_fill'
/usr/local/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
/usr/local/lib/ruby/1.8/net/protocol.rb:126:in `readline'
/usr/local/lib/ruby/1.8/net/http.rb:2020:in `read_status_line'
/usr/local/lib/ruby/1.8/net/http.rb:2009:in `read_new'
/usr/local/lib/ruby/1.8/net/http.rb:1050:in `request'
/usr/local/lib/ruby/1.8/net/http.rb:948:in `request_get'
/usr/local/lib/ruby/1.8/net/http.rb:380:in `get_response'
/usr/local/lib/ruby/1.8/net/http.rb:543:in `start'
/usr/local/lib/ruby/1.8/net/http.rb:379:in `get_response'
./helper.rb:64:in `get'
basic_test.rb:6:in `test_get_bytes'
basic_test.rb:5:in `each'
basic_test.rb:5:in `test_get_bytes'
<snip>

I'm using:
Linux host1 2.6.24-17-server #1 SMP Thu May 1 15:05:55 UTC 2008 i686
GNU/Linux
Ruby version: ruby 1.8.6 (2008-03-03 patchlevel 114) [i686-linux]
and also on Ruby version: ruby 1.9.0 (2008-03-01 revision 15665) [i686-
linux]
and Ruby version: ruby 1.8.7 (2008-04-16 patchlevel 5000) [i686-linux]

Mongrel works fine here, so does thin.

It doesn't seem to be libev, since running bench from http://libev.schmorp.de/bench.html
works.

Everything runs fine on another similarly configured machine:
Linux host2 2.6.24-17-generic #1 SMP Thu May 1 13:57:17 UTC 2008
x86_64 GNU/Linux
Ruby version: ruby 1.8.6 (2008-03-08 patchlevel 5000) [x86_64-linux]

Both have glib2:
dpkg -l | grep glib2:
ii libglib2.0-0 2.16.3-1ubuntu2
The GLib library of C routines
ii libglib2.0-data 2.16.3-1ubuntu2
Common files for GLib library
ii libglib2.0-dev 2.16.3-1ubuntu2
Development files for the GLib library

Anything else I should be checking?

cdr

unread,
May 30, 2008, 7:54:48 PM5/30/08
to ebb...@googlegroups.com
> its not libev since bench runs..

thats a different program!

the error could be a version mismatch. ebb includes libev in its source tree. might want to try that version..

jwilkins

unread,
May 31, 2008, 2:12:32 PM5/31/08
to ebbebb
I'd only installed libev after it was already failing to see if it was
the library. Exact same thing was happening before it was added.

jwilkins

unread,
Jun 14, 2008, 6:35:47 PM6/14/08
to ebbebb
Found the solution. The len = sizeof line needs to be added. Works
now.

static void client_init(ebb_client *client)
{
assert(client->in_use == FALSE);
__
/* If the client is already open, reuse the fd, just reset all the
parameters
* this would happen in the case of a keep_alive request
*/
if(!client->open) {
/* DO SOCKET STUFF */
socklen_t len;
len = sizeof(struct sockaddr); // add this
line int
fd = accept(client->server->fd, (struct sockaddr*)&(client->sockaddr),
&len);
if(fd < 0) {
perror("accept()");
return;
}
client->open = TRUE;
client->fd = fd;

Aman Gupta

unread,
Jun 14, 2008, 7:13:11 PM6/14/08
to ebb...@googlegroups.com
I'm having the same issue here. Could you submit a patch for this via github?

  Aman

Radosław Bułat

unread,
Jun 15, 2008, 4:41:42 AM6/15/08
to ebbebb
I tried ebb from github with this patch line (len = sizeof(struct
sockaddr);) but it didn't work.

$ rake test
(in /tmp/ebb)
/usr/bin/ruby1.8 -Ilib "/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/
rake/rake_test_loader.rb" "test/env_test.rb" "test/ebb_rails_test.rb"
"test/helper.rb" "test/basic_test.rb"
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:905: warning:
Insecure world writable dir /tmp in PATH, mode 040777
./test/helper.rb:12: warning: already initialized constant TEST_PORT
Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/
rake_test_loader
Started
.............../usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/
active_support/core_ext/kernel/agnostics.rb:7: warning: Insecure world
writable dir /tmp in PATH, mode 040777
F** Message: no status or headers - closing connection.
E** Message: no status or headers - closing connection.
** Message: no status or headers - closing connection.
** Message: no status or headers - closing connection.
** Message: no status or headers - closing connection.
** Message: no status or headers - closing connection.
** Message: no status or headers - closing connection.
** Message: no status or headers - closing connection.
** Message: no status or headers - closing connection.
.** Message: no status or headers - closing connection.
E.** Message: no status or headers - closing connection.
E...
Finished in 7.667183 seconds.

1) Failure:
test_version(EbbRailsTest) [./test/ebb_rails_test.rb:9]:
<"Ebb-Ruby 0.2.0\n"> expected to be =~
</Ebb 0.2.0/>.

2) Error:
test_fragment_in_uri(HttpParserTest):
NoMethodError: undefined method `[]' for :fail:Symbol
./test/env_test.rb:67:in `test_fragment_in_uri'

3) Error:
test_parse_dumbfuck_headers(HttpParserTest):
NoMethodError: undefined method `[]' for :fail:Symbol
./test/env_test.rb:54:in `test_parse_dumbfuck_headers'

4) Error:
test_parse_simple(HttpParserTest):
NoMethodError: undefined method `[]' for :fail:Symbol
./test/env_test.rb:40:in `test_parse_simple'

24 tests, 77 assertions, 1 failures, 3 errors
rake aborted!
Command failed with status (1): [/usr/bin/ruby1.8 -Ilib "/usr/lib/ruby/
gems...]

(See full trace by running task with --trace)

ry dahl

unread,
Jun 15, 2008, 8:42:35 AM6/15/08
to ebb...@googlegroups.com
thanks jwilkens!

i've been neglecting ebb for lack of time, but i want to make some
improvements this week.
i want to start using the libeio library for buffering uploads - i
had removed buffered upload support in ebb 0.2 to let the framework
handle it, but I think that was a bad choice because it complicates
the API and in the end doesn't add much value. I'm afraid it's making
things buggy. i'm also very interested in getting ebb to run on
tamarin.

ry

Reply all
Reply to author
Forward
0 new messages