Bug #7718

test_ioctl_linux fails on PPC and PPC64

Added by Vit Ondruch about 2 years ago. Updated about 2 years ago.

[ruby-core:51544]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:ruby -v: ruby 2.0.0dev (2013-01-16 trunk 38848) [powerpc-linux] and ruby 1.9.3p362 (2012-12-25 revision 38607) [powerpc64-linux] Backport:

Description

=begin
test_ioctl_linux(TestIO) [/builddir/build/BUILD/ruby-2.0.0-r38848/test/ruby/test_io.rb:2443]:
Exception raised:
<#>.

The above mentioned test case fails on PPC and PPC64. The test case was introduced in 33716. It fails with Ruby 2.0 and Ruby 1.9.3 as well.
=end

Associated revisions

Revision 38941
Added by Motohiro KOSAKI about 2 years ago

  • test/ruby/test_io.rb (test_ioctl_linux): skip if a platform is not x86 because linux ioctl request number depend on cpu arch. At least, alpha, mips, sparc and ppc have a different number. [Bug #7718]

Revision 38941
Added by Motohiro KOSAKI about 2 years ago

  • test/ruby/test_io.rb (test_ioctl_linux): skip if a platform is not x86 because linux ioctl request number depend on cpu arch. At least, alpha, mips, sparc and ppc have a different number. [Bug #7718]

History

#1 Updated by Motohiro KOSAKI about 2 years ago

  • Status changed from Open to Feedback
  • Assignee deleted (Motohiro KOSAKI)

PPC is not supported platform. so, we need more detailed description why the issue was happen.

#2 Updated by Vit Ondruch about 2 years ago

This is the strace output if that might help:

http://paste.fedoraproject.org/2488/

#3 Updated by Motohiro KOSAKI about 2 years ago

ioctl(5, RNDGETENTCNT, 0x1001000bd40) = -1 EINVAL (Invalid argument)

Weird.
RNDGETENTCNT doesn't have returning EINVAL path.

#4 Updated by Motohiro KOSAKI about 2 years ago

Please run following program. I guess alpha, mips, sparc and ppc have different RNDGETENTCNT number against x86.


#include

main(){
printf("%lx\n", RNDGETENTCNT);
}

#5 Updated by Vit Ondruch about 2 years ago

=begin
This is the output:
# ./a.out
40045200

And here is my testing IRB session:

# irb
irb(main):001:0> File.open('/dev/urandom'){|f1|
irb(main):002:1* entropy_count = ""
irb(main):003:1> # get entropy count
irb(main):004:1* f1.ioctl(0x80045200, entropy_count)
irb(main):005:1> }
Errno::EINVAL: Invalid argument - /dev/urandom
from (irb):4:in ioctl'
from (irb):4:in
block in irb_binding'
from (irb):1:in open'
from (irb):1
from /usr/bin/irb:12:in
'
irb(main):006:0> File.open('/dev/urandom'){|f1|
irb(main):007:1* entropy_count = ""
irb(main):008:1> f1.ioctl(0x40045200, entropy_count)
irb(main):009:1> }
=> 0
irb(main):010:0>

And similar script run with strace: http://paste.fedoraproject.org/2489/
=end

#6 Updated by Koichi Sasada about 2 years ago

  • Category set to core
  • Target version set to 2.0.0

#7 Updated by Motohiro KOSAKI about 2 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r38941.
Vit, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • test/ruby/test_io.rb (test_ioctl_linux): skip if a platform is not x86 because linux ioctl request number depend on cpu arch. At least, alpha, mips, sparc and ppc have a different number. [Bug #7718]

Also available in: Atom PDF