Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.1RC2
-
Fix Version/s: JRuby 1.1RC3
-
Component/s: Extensions
-
Labels:None
-
Environment:OpenSolaris (snv_79b, SXDE 1/08)
-
Number of attachments :
Description
I was trying to follow http://blogs.sun.com/arungupta/entry/totd_24_getting_started_with, adjusted for RC2.
$ jruby script/server
/export/home/notroot/jruby-1.1RC2/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/core_ext/kernel/reporting.rb:26:in `silence_stderr': Permission denied (IOError)
from /export/home/notroot/jruby-1.1RC2/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/core_ext/kernel/reporting.rb:26
from /export/home/notroot/jruby-1.1RC2/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:20:in `require'
from /export/home/notroot/jruby-1.1RC2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from script/server:3
Using truss, I found that just before the Permission Denied error it tried to create /dev/null (rather than simply open it).
2856/2: open64("/dev/null", O_RDWR|O_CREAT|O_EXCL, 0666) Err#13 EACCES [ALL]
/export/home/notroot/jruby-1.1RC2/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/core_ext/kernel/reporting.rb:26:in `silence_stderr'
From open(2):
O_EXCL
If O_CREAT and O_EXCL are set, open() fails if the file
exists. The check for the existence of the file and the
creation of the file if it does not exist is atomic with
respect to other threads executing open() naming the
same filename in the same directory with O_EXCL and
O_CREAT set. If O_EXCL and O_CREAT are set, and path
names a symbolic link, open() fails and sets errno to
EEXIST, regardless of the contents of the symbolic link.
If O_EXCL is set and O_CREAT is not set, the result is
undefined.
I am starting to wonoder if the fix for this and for other /dev/null and NUL: related bugs is to revert to the NullWritableChannel we used before. I had hoped that Channels opened on /dev/null and NUL: would behave correctly, but perhaps they are not.
Mike, can you boil this down to a single piece of code that fails in JRuby and passes in regular Ruby?