Tried strace earlier but its not there. Never heard of truss before,
but it looks like digest (what’s that?) and socket.rb/socket.so are
missing. Bizarre; no idea why/how, nor why the previous version
worked at all.
bash-2.04$ truss ruby -v -rsocket -e ‘TCPServer.new(“127.0.0.1”, 8080)’
__sysctl(0xbfbffa3c,0x2,0x280ed808,0xbfbffa38,0x0,0x0) = 0 (0x0)
mmap(0x0,32768,0x3,0x1002,-1,0x0) = 672063488 (0x280ee000)
geteuid() = 1000 (0x3e8)
getuid() = 1000 (0x3e8)
getegid() = 1000 (0x3e8)
getgid() = 1000 (0x3e8)
open(“/var/run/ld-elf.so.hints”,0,00) = 3 (0x3)
read(0x3,0xbfbffa1c,0x80) = 128 (0x80)
lseek(3,0x80,0) = 128 (0x80)
read(0x3,0x280f2000,0x4c) = 76 (0x4c)
close(3) = 0 (0x0)
access(“/usr/lib/libcrypt.so.2”,0) = 0 (0x0)
open(“/usr/lib/libcrypt.so.2”,0,027757775224) = 3 (0x3)
fstat(3,0xbfbffa64) = 0 (0x0)
read(0x3,0xbfbfea34,0x1000) = 4096 (0x1000)
mmap(0x0,86016,0x5,0x2,3,0x0) = 672096256 (0x280f6000)
mmap(0x280f9000,4096,0x3,0x12,3,0x2000) = 672108544 (0x280f9000)
mmap(0x280fa000,69632,0x3,0x1012,-1,0x0) = 672112640 (0x280fa000)
close(3) = 0 (0x0)
access(“/usr/lib/libm.so.2”,0) = 0 (0x0)
open(“/usr/lib/libm.so.2”,0,027757775224) = 3 (0x3)
fstat(3,0xbfbffa64) = 0 (0x0)
read(0x3,0xbfbfea34,0x1000) = 4096 (0x1000)
mmap(0x0,110592,0x5,0x2,3,0x0) = 672182272 (0x2810b000)
mmap(0x28122000,16384,0x3,0x12,3,0x16000) = 672276480 (0x28122000)
close(3) = 0 (0x0)
access(“/usr/lib/libc.so.4”,0) = 0 (0x0)
open(“/usr/lib/libc.so.4”,0,027757775224) = 3 (0x3)
fstat(3,0xbfbffa64) = 0 (0x0)
read(0x3,0xbfbfea34,0x1000) = 4096 (0x1000)
mmap(0x0,610304,0x5,0x2,3,0x0) = 672292864 (0x28126000)
mmap(0x281a3000,20480,0x3,0x12,3,0x7c000) = 672804864 (0x281a3000)
mmap(0x281a8000,77824,0x3,0x1012,-1,0x0) = 672825344 (0x281a8000)
close(3) = 0 (0x0)
sigaction(SIGILL,0xbfbffabc,0xbfbffaa4) = 0 (0x0)
sigprocmask(0x1,0x0,0x280ed73c) = 0 (0x0)
sigaction(SIGILL,0xbfbffaa4,0x0) = 0 (0x0)
sigprocmask(0x1,0x280ed700,0xbfbffae4) = 0 (0x0)
sigprocmask(0x3,0x280ed710,0x0) = 0 (0x0)
readlink(“/etc/malloc.conf”,0xbfbff9f0,63) ERR#2 ‘No such file
or directory’
mmap(0x0,4096,0x3,0x1002,-1,0x0) = 672903168 (0x281bb000)
break(0x80ec000) = 0 (0x0)
break(0x80ed000) = 0 (0x0)
break(0x811e000) = 0 (0x0)
break(0x811f000) = 0 (0x0)
break(0x8120000) = 0 (0x0)
break(0x8121000) = 0 (0x0)
break(0x8122000) = 0 (0x0)
getrlimit(0x3,0xbfbffa90) = 0 (0x0)
break(0x8123000) = 0 (0x0)
break(0x8124000) = 0 (0x0)
break(0x8125000) = 0 (0x0)
break(0x8126000) = 0 (0x0)
break(0x8127000) = 0 (0x0)
break(0x8128000) = 0 (0x0)
break(0x8129000) = 0 (0x0)
break(0x812a000) = 0 (0x0)
break(0x812b000) = 0 (0x0)
break(0x812c000) = 0 (0x0)
break(0x812d000) = 0 (0x0)
break(0x812e000) = 0 (0x0)
break(0x812f000) = 0 (0x0)
break(0x8130000) = 0 (0x0)
break(0x8131000) = 0 (0x0)
break(0x8132000) = 0 (0x0)
break(0x8133000) = 0 (0x0)
break(0x8134000) = 0 (0x0)
break(0x8135000) = 0 (0x0)
break(0x8136000) = 0 (0x0)
break(0x8137000) = 0 (0x0)
break(0x8138000) = 0 (0x0)
break(0x8139000) = 0 (0x0)
break(0x813a000) = 0 (0x0)
break(0x813b000) = 0 (0x0)
sigaction(SIGINT,0xbfbffa58,0x0) = 0 (0x0)
sigaction(SIGHUP,0xbfbffa68,0x0) = 0 (0x0)
sigaction(SIGQUIT,0xbfbffa58,0x0) = 0 (0x0)
sigaction(SIGALRM,0xbfbffa68,0x0) = 0 (0x0)
sigaction(SIGUSR1,0xbfbffa58,0x0) = 0 (0x0)
sigaction(SIGUSR2,0xbfbffa68,0x0) = 0 (0x0)
sigaction(SIGBUS,0xbfbffa58,0x0) = 0 (0x0)
sigaction(SIGSEGV,0xbfbffa68,0x0) = 0 (0x0)
sigaction(SIGPIPE,0xbfbffa58,0x0) = 0 (0x0)
break(0x813c000) = 0 (0x0)
break(0x813d000) = 0 (0x0)
break(0x813e000) = 0 (0x0)
getuid() = 1000 (0x3e8)
geteuid() = 1000 (0x3e8)
getgid() = 1000 (0x3e8)
getegid() = 1000 (0x3e8)
fstat(1,0xbfbff680) = 0 (0x0)
ioctl(1,TIOCGETA,0xbfbff6b4) = 0 (0x0)
ruby 1.6.7 (2002-03-01) [i386-freebsd4.1.1]
write(1,0x8131400,44) = 44 (0x2c)
break(0x813f000) = 0 (0x0)
break(0x8140000) = 0 (0x0)
break(0x8141000) = 0 (0x0)
break(0x8142000) = 0 (0x0)
break(0x8143000) = 0 (0x0)
break(0x8144000) = 0 (0x0)
break(0x8145000) = 0 (0x0)
break(0x8146000) = 0 (0x0)
stat(“/usr/local/lib/ruby/site_ruby/1.6/digest.so”,0xbfbff7b0) ERR#2
‘No such file or directory’
stat(“/usr/local/lib/ruby/site_ruby/1.6/i386-freebsd4.1.1/digest.so”,0xbfbff7b0)
ERR#2 ‘No such file or directory’
stat(“/usr/local/lib/ruby/site_ruby/digest.so”,0xbfbff7b0) ERR#2 ‘No
such file or directory’
stat(“/usr/local/lib/ruby/1.6/digest.so”,0xbfbff7b0) ERR#2 ‘No such
file or directory’
stat(“/usr/local/lib/ruby/1.6/i386-freebsd4.1.1/digest.so”,0xbfbff7b0)
= 0 (0x0)
open(“/usr/local/lib/ruby/1.6/i386-freebsd4.1.1/digest.so”,0,0666) = 3 (0x3)
close(3) = 0 (0x0)
stat(“/usr/local/lib/ruby/site_ruby/1.6/digest.so”,0xbfbff7c0) ERR#2
‘No such file or directory’
stat(“/usr/local/lib/ruby/site_ruby/1.6/i386-freebsd4.1.1/digest.so”,0xbfbff7c0)
ERR#2 ‘No such file or directory’
stat(“/usr/local/lib/ruby/site_ruby/digest.so”,0xbfbff7c0) ERR#2 ‘No
such file or directory’
stat(“/usr/local/lib/ruby/1.6/digest.so”,0xbfbff7c0) ERR#2 ‘No such
file or directory’
stat(“/usr/local/lib/ruby/1.6/i386-freebsd4.1.1/digest.so”,0xbfbff7c0)
= 0 (0x0)
open(“/usr/local/lib/ruby/1.6/i386-freebsd4.1.1/digest.so”,0,0666) = 3 (0x3)
close(3) = 0 (0x0)
stat(“/usr/local/lib/ruby/site_ruby/1.6/digest.so”,0xbfbff7b0) ERR#2
‘No such file or directory’
stat(“/usr/local/lib/ruby/site_ruby/1.6/i386-freebsd4.1.1/digest.so”,0xbfbff7b0)
ERR#2 ‘No such file or directory’
stat(“/usr/local/lib/ruby/site_ruby/digest.so”,0xbfbff7b0) ERR#2 ‘No
such file or directory’
stat(“/usr/local/lib/ruby/1.6/digest.so”,0xbfbff7b0) ERR#2 ‘No such
file or directory’
stat(“/usr/local/lib/ruby/1.6/i386-freebsd4.1.1/digest.so”,0xbfbff7b0)
= 0 (0x0)
open(“/usr/local/lib/ruby/1.6/i386-freebsd4.1.1/digest.so”,0,0666) = 3 (0x3)
close(3) = 0 (0x0)
stat(“/usr/local/lib/ruby/site_ruby/1.6/digest.so”,0xbfbff7c0) ERR#2
‘No such file or directory’
stat(“/usr/local/lib/ruby/site_ruby/1.6/i386-freebsd4.1.1/digest.so”,0xbfbff7c0)
ERR#2 ‘No such file or directory’
stat(“/usr/local/lib/ruby/site_ruby/digest.so”,0xbfbff7c0) ERR#2 ‘No
such file or directory’
stat(“/usr/local/lib/ruby/1.6/digest.so”,0xbfbff7c0) ERR#2 ‘No such
file or directory’
stat(“/usr/local/lib/ruby/1.6/i386-freebsd4.1.1/digest.so”,0xbfbff7c0)
= 0 (0x0)
open(“/usr/local/lib/ruby/1.6/i386-freebsd4.1.1/digest.so”,0,0666) = 3 (0x3)
close(3) = 0 (0x0)
stat(“/usr/local/lib/ruby/site_ruby/1.6/socket.rb”,0xbfbff860) ERR#2
‘No such file or directory’
stat(“/usr/local/lib/ruby/site_ruby/1.6/socket.so”,0xbfbff860) ERR#2
‘No such file or directory’
stat(“/usr/local/lib/ruby/site_ruby/1.6/i386-freebsd4.1.1/socket.rb”,0xbfbff860)
ERR#2 ‘No such file or directory’
stat(“/usr/local/lib/ruby/site_ruby/1.6/i386-freebsd4.1.1/socket.so”,0xbfbff860)
ERR#2 ‘No such file or directory’
stat(“/usr/local/lib/ruby/site_ruby/socket.rb”,0xbfbff860) ERR#2 ‘No
such file or directory’
stat(“/usr/local/lib/ruby/site_ruby/socket.so”,0xbfbff860) ERR#2 ‘No
such file or directory’
stat(“/usr/local/lib/ruby/1.6/socket.rb”,0xbfbff860) ERR#2 ‘No such
file or directory’
stat(“/usr/local/lib/ruby/1.6/socket.so”,0xbfbff860) ERR#2 ‘No such
file or directory’
stat(“/usr/local/lib/ruby/1.6/i386-freebsd4.1.1/socket.rb”,0xbfbff860)
ERR#2 ‘No such file or directory’
stat(“/usr/local/lib/ruby/1.6/i386-freebsd4.1.1/socket.so”,0xbfbff860)
= 0 (0x0)
open(“/usr/local/lib/ruby/1.6/i386-freebsd4.1.1/socket.so”,0,0666) = 3 (0x3)
close(3) = 0 (0x0)
stat(“/usr/local/lib/ruby/site_ruby/1.6/socket.so”,0xbfbff800) ERR#2
‘No such file or directory’
stat(“/usr/local/lib/ruby/site_ruby/1.6/i386-freebsd4.1.1/socket.so”,0xbfbff800)
ERR#2 ‘No such file or directory’
stat(“/usr/local/lib/ruby/site_ruby/socket.so”,0xbfbff800) ERR#2 ‘No
such file or directory’
stat(“/usr/local/lib/ruby/1.6/socket.so”,0xbfbff800) ERR#2 ‘No such
file or directory’
stat(“/usr/local/lib/ruby/1.6/i386-freebsd4.1.1/socket.so”,0xbfbff800)
= 0 (0x0)
open(“/usr/local/lib/ruby/1.6/i386-freebsd4.1.1/socket.so”,0,0666) = 3 (0x3)
close(3) = 0 (0x0)
break(0x8147000) = 0 (0x0)
socket(0x2,0x1,0x6) = 3 (0x3)
setsockopt(0x3,0xffff,0x4,0xbfbff1d8,0x4) = 0 (0x0)
bind(0x3,0x8146060,0x10) ERR#22 ‘Invalid argument’
close(3) = 0 (0x0)
sigprocmask(0x3,0x80e9a60,0x0) = 0 (0x0)
-e:1:in `new’write(2,0x8144ef0,13) = 13 (0xd)
: write(2,0xbfbff228,2) = 2 (0x2)
Invalid argument - "bind(2)"write(2,0x8143100,28)
= 28 (0x1c)
(write(2,0xbfbff228,2) = 2 (0x2)
Errno::EINVALwrite(2,0x812a320,13) = 13 (0xd)
)
write(2,0xbfbff228,2) = 2 (0x2)
from -e:1
write(2,0xbfbff228,11) = 11 (0xb)
sigprocmask(0x1,0x280ed700,0xbfbff9a0) = 0 (0x0)
sigprocmask(0x3,0x280ed710,0x0) = 0 (0x0)
exit(0x1) process exit, rval = 256
bash-2.04$
···
At 12:02 PM +0900 7/13/02, Dave Thomas wrote:
Brad Cox bcox@virtualschool.edu writes:
The puzzler is why the previous release of my ruby stuff is running
just fine but the new release fails during startup, on the basic stuff
I sent in the test case. They’re using different ports.
Does it have strace or truss, so you can see exactly what parameters
are being passed to the bind call?
–
Brad Cox, PhD; bcox@virtualschool.edu 703 361 4751
o For industrial age goods there were checks and credit cards.
For everything else there is http://virtualschool.edu/mybank
o Java Interactive Learning Environment http://virtualschool.edu/jile
o Java Web Application Architecture: http://virtualschool.edu/jwaa