JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-6136

Changing jnr-posix to use errno() value unconditionally has created lots of failures in windows

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.7.0.pre1
    • Fix Version/s: JRuby 1.7.4
    • Component/s: Windows
    • Labels:
      None
    • Number of attachments :
      0

      Description

      It makes sense to use the errnos() returned by the underlying OS...However on windows we get several mysterious errors. For example we get back errno 3 (ESRCH) for File::Stat.new "" instead of 2 (ENOENT). We also seem to sometimes get 20047 for stat'ing 'file:' which I suspect hits some magic windows remote server magic.

      We can elect to fix this in either JRuby or in jnr-posix. I would vote for JRuby since jnr-posix maybe should only pass what the OS wants to tell us...OTOH..it really sucks to catch different types of RaiseExceptions in any place where we call any of the stats. This only affects master so we have some time to chew on this, but it is a major blocker to getting Windows CI green again.

        Activity

        Hide
        Alexander Klimetschek added a comment -

        I get the same issue "Unknown Error (20047)" for a FileTest.directory? call with JRuby 1.7.2 on Windows Server 2008 (Enterprise R2 SP1).

        The underlying error that is hidden by this seems to be the Windows-typical "path too long" issue in this case.

        Show
        Alexander Klimetschek added a comment - I get the same issue "Unknown Error (20047)" for a FileTest.directory? call with JRuby 1.7.2 on Windows Server 2008 (Enterprise R2 SP1). The underlying error that is hidden by this seems to be the Windows-typical "path too long" issue in this case.
        Hide
        Matt Hauck added a comment -

        Any progress on this? I am running into this as well after having just upgraded from 1.6.5.1 to 1.7.3... This may be a blocker for me to upgrade...

        Show
        Matt Hauck added a comment - Any progress on this? I am running into this as well after having just upgraded from 1.6.5.1 to 1.7.3... This may be a blocker for me to upgrade...
        Hide
        Thomas E Enebo added a comment -

        This has been on my short list for a while. Right now I think I will put this on the JRuby side and have all stats go through a common method which will deal with these cases. So right now the two I know about are:

        1. stat("") -> ESRCH
        2. stat("file:/foo") -> 20047
        

        Have either of you seen any others? I am hoping this list is not so huge and I do plan on looking at MSDN to see what errors are advertised as happening. Real ones people have seen always trump over documentation listed ones...

        Show
        Thomas E Enebo added a comment - This has been on my short list for a while. Right now I think I will put this on the JRuby side and have all stats go through a common method which will deal with these cases. So right now the two I know about are: 1. stat("") -> ESRCH 2. stat("file:/foo") -> 20047 Have either of you seen any others? I am hoping this list is not so huge and I do plan on looking at MSDN to see what errors are advertised as happening. Real ones people have seen always trump over documentation listed ones...
        Hide
        Matt Hauck added a comment -

        Actually, this bug is not as significant as I had thought. I hadn't caught that this bug only hides the real cause of the error, but does not appear to introduce any new errors that would not have occurred in previous versions.

        Show
        Matt Hauck added a comment - Actually, this bug is not as significant as I had thought. I hadn't caught that this bug only hides the real cause of the error, but does not appear to introduce any new errors that would not have occurred in previous versions.
        Hide
        Thomas E Enebo added a comment -

        I updated jnr-posix to have specify which method the error was occurring from and then added specific checks for stat and lstat for the known bad values. There could be more bad values but without knowing what they are I cannot code around those. If you find a new one in the next few days then reopen this issue. If it takes longer than open up a new issue with the wrong stat() error and I will add more checks.

        Fixed in commit 947c661

        Show
        Thomas E Enebo added a comment - I updated jnr-posix to have specify which method the error was occurring from and then added specific checks for stat and lstat for the known bad values. There could be more bad values but without knowing what they are I cannot code around those. If you find a new one in the next few days then reopen this issue. If it takes longer than open up a new issue with the wrong stat() error and I will add more checks. Fixed in commit 947c661

          People

          • Assignee:
            Thomas E Enebo
            Reporter:
            Thomas E Enebo
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: