logo       


Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

[ruby-dev:29174] ruby 1.8.5 on HP-UX 11.11 (PA-RISC) test result: msg#00255

Subject: [ruby-dev:29174] ruby 1.8.5 on HP-UX 11.11 (PA-RISC) test result
HP-UX 11.11 (PA-RISC) でのテスト結果です。
make test-all で 2 つ問題がありますが些細なものです。

== 環境

+ uname -srm
HP-UX B.11.11 9000/861
+ what /usr/bin/cc
/usr/bin/cc:
        LINT B.11.11.24830.GP CXREF B.11.11.24830.GP
        HP92453-01 B.11.11.24830.GP HP C Compiler
         $   Sep  8 2000 23:13:51 $
+ openssl version
OpenSSL 0.9.7d 17 Mar 2004

== make

+ mkdir build; cd build
+ ../configure --prefix=/home/miyamuko/opt/ruby185
--program-suffix=185 --disable-ipv6
+ make
+ make test
test succeeded
+ make test-all
       ./miniruby ../runruby.rb --extout=.ext -- -C "../test"
runner.rb --runner=console
Loaded suite .
Started
...............(略)
../test/ruby/test_process.rb:26:in `setrlimit': Invalid argument -
setrlimit (Errno::EINVAL)
        from ../test/ruby/test_process.rb:26:in `test_rlimit_nofile'
        from ../test/ruby/test_process.rb:24:in `fork'
        from ../test/ruby/test_process.rb:24:in `test_rlimit_nofile'
        from /home/miyamuko/src/ruby_1_8/lib/test/unit/testcase.rb:70:in 
`__send__'
        from /home/miyamuko/src/ruby_1_8/lib/test/unit/testcase.rb:70:in `run'
        from /home/miyamuko/src/ruby_1_8/lib/test/unit/testsuite.rb:32:in `run'
        from /home/miyamuko/src/ruby_1_8/lib/test/unit/testsuite.rb:31:in `each'
        from /home/miyamuko/src/ruby_1_8/lib/test/unit/testsuite.rb:31:in `run'
         ... 6 levels...
        from 
/home/miyamuko/src/ruby_1_8/lib/test/unit/ui/testrunnerutilities.rb:27:in
`run'
        from /home/miyamuko/src/ruby_1_8/lib/test/unit/autorunner.rb:200:in 
`run'
        from /home/miyamuko/src/ruby_1_8/lib/test/unit/autorunner.rb:13:in `run'
        from runner.rb:7
F...............(略)

 1) Failure:
test_03(TestDRbUNIXCore) [/home/miyamuko/src/ruby_1_8/test/drb/drbtest.rb:143]:
<ArgumentError> exception expected but was
Class: <Errno::EINVAL>
Message: <"Invalid argument">
---Backtrace---
/home/miyamuko/src/ruby_1_8/lib/drb/unix.rb:91:in `path'
/home/miyamuko/src/ruby_1_8/lib/drb/unix.rb:91:in `close'
/home/miyamuko/src/ruby_1_8/lib/drb/drb.rb:1199:in `close'
/home/miyamuko/src/ruby_1_8/lib/drb/drb.rb:1181:in `open'
/home/miyamuko/src/ruby_1_8/lib/drb/drb.rb:1085:in `method_missing'
/home/miyamuko/src/ruby_1_8/lib/drb/drb.rb:1103:in `with_friend'
/home/miyamuko/src/ruby_1_8/lib/drb/drb.rb:1084:in `method_missing'
/home/miyamuko/src/ruby_1_8/test/drb/drbtest.rb:144:in `test_03'
/home/miyamuko/src/ruby_1_8/test/drb/drbtest.rb:143:in `test_03'
---------------

同じエラーがあと 7 個。


 9) Failure:
test_rlimit_nofile(TestProcess) [../test/ruby/test_process.rb:35]:
<0> expected but was
<256>.



== Invalid argument - setrlimit (Errno::EINVAL)

test_rlimit_nofile ですが、これは HP-UX の setrlimit(2) は指定した値より
現在の使用量のほうが多い場合 EINVAL になります。

   % ruby185 -e "p Process.setrlimit(Process::RLIMIT_NOFILE, 2, 100)"
   -e:1:in `setrlimit': Invalid argument - setrlimit (Errno::EINVAL)
           from -e:1
   % ruby185 -e "p Process.setrlimit(Process::RLIMIT_NOFILE, 3, 100)"
   nil
   % ruby185 -e "IO.pipe; p Process.setrlimit(Process::RLIMIT_NOFILE, 3, 100)"
   -e:1:in `setrlimit': Invalid argument - setrlimit (Errno::EINVAL)
           from -e:1

man setrlimit

   setrlimit() 関数は次の場合に失敗します。

     [EINVAL]   指定した値よりも現在の使用量がすでに超えているため、
                制限値を指定した値に設定することができない場合

   http://docs.hp.com/ja/B2355-60104-05/getrlimit.2.html


そのため test_process.rb でテストの setup として実行している以下の部分で
エラーになっています。

 Process.setrlimit(Process::RLIMIT_NOFILE, 0, max_nofile)

これは HP-UX の場合スキップしちゃえばいいんですかねぇ。。。


== test_03(TestDRbUNIXCore)

drb のほうは close したソケットに対して path (getsockname) を呼んでいるため
です。この場合 HP-UX では EINVAL になります。

   % ruby185 -rsocket -ve "s = UNIXSocket.pair; s[0].close; p s[1].path"
   ruby 1.8.5 (2006-07-28) [hppa2.0n-hpux11.11]
   -e:1:in `path': Invalid argument (Errno::EINVAL)
           from -e:1
   % ruby185 -rsocket -ve "s = UNIXSocket.pair; s[0].close; p s[1].path"
   ruby 1.8.5 (2006-07-28) [ia64-linux]
   ""

man getsockname

   getsockname() は、次の条件のどれかの場合に失敗します。

     [EINVAL]   ソケットが、シャットダウンされている場合

   http://docs.hp.com/ja/B2355-60104-05/getsockname.2.html



とりあえず以下で直りますがどうでしょう。
#挙動が一致するように path のほうを直したほうがいいのかもしれません。

Index: lib/drb/unix.rb
===================================================================
RCS file: /src/ruby/lib/drb/unix.rb,v
retrieving revision 1.5.2.2
diff -u -r1.5.2.2 unix.rb
--- lib/drb/unix.rb     22 Jan 2005 13:37:37 -0000      1.5.2.2
+++ lib/drb/unix.rb     28 Jul 2006 20:16:08 -0000
@@ -88,9 +88,13 @@
    public
    def close
      return unless @socket
-      path = @socket.path
-      @socket.close
-      File.unlink(path) if @server_mode
+      if @server_mode
+        path = @socket.path
+        @socket.close
+        File.unlink(path)
+      else
+        @socket.close
+      end
      @socket = nil
    end




Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
db.firebase.por...    text.xml.xalan....    qnx.openqnx.dev...    user-groups.zar...    internationaliz...    kde.devel.konve...    finance.e-gold....    emacs.latex.pre...    gis.therion/200...    web.webmin.gene...    yellowdog.gener...    vserver/2003-08...    redhat.release....    sysutils.tivoli...    xfree86.expert/...    mail.becky.user...    hardware.netapp...    netbsd.ports.xe...    python.distutil...    boot-loaders.gr...    culture.interne...    java.springfram...    activedir/2006-...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe