ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:76256] [Ruby trunk Bug#12551] Exception accessing file with long path on windows
       [not found] <redmine.issue-12551.20160704150637@ruby-lang.org>
@ 2016-07-04 15:06 ` lars.benner
  2016-11-08  6:13 ` [ruby-core:78047] " headius
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: lars.benner @ 2016-07-04 15:06 UTC (permalink / raw
  To: ruby-core

Issue #12551 has been reported by Lars Benner.

----------------------------------------
Bug #12551: Exception accessing file with long path on windows
https://bugs.ruby-lang.org/issues/12551

* Author: Lars Benner
* Status: Open
* Priority: Normal
* Assignee: Usaku NAKAMURA
* ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw32]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Accessing file with a long file name causes this exception:

C:/Projects/Head/Build/cm/testdir01/testdir02/testdir03/testdir04/testdir05/testdir06/testdir07/testdir08/testdir09/testdir10/testdir11/testdir12/testdir13/testdir14/testdir15/testdir16/testdir17/testdir18/testdir19/testdir20/testdir21/testdir22/longtestfile.name.txt
repro_lstat_exception.rb:42:in `stat': No such file or directory @ rb_file_s_stat - C:/Projects/Head/Build/cm/testdir01/testdir02/testdir03/testdir04/testdir05/testdir06/testdir07/testdir08/testdir09/testdir10/testdir11/testdir12/testdir13/testdir14/testdir15/testdir16/testdir17/testdir18/testdir19/testdir20/testdir21/testdir22/longtestfile.name.txt (Errno::ENOENT)
        from repro_lstat_exception.rb:42:in `block in <main>'
        from repro_lstat_exception.rb:13:in `chdir'
        from repro_lstat_exception.rb:13:in `<main>'

Can be reproduced with the attach script.

I used windows 7 64 bit and an NTFS file system. 

For me it looks like, it has something to do with the legacy MAX_PATH_LENGTH of 260 characters. See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath for more information. 

Originally I discovered the bug with JRuby (https://github.com/jruby/jruby/issues/3995).

With older Ruby version, I tried 1.8.5, it is working.



---Files--------------------------------
long_file_name_error.zip (10.7 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:78047] [Ruby trunk Bug#12551] Exception accessing file with long path on windows
       [not found] <redmine.issue-12551.20160704150637@ruby-lang.org>
  2016-07-04 15:06 ` [ruby-core:76256] [Ruby trunk Bug#12551] Exception accessing file with long path on windows lars.benner
@ 2016-11-08  6:13 ` headius
  2016-12-21  6:04 ` [ruby-core:78755] [Ruby trunk Bug#12551][Assigned] " shyouhei
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: headius @ 2016-11-08  6:13 UTC (permalink / raw
  To: ruby-core

Issue #12551 has been updated by Charles Nutter.


FYI, the JRuby issue is waiting on a decision from MRI about how to handle this.

----------------------------------------
Bug #12551: Exception accessing file with long path on windows
https://bugs.ruby-lang.org/issues/12551#change-61400

* Author: Lars Benner
* Status: Open
* Priority: Normal
* Assignee: Usaku NAKAMURA
* ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw32]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Accessing file with a long file name causes this exception:

C:/Projects/Head/Build/cm/testdir01/testdir02/testdir03/testdir04/testdir05/testdir06/testdir07/testdir08/testdir09/testdir10/testdir11/testdir12/testdir13/testdir14/testdir15/testdir16/testdir17/testdir18/testdir19/testdir20/testdir21/testdir22/longtestfile.name.txt
repro_lstat_exception.rb:42:in `stat': No such file or directory @ rb_file_s_stat - C:/Projects/Head/Build/cm/testdir01/testdir02/testdir03/testdir04/testdir05/testdir06/testdir07/testdir08/testdir09/testdir10/testdir11/testdir12/testdir13/testdir14/testdir15/testdir16/testdir17/testdir18/testdir19/testdir20/testdir21/testdir22/longtestfile.name.txt (Errno::ENOENT)
        from repro_lstat_exception.rb:42:in `block in <main>'
        from repro_lstat_exception.rb:13:in `chdir'
        from repro_lstat_exception.rb:13:in `<main>'

Can be reproduced with the attach script.

I used windows 7 64 bit and an NTFS file system. 

For me it looks like, it has something to do with the legacy MAX_PATH_LENGTH of 260 characters. See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath for more information. 

Originally I discovered the bug with JRuby (https://github.com/jruby/jruby/issues/3995).

With older Ruby version, I tried 1.8.5, it is working.



---Files--------------------------------
long_file_name_error.zip (10.7 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:78755] [Ruby trunk Bug#12551][Assigned] Exception accessing file with long path on windows
       [not found] <redmine.issue-12551.20160704150637@ruby-lang.org>
  2016-07-04 15:06 ` [ruby-core:76256] [Ruby trunk Bug#12551] Exception accessing file with long path on windows lars.benner
  2016-11-08  6:13 ` [ruby-core:78047] " headius
@ 2016-12-21  6:04 ` shyouhei
  2016-12-21  7:38 ` [ruby-core:78765] [Ruby trunk Bug#12551] " usa
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: shyouhei @ 2016-12-21  6:04 UTC (permalink / raw
  To: ruby-core

Issue #12551 has been updated by Shyouhei Urabe.

Status changed from Open to Assigned

----------------------------------------
Bug #12551: Exception accessing file with long path on windows
https://bugs.ruby-lang.org/issues/12551#change-62153

* Author: Lars Benner
* Status: Assigned
* Priority: Normal
* Assignee: Usaku NAKAMURA
* Target version: 
* ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw32]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Accessing file with a long file name causes this exception:

C:/Projects/Head/Build/cm/testdir01/testdir02/testdir03/testdir04/testdir05/testdir06/testdir07/testdir08/testdir09/testdir10/testdir11/testdir12/testdir13/testdir14/testdir15/testdir16/testdir17/testdir18/testdir19/testdir20/testdir21/testdir22/longtestfile.name.txt
repro_lstat_exception.rb:42:in `stat': No such file or directory @ rb_file_s_stat - C:/Projects/Head/Build/cm/testdir01/testdir02/testdir03/testdir04/testdir05/testdir06/testdir07/testdir08/testdir09/testdir10/testdir11/testdir12/testdir13/testdir14/testdir15/testdir16/testdir17/testdir18/testdir19/testdir20/testdir21/testdir22/longtestfile.name.txt (Errno::ENOENT)
        from repro_lstat_exception.rb:42:in `block in <main>'
        from repro_lstat_exception.rb:13:in `chdir'
        from repro_lstat_exception.rb:13:in `<main>'

Can be reproduced with the attach script.

I used windows 7 64 bit and an NTFS file system. 

For me it looks like, it has something to do with the legacy MAX_PATH_LENGTH of 260 characters. See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath for more information. 

Originally I discovered the bug with JRuby (https://github.com/jruby/jruby/issues/3995).

With older Ruby version, I tried 1.8.5, it is working.



---Files--------------------------------
long_file_name_error.zip (10.7 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:78765] [Ruby trunk Bug#12551] Exception accessing file with long path on windows
       [not found] <redmine.issue-12551.20160704150637@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2016-12-21  6:04 ` [ruby-core:78755] [Ruby trunk Bug#12551][Assigned] " shyouhei
@ 2016-12-21  7:38 ` usa
  2018-03-26 11:30 ` [ruby-core:86302] " preetpal.sohal
  2018-03-26 20:18 ` [ruby-core:86310] " shevegen
  5 siblings, 0 replies; 6+ messages in thread
From: usa @ 2016-12-21  7:38 UTC (permalink / raw
  To: ruby-core

Issue #12551 has been updated by Usaku NAKAMURA.


Sorry for late reply.

It's too difficult to get rid of the limitation of `MAX_PATH`,
because many OS API and system functions in C runtime depend on it.

OS API can handle long path with `\\?\` prefix, but when using this prefix,
the rest must be an absolute path.
Ruby cannot guarantee that a path passed by a user is an absolute path,
so we cannot use this trick at all times.

----------------------------------------
Bug #12551: Exception accessing file with long path on windows
https://bugs.ruby-lang.org/issues/12551#change-62166

* Author: Lars Benner
* Status: Assigned
* Priority: Normal
* Assignee: Usaku NAKAMURA
* Target version: 
* ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw32]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Accessing file with a long file name causes this exception:

C:/Projects/Head/Build/cm/testdir01/testdir02/testdir03/testdir04/testdir05/testdir06/testdir07/testdir08/testdir09/testdir10/testdir11/testdir12/testdir13/testdir14/testdir15/testdir16/testdir17/testdir18/testdir19/testdir20/testdir21/testdir22/longtestfile.name.txt
repro_lstat_exception.rb:42:in `stat': No such file or directory @ rb_file_s_stat - C:/Projects/Head/Build/cm/testdir01/testdir02/testdir03/testdir04/testdir05/testdir06/testdir07/testdir08/testdir09/testdir10/testdir11/testdir12/testdir13/testdir14/testdir15/testdir16/testdir17/testdir18/testdir19/testdir20/testdir21/testdir22/longtestfile.name.txt (Errno::ENOENT)
        from repro_lstat_exception.rb:42:in `block in <main>'
        from repro_lstat_exception.rb:13:in `chdir'
        from repro_lstat_exception.rb:13:in `<main>'

Can be reproduced with the attach script.

I used windows 7 64 bit and an NTFS file system. 

For me it looks like, it has something to do with the legacy MAX_PATH_LENGTH of 260 characters. See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath for more information. 

Originally I discovered the bug with JRuby (https://github.com/jruby/jruby/issues/3995).

With older Ruby version, I tried 1.8.5, it is working.



---Files--------------------------------
long_file_name_error.zip (10.7 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:86302] [Ruby trunk Bug#12551] Exception accessing file with long path on windows
       [not found] <redmine.issue-12551.20160704150637@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2016-12-21  7:38 ` [ruby-core:78765] [Ruby trunk Bug#12551] " usa
@ 2018-03-26 11:30 ` preetpal.sohal
  2018-03-26 20:18 ` [ruby-core:86310] " shevegen
  5 siblings, 0 replies; 6+ messages in thread
From: preetpal.sohal @ 2018-03-26 11:30 UTC (permalink / raw
  To: ruby-core

Issue #12551 has been updated by preetpalS (Preetpal Sohal).


usa (Usaku NAKAMURA) wrote:
> It's too difficult to get rid of the limitation of `MAX_PATH`,
> because many OS API and system functions in C runtime depend on it.
> 
> OS API can handle long path with `\\?\` prefix, but when using this prefix,
> the rest must be an absolute path.
> Ruby cannot guarantee that a path passed by a user is an absolute path,
> so we cannot use this trick at all times.

Python 3.6.2 (64 bits) is able to handle really long paths even when supplied relative paths. I'm not sure how Python is able to do this but its approach might be relevant to solving this issue.

~~~ python
import os

i = 1
pathToCreate = "python_long_relative_path_stress_test\\" + str(i)
while i < 1000:
  try:
    i = i + 1
    pathToCreate = pathToCreate + "\\" + str(i)
    os.makedirs(pathToCreate)
  except:
    print("Failed to create folder:")
    print(len(os.path.abspath(pathToCreate)))
    exit(1)

print("Could create path of size (using relative paths):")
print(len(os.path.abspath(pathToCreate)))
~~~


----------------------------------------
Bug #12551: Exception accessing file with long path on windows
https://bugs.ruby-lang.org/issues/12551#change-71220

* Author: Maturin (Lars Benner)
* Status: Assigned
* Priority: Normal
* Assignee: usa (Usaku NAKAMURA)
* Target version: 
* ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw32]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Accessing file with a long file name causes this exception:

C:/Projects/Head/Build/cm/testdir01/testdir02/testdir03/testdir04/testdir05/testdir06/testdir07/testdir08/testdir09/testdir10/testdir11/testdir12/testdir13/testdir14/testdir15/testdir16/testdir17/testdir18/testdir19/testdir20/testdir21/testdir22/longtestfile.name.txt
repro_lstat_exception.rb:42:in `stat': No such file or directory @ rb_file_s_stat - C:/Projects/Head/Build/cm/testdir01/testdir02/testdir03/testdir04/testdir05/testdir06/testdir07/testdir08/testdir09/testdir10/testdir11/testdir12/testdir13/testdir14/testdir15/testdir16/testdir17/testdir18/testdir19/testdir20/testdir21/testdir22/longtestfile.name.txt (Errno::ENOENT)
        from repro_lstat_exception.rb:42:in `block in <main>'
        from repro_lstat_exception.rb:13:in `chdir'
        from repro_lstat_exception.rb:13:in `<main>'

Can be reproduced with the attach script.

I used windows 7 64 bit and an NTFS file system. 

For me it looks like, it has something to do with the legacy MAX_PATH_LENGTH of 260 characters. See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath for more information. 

Originally I discovered the bug with JRuby (https://github.com/jruby/jruby/issues/3995).

With older Ruby version, I tried 1.8.5, it is working.



---Files--------------------------------
long_file_name_error.zip (10.7 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:86310] [Ruby trunk Bug#12551] Exception accessing file with long path on windows
       [not found] <redmine.issue-12551.20160704150637@ruby-lang.org>
                   ` (4 preceding siblings ...)
  2018-03-26 11:30 ` [ruby-core:86302] " preetpal.sohal
@ 2018-03-26 20:18 ` shevegen
  5 siblings, 0 replies; 6+ messages in thread
From: shevegen @ 2018-03-26 20:18 UTC (permalink / raw
  To: ruby-core

Issue #12551 has been updated by shevegen (Robert A. Heiler).


I guess if python can do it, ruby will support it as well eventually. :-)

I wish I could help more but my C knowledge is so limited compared
to my knowledge in ruby (and I use linix almost all of the time
rather than windows).

----------------------------------------
Bug #12551: Exception accessing file with long path on windows
https://bugs.ruby-lang.org/issues/12551#change-71229

* Author: Maturin (Lars Benner)
* Status: Assigned
* Priority: Normal
* Assignee: usa (Usaku NAKAMURA)
* Target version: 
* ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw32]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Accessing file with a long file name causes this exception:

C:/Projects/Head/Build/cm/testdir01/testdir02/testdir03/testdir04/testdir05/testdir06/testdir07/testdir08/testdir09/testdir10/testdir11/testdir12/testdir13/testdir14/testdir15/testdir16/testdir17/testdir18/testdir19/testdir20/testdir21/testdir22/longtestfile.name.txt
repro_lstat_exception.rb:42:in `stat': No such file or directory @ rb_file_s_stat - C:/Projects/Head/Build/cm/testdir01/testdir02/testdir03/testdir04/testdir05/testdir06/testdir07/testdir08/testdir09/testdir10/testdir11/testdir12/testdir13/testdir14/testdir15/testdir16/testdir17/testdir18/testdir19/testdir20/testdir21/testdir22/longtestfile.name.txt (Errno::ENOENT)
        from repro_lstat_exception.rb:42:in `block in <main>'
        from repro_lstat_exception.rb:13:in `chdir'
        from repro_lstat_exception.rb:13:in `<main>'

Can be reproduced with the attach script.

I used windows 7 64 bit and an NTFS file system. 

For me it looks like, it has something to do with the legacy MAX_PATH_LENGTH of 260 characters. See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath for more information. 

Originally I discovered the bug with JRuby (https://github.com/jruby/jruby/issues/3995).

With older Ruby version, I tried 1.8.5, it is working.



---Files--------------------------------
long_file_name_error.zip (10.7 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-26 20:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-12551.20160704150637@ruby-lang.org>
2016-07-04 15:06 ` [ruby-core:76256] [Ruby trunk Bug#12551] Exception accessing file with long path on windows lars.benner
2016-11-08  6:13 ` [ruby-core:78047] " headius
2016-12-21  6:04 ` [ruby-core:78755] [Ruby trunk Bug#12551][Assigned] " shyouhei
2016-12-21  7:38 ` [ruby-core:78765] [Ruby trunk Bug#12551] " usa
2018-03-26 11:30 ` [ruby-core:86302] " preetpal.sohal
2018-03-26 20:18 ` [ruby-core:86310] " shevegen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).