Bug 730287

Summary: It's not possible to build ruby package
Product: Red Hat Enterprise Linux 6 Reporter: Aleš Mareček <amarecek>
Component: rubyAssignee: Vít Ondruch <vondruch>
Status: CLOSED ERRATA QA Contact: Aleš Mareček <amarecek>
Severity: high Docs Contact:
Priority: high    
Version: 6.2   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 12:08:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Aleš Mareček 2011-08-12 11:23:46 UTC
Description of problem:
I have problem with building of ruby package.

Version-Release number of selected component (if applicable):
ruby-1.8.7.352-2.el6.src

How reproducible:
Always

Steps to Reproduce:
1. As non-root user run: rpm -ivh /mnt/redhat/brewroot/packages/ruby/1.8.7.352/2.el6/src/ruby-1.8.7.352-2.el6.src.rpm
2. Build it: rpmbuild -vv -ba ~/rpmbuild/SPECS/ruby.spec
  
Actual results:
- SNIP -
gcc -shared -Wl,-soname,libruby.so.1.8   array.o bignum.o class.o compar.o dir.o dln.o enum.o enumerator.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o tracer.o util.o variable.o version.o  dmyext.o dtrace.o -lpthread -lrt -ldl -lcrypt -lm   -o libruby.so.1.8.7
/home/bah/rpmbuild/BUILD/ruby-1.8.7.352/ruby-1.8.7-p352/lib/shellwords.rb:34:in `shellwords': Argument must be a string (ArgumentError)
	from /home/bah/rpmbuild/BUILD/ruby-1.8.7.352/ruby-1.8.7-p352/lib/mkmf.rb:25
	from ./ext/extmk.rb:37:in `require'
	from ./ext/extmk.rb:37
make: *** [all] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.CuRrKU (%build)


Expected results:
Build successfully

Additional info:

Comment 1 Vít Ondruch 2011-08-12 11:33:04 UTC
It seems that we hit following error [1]. The patch is available at [2]. Unfortunately it was not merged into 1.8.7 :/


[1] https://bugs.gentoo.org/234877?id=234877
[2] http://redmine.ruby-lang.org/projects/ruby-19/repository/revisions/20587

Comment 5 Aleš Mareček 2011-08-25 14:46:03 UTC
I did some tests and I think there is some strange bug in ranging with floats.

i:i386|m:i686 bah@hp-xw4200-01 [smoke-test]# ruby -e 'a = (1.0...6.4).step(1.8).to_a; p a; p a.size'
[1.0, 2.8, 4.6, 6.4]  <--- FAIL
4
i:i386|m:i686 bah@hp-xw4200-01 [smoke-test]# ruby -e 'a = (1...6).step(1).to_a; p a; p a.size'
[1, 2, 3, 4, 5]
5
i:i386|m:i686 bah@hp-xw4200-01 [smoke-test]# ruby -e 'a = (1.0...6.4).step(1).to_a; p a; p a.size'
[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
6
i:i386|m:i686 bah@hp-xw4200-01 [smoke-test]# ruby -e 'a = (1.0...7.0).step(1).to_a; p a; p a.size'
[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
6
i:i386|m:i686 bah@hp-xw4200-01 [smoke-test]# ruby -e 'a = (1.0...7.1).step(1).to_a; p a; p a.size'
[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0]
7
i:i386|m:i686 bah@hp-xw4200-01 [smoke-test]# ruby -e 'a = (1.0...13.6).step(1.8).to_a; p a; p a.size'
[1.0, 2.8, 4.6, 6.4, 8.2, 10.0, 11.8]
7
i:i386|m:i686 bah@hp-xw4200-01 [smoke-test]# ruby -e 'a = (1.0...13.6).step(1.2).to_a; p a; p a.size'
[1.0, 2.2, 3.4, 4.6, 5.8, 7.0, 8.2, 9.4, 10.6, 11.8, 13.0]
11
i:i386|m:i686 bah@hp-xw4200-01 [smoke-test]# ruby -e 'a = (1.0...4.6).step(1.2).to_a; p a; p a.size'
[1.0, 2.2, 3.4]
3
i:i386|m:i686 bah@hp-xw4200-01 [smoke-test]# ruby -e 'a = (1.0...9.4).step(1.2).to_a; p a; p a.size'
[1.0, 2.2, 3.4, 4.6, 5.8, 7.0, 8.2, 9.4]  <--- FAIL
8
i:i386|m:i686 bah@hp-xw4200-01 [smoke-test]# ruby -e 'a = (1...8).step(1).to_a; p a; p a.size'
[1, 2, 3, 4, 5, 6, 7]
7
i:i386|m:i686 bah@hp-xw4200-01 [smoke-test]# ruby -e 'a = (1...4).step(1).to_a; p a; p a.size'
[1, 2, 3]
3

Comment 6 Aleš Mareček 2011-08-25 14:47:46 UTC
^ ruby-1.8.7.352-3

Comment 7 Aleš Mareček 2011-08-25 14:51:02 UTC
Well, it seems this issue happens only on i386.

i:ppc64|m:ppc64 root@ibm-js12-02 [~]# ruby -e 'a = (1.0...6.4).step(1.8).to_a; p a; p a.size'
[1.0, 2.8, 4.6]
3
i:ppc64|m:ppc64 root@ibm-js12-02 [~]# ruby -e 'a = (1.0...9.4).step(1.2).to_a; p a; p a.size'
[1.0, 2.2, 3.4, 4.6, 5.8, 7.0, 8.2]
7
i:ppc64|m:ppc64 root@ibm-js12-02 [~]# ruby -e 'a = (1...4).step(1).to_a; p a; p a.size'
[1, 2, 3]
3
i:ppc64|m:ppc64 root@ibm-js12-02 [~]# ruby -e 'a = (1...8).step(1).to_a; p a; p a.size'
[1, 2, 3, 4, 5, 6, 7]
7

Comment 8 Aleš Mareček 2011-08-25 15:12:07 UTC
New bug about range issue: https://bugzilla.redhat.com/show_bug.cgi?id=733372

Comment 9 Vít Ondruch 2011-08-26 09:15:54 UTC
It seems to be platform specific issue. I have tried to write reproducer in C with the same (wrong) result. The -ffloat-store might fix the issue, however the performance impact is unclear.

Similar complain was risen in Ruby Redmine [1] but the patch [2] is not worth of any action, since it fixes the consequences, no the reasons.

[1] http://redmine.ruby-lang.org/issues/4576
[2] http://redmine.ruby-lang.org/projects/ruby-19/repository/revisions/31304/diff/test/ruby/test_range.rb

Comment 13 errata-xmlrpc 2011-12-06 12:08:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2011-1581.html