Project

General

Profile

Actions

Bug #7718

closed

test_ioctl_linux fails on PPC and PPC64

Added by vo.x (Vit Ondruch) about 11 years ago. Updated about 11 years ago.

Status:
Closed
Assignee:
-
Target version:
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:
[ruby-core:51544]

Description

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

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

Updated by kosaki (Motohiro KOSAKI) about 11 years ago

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

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

Updated by vo.x (Vit Ondruch) about 11 years ago

This is the strace output if that might help:

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

Updated by kosaki (Motohiro KOSAKI) about 11 years ago

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

Weird.
RNDGETENTCNT doesn't have returning EINVAL path.

Updated by kosaki (Motohiro KOSAKI) about 11 years ago

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


#include <linux/random.h>

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

Updated by vo.x (Vit Ondruch) about 11 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

Updated by ko1 (Koichi Sasada) about 11 years ago

  • Category set to core
  • Target version set to 2.0.0
Actions #7

Updated by kosaki (Motohiro KOSAKI) about 11 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] [ruby-core:51544]
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0