Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File.stat gives incorrect mode value on PPC platforms #2600

Closed
csebasha opened this issue Feb 16, 2015 · 6 comments
Closed

File.stat gives incorrect mode value on PPC platforms #2600

csebasha opened this issue Feb 16, 2015 · 6 comments

Comments

@csebasha
Copy link

Step1 : Create a file with permission set as 6xx. For example, 611 as below.

[testuser@linux4 test]$ touch file.txt

[testuser@linux4 test]$ chmod 611 file.txt

[testuser@linux4 test]$ ls -ltr

total 13096
-rw-r--r-- 1 testuser testuser 13406573 Feb 16 12:29 jruby.jar
-rw---x--x 1 testuser testuser 0 Feb 16 12:29 file.txt

Step2 : Get file permission using File.stat as below.

[testuser@linux4 test]$ java -showversion -jar jruby.jar -e 'p File.stat("file.txt")'

java version "1.7.0"
Java(TM) SE Runtime Environment (build pxp6470sr9-20150209_05(SR9))
IBM J9 VM (build 2.6, JRE 1.7.0 Linux ppc64-64 Compressed References 20150206_234339 (JIT enabled, AOT enabled)
J9VM - R26_jvm.26_20150206_0405_B234339
JIT - r11_20150206_1213_foreman
GC - R26_jvm.26_20150206_0405_B234339_CMPRSS
J9CL - 20150206_234339)
JCL - 20150112_01 based on Oracle 7u75-b12

File::Stat dev=0x, ino=0, mode=0100644, nlink=, uid=-1, gid=, rdev=0x, size=0, blksize=4096, blocks=, atime=2015-02-16 12:29:30 +0530, mtime=2015-02-16 12:29:30 +0530, ctime=2015-02-16 12:29:30 +0530

Note: Modes are getting displayed correctly on Linux AMD and IA32 platforms.

@csebasha csebasha reopened this Feb 16, 2015
@csebasha
Copy link
Author

Tested jruby version is 1.7.19 as well as 1.7.0

@headius
Copy link
Member

headius commented Mar 12, 2015

Can you try a build of JRuby 1.7.20 or JRuby 9k.pre2 (or HEAD of either branch)? We've recently updated our PPC64 support for native features, and it's possible this is working now.

@headius
Copy link
Member

headius commented Mar 12, 2015

Optimistically marking as fixed, since we added PPC64 support recently and the old pure-Java version was likely to cause for bogus stat results.

@csebasha
Copy link
Author

Downloaded 1.7.20 build from https://oss.sonatype.org/content/repositories/snapshots/org/jruby/jruby-complete/1.7.20-SNAPSHOT/
Problem is still seen. Below are the steps followed.

testuser@testmachine:~> ls -ltr
total 54756
-rw---x--x 1 testuser test 0 Mar 14 02:59 file.txt
-rwxrwxrwx 1 testuser test 23174543 Mar 14 03:19 jruby-complete-1.7.20-20150304.132514-1.jar

testuser@testmachine:~> java -showversion -jar jruby-complete-1.7.20-20150304.132514-1.jar -e 'p File.stat("file.txt")'
java version "1.7.0"
Java(TM) SE Runtime Environment (build pxp6470sr9-20150227_01(SR9))
IBM J9 VM (build 2.6, JRE 1.7.0 Linux ppc64-64 Compressed References 20150226_237101 (JIT enabled, AOT enabled)
J9VM - R26_jvm.26_20150226_0435_B237101
JIT - r11_20150226_1147_foreman
GC - R26_jvm.26_20150226_0435_B237101_CMPRSS
J9CL - 20150226_237101)
JCL - 20150224_01 based on Oracle 7u79-b08

Mar 14, 2015 3:23:26 AM jnr.ffi.provider.jffi.NativeRuntime buildNativeTypeAliases
SEVERE: failed to load type aliases: java.lang.ClassNotFoundException: jnr.ffi.provider.jffi.platform.ppc64.linux.TypeAliases
#<File::Stat dev=0x, ino=0, mode=0100644, nlink=, uid=-1, gid=, rdev=0x, size=0, blksize=4096, blocks=, atime=2015-03-14 02:59:53 +0000, mtime=2015-03-14 02:59:53 +0000, ctime=2015-03-14 03:20:13 +0000>

@csebasha
Copy link
Author

<File::Stat dev=0x, ino=0, mode=0100644, nlink=, uid=-1, gid=, rdev=0x, size=0, blksize=4096, blocks=, atime=2015-03-14 02:59:53 +0000, mtime=2015-03-14 02:59:53 +0000, ctime=2015-03-14 03:20:13 +0000>

@csebasha
Copy link
Author

File::Stat dev=0x, ino=0, mode=0100644, nlink=, uid=-1, gid=, rdev=0x, size=0, blksize=4096, etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants