Forum: Ruby-core How best to debug random ENOENT problem in 1.9.3?

Posted by "Cezary BagiƄski" <cezary.baginski@gmail.com> (Guest)
on 2012-11-19 00:04
(Received via mailing list)
Hi everyone,

I'm randomly getting ENOENTs from what looks like mem-corrupted load 
paths:

/home/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require': No such file or directory - / (Errno::ENOENT)
from
/home/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require'
from 
/home/me/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/source.rb:1:in
`<top (required)>'

RUBY VERSION: 1.9.3 (2012-11-10 patchlevel 327) [x86_64-linux]

This happens quite randomly. The "/" sometimes is is sometimes a screwed
up home directory path that looks like memory corruption.

What I did:
1. install rvm (stable) from scratch
2. install ruby-1.9.3-p327 using rvm
3. install gems using bundler

I can't think of anything reasonable other than trying ruby-1.9.3-head 
and
then bisecting... reinstalling rvm+ruby+gems from scratch every time. Or
rebuild a full-debug Ruby.

Didn't want to file a bug report without more info. Any ideas about how 
to
quickly nail this?

Sorry if it isn't a Ruby core problem. I just want to be 100% sure it 
isn't
...

- Cezary
Posted by Dan Razzell (dan_r)
on 2013-02-06 03:38
Hi Cesary.

We see this also, specific to "require" traversing more than a few
symbolic links.

It's easy to replicate by constructing a sufficiently long chain of
links, for example:

/usr/lib/ruby/1.9.1/yaml.rb ->
/tmp/fileNN -> /tmp/file03 -> /tmp/file02 -> /tmp/file01
-> /usr/lib/ruby/1.9.1/yaml.rb.orig

Then try to require "yaml".

Ruby File.realdirpath() isn't affected, therefore neither is the
underlying filesystem.  It's an implementation bug in "require".  I
haven't taken it further than that.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.