Forum: Ruby-core [ruby-trunk - Bug #8879][Open] String#to_r fails after moving ruby to other OSX system

3ec52ed58eb92026d86e62c39bdb7589?d=identicon&s=25 Michal Papis (mpapis)
on 2013-09-08 18:25
(Received via mailing list)
Issue #8879 has been reported by mpapis (Michal Papis).

----------------------------------------
Bug #8879: String#to_r fails after moving ruby to other OSX system
https://bugs.ruby-lang.org/issues/8879

Author: mpapis (Michal Papis)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674)
[x86_64-darwin12.3.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


=begin
I got reported by users (((<rvm issue
2189|URL:https://github.com/wayneeseguin/rvm/issues/2189>))) that a
static binary compiled for OSX after moving to other system fails for
the method (({String#to_r})):
 ruby -e 'puts ".8".to_r'
 0
The same binary checked on the build system produces proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Also the same version compiled from source on the target system produces
proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Please help me debug the problem, can it be related to compilation with
(({clang}))?
=end
5cf8f058a4c094bb708174fb43e7a387?d=identicon&s=25 nagachika (Tomoyuki Chikanaga) (Guest)
on 2013-09-15 14:38
(Received via mailing list)
Issue #8879 has been updated by nagachika (Tomoyuki Chikanaga).

Status changed from Open to Feedback

Hello,

I cannot reproduce this (transfer binary compiled on an environment
(darwin 12.4.0/x86_64/clang-425.0.28(based on LLVM 3.2svn)) to another
(dawrin 12.4.0/x86_64).

We need more information.
Cf) clang version, OS X version and architecture on both system,
configure options. What's happen when compiled with optimization level
(-O0) etc...

Regards.
----------------------------------------
Bug #8879: String#to_r fails after moving ruby to other OSX system
https://bugs.ruby-lang.org/issues/8879#change-41828

Author: mpapis (Michal Papis)
Status: Feedback
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674)
[x86_64-darwin12.3.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


=begin
I got reported by users (((<rvm issue
2189|URL:https://github.com/wayneeseguin/rvm/issues/2189>))) that a
static binary compiled for OSX after moving to other system fails for
the method (({String#to_r})):
 ruby -e 'puts ".8".to_r'
 0
The same binary checked on the build system produces proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Also the same version compiled from source on the target system produces
proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Please help me debug the problem, can it be related to compilation with
(({clang}))?
=end
3ec52ed58eb92026d86e62c39bdb7589?d=identicon&s=25 Michal Papis (mpapis)
on 2013-09-16 01:17
(Received via mailing list)
Issue #8879 has been updated by mpapis (Michal Papis).


can you try with this binary:
http://rvm.io/binaries/osx/10.8/x86_64/ruby-2.0.0-...

both systems are OSX 10.8.* with 64bit CPU (would different CPU matter)?

as for -O0 - wouldn't that be like super slow?

----------------------------------------
Bug #8879: String#to_r fails after moving ruby to other OSX system
https://bugs.ruby-lang.org/issues/8879#change-41842

Author: mpapis (Michal Papis)
Status: Feedback
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674)
[x86_64-darwin12.3.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


=begin
I got reported by users (((<rvm issue
2189|URL:https://github.com/wayneeseguin/rvm/issues/2189>))) that a
static binary compiled for OSX after moving to other system fails for
the method (({String#to_r})):
 ruby -e 'puts ".8".to_r'
 0
The same binary checked on the build system produces proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Also the same version compiled from source on the target system produces
proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Please help me debug the problem, can it be related to compilation with
(({clang}))?
=end
5cf8f058a4c094bb708174fb43e7a387?d=identicon&s=25 nagachika (Tomoyuki Chikanaga) (Guest)
on 2013-09-16 17:10
(Received via mailing list)
Issue #8879 has been updated by nagachika (Tomoyuki Chikanaga).


Thank you for provide the binary. I can reproduce with it.

It seems that rb_rational_new2(ZERO, ONE) in read_num() return a Fixnum
0 because canonicalization == 1.

I've found that it can be reproduced in trunk with mathn/rational.

$ ruby-trunk -r rational/math -e 'p ".8".to_r'
0

mathn/complex and mathn/rational are extension libraries and statically
linked with your binary. But mathn.rb doesn't load automatically because
it is a pure-ruby library.
Add require "mathn" fixes this problem in short.

$ ./bin/ruby -rmathn -e 'p ".8".to_r'
(4/5)

I have no idea why the problem is revealed only when the binary is
transferred to other system.
nobu, how do you think?
----------------------------------------
Bug #8879: String#to_r fails after moving ruby to other OSX system
https://bugs.ruby-lang.org/issues/8879#change-41848

Author: mpapis (Michal Papis)
Status: Feedback
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674)
[x86_64-darwin12.3.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


=begin
I got reported by users (((<rvm issue
2189|URL:https://github.com/wayneeseguin/rvm/issues/2189>))) that a
static binary compiled for OSX after moving to other system fails for
the method (({String#to_r})):
 ruby -e 'puts ".8".to_r'
 0
The same binary checked on the build system produces proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Also the same version compiled from source on the target system produces
proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Please help me debug the problem, can it be related to compilation with
(({clang}))?
=end
5cf8f058a4c094bb708174fb43e7a387?d=identicon&s=25 nagachika (Tomoyuki Chikanaga) (Guest)
on 2013-09-16 17:12
(Received via mailing list)
Issue #8879 has been updated by nagachika (Tomoyuki Chikanaga).

Status changed from Feedback to Open


----------------------------------------
Bug #8879: String#to_r fails after moving ruby to other OSX system
https://bugs.ruby-lang.org/issues/8879#change-41849

Author: mpapis (Michal Papis)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674)
[x86_64-darwin12.3.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


=begin
I got reported by users (((<rvm issue
2189|URL:https://github.com/wayneeseguin/rvm/issues/2189>))) that a
static binary compiled for OSX after moving to other system fails for
the method (({String#to_r})):
 ruby -e 'puts ".8".to_r'
 0
The same binary checked on the build system produces proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Also the same version compiled from source on the target system produces
proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Please help me debug the problem, can it be related to compilation with
(({clang}))?
=end
054b5f6b8afdd5f6190bad08e46cd782?d=identicon&s=25 zzak (Zachary Scott) (Guest)
on 2013-11-02 13:42
(Received via mailing list)
Issue #8879 has been updated by zzak (Zachary Scott).

Category set to platform/darwin
Assignee set to nobu (Nobuyoshi Nakada)


----------------------------------------
Bug #8879: String#to_r fails after moving ruby to other OSX system
https://bugs.ruby-lang.org/issues/8879#change-42729

Author: mpapis (Michal Papis)
Status: Open
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: platform/darwin
Target version:
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674)
[x86_64-darwin12.3.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


=begin
I got reported by users (((<rvm issue
2189|URL:https://github.com/wayneeseguin/rvm/issues/2189>))) that a
static binary compiled for OSX after moving to other system fails for
the method (({String#to_r})):
 ruby -e 'puts ".8".to_r'
 0
The same binary checked on the build system produces proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Also the same version compiled from source on the target system produces
proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Please help me debug the problem, can it be related to compilation with
(({clang}))?
=end
5cf8f058a4c094bb708174fb43e7a387?d=identicon&s=25 nagachika (Tomoyuki Chikanaga) (Guest)
on 2013-11-03 13:14
(Received via mailing list)
Issue #8879 has been updated by nagachika (Tomoyuki Chikanaga).

Status changed from Open to Closed

r43514 (in trunk) maybe fix this issue. Please check it.
----------------------------------------
Bug #8879: String#to_r fails after moving ruby to other OSX system
https://bugs.ruby-lang.org/issues/8879#change-42733

Author: mpapis (Michal Papis)
Status: Closed
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: platform/darwin
Target version:
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674)
[x86_64-darwin12.3.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


=begin
I got reported by users (((<rvm issue
2189|URL:https://github.com/wayneeseguin/rvm/issues/2189>))) that a
static binary compiled for OSX after moving to other system fails for
the method (({String#to_r})):
 ruby -e 'puts ".8".to_r'
 0
The same binary checked on the build system produces proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Also the same version compiled from source on the target system produces
proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Please help me debug the problem, can it be related to compilation with
(({clang}))?
=end
3ec52ed58eb92026d86e62c39bdb7589?d=identicon&s=25 Michal Papis (mpapis)
on 2013-11-10 16:26
(Received via mailing list)
Issue #8879 has been updated by mpapis (Michal Papis).


just checked and r43514 does not fix the issue, what other information
can I provide to help fix that?
----------------------------------------
Bug #8879: String#to_r fails after moving ruby to other OSX system
https://bugs.ruby-lang.org/issues/8879#change-42839

Author: mpapis (Michal Papis)
Status: Closed
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: platform/darwin
Target version:
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674)
[x86_64-darwin12.3.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


=begin
I got reported by users (((<rvm issue
2189|URL:https://github.com/wayneeseguin/rvm/issues/2189>))) that a
static binary compiled for OSX after moving to other system fails for
the method (({String#to_r})):
 ruby -e 'puts ".8".to_r'
 0
The same binary checked on the build system produces proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Also the same version compiled from source on the target system produces
proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Please help me debug the problem, can it be related to compilation with
(({clang}))?
=end
5cf8f058a4c094bb708174fb43e7a387?d=identicon&s=25 nagachika (Tomoyuki Chikanaga) (Guest)
on 2013-11-10 17:09
(Received via mailing list)
Issue #8879 has been updated by nagachika (Tomoyuki Chikanaga).

Status changed from Closed to Open


----------------------------------------
Bug #8879: String#to_r fails after moving ruby to other OSX system
https://bugs.ruby-lang.org/issues/8879#change-42844

Author: mpapis (Michal Papis)
Status: Open
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: platform/darwin
Target version:
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674)
[x86_64-darwin12.3.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


=begin
I got reported by users (((<rvm issue
2189|URL:https://github.com/wayneeseguin/rvm/issues/2189>))) that a
static binary compiled for OSX after moving to other system fails for
the method (({String#to_r})):
 ruby -e 'puts ".8".to_r'
 0
The same binary checked on the build system produces proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Also the same version compiled from source on the target system produces
proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Please help me debug the problem, can it be related to compilation with
(({clang}))?
=end
3ec52ed58eb92026d86e62c39bdb7589?d=identicon&s=25 Michal Papis (mpapis)
on 2013-11-10 19:34
(Received via mailing list)
Issue #8879 has been updated by mpapis (Michal Papis).


the latest binary with patches from r43449 and r43514 is available here
http://rvm.io/binaries/experimental/osx_106plus_ru...
all used patches:

https://github.com/wayneeseguin/rvm/blob/master/pa...
https://github.com/wayneeseguin/rvm/blob/master/pa...
https://github.com/wayneeseguin/rvm/blob/master/pa...
https://github.com/wayneeseguin/rvm/blob/master/pa...
https://github.com/wayneeseguin/rvm/blob/master/pa...
https://github.com/wayneeseguin/rvm/blob/master/pa...

----------------------------------------
Bug #8879: String#to_r fails after moving ruby to other OSX system
https://bugs.ruby-lang.org/issues/8879#change-42849

Author: mpapis (Michal Papis)
Status: Open
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: platform/darwin
Target version:
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674)
[x86_64-darwin12.3.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


=begin
I got reported by users (((<rvm issue
2189|URL:https://github.com/wayneeseguin/rvm/issues/2189>))) that a
static binary compiled for OSX after moving to other system fails for
the method (({String#to_r})):
 ruby -e 'puts ".8".to_r'
 0
The same binary checked on the build system produces proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Also the same version compiled from source on the target system produces
proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Please help me debug the problem, can it be related to compilation with
(({clang}))?
=end
5cf8f058a4c094bb708174fb43e7a387?d=identicon&s=25 nagachika (Tomoyuki Chikanaga) (Guest)
on 2013-11-11 04:36
(Received via mailing list)
Issue #8879 has been updated by nagachika (Tomoyuki Chikanaga).


Hi, thank you for your cooperation.

Hmm, it seems that 43514.patch is not applied to the given binary (from
http://rvm.io/binaries/experimental/osx_106plus_ru...).
43514.patch delete init_ext_call() from load.c but backtrace information
from lldb with the given binary report that Init_rational() is called
from init_ext_call().

(lldb) bt
* thread #1: tid = 0x53a46f, 0x0000000100247c70 ruby`Init_rational,
queue = 'com.apple.main-thread, stop reason = breakpoint 1.1
    frame #0: 0x0000000100247c70 ruby`Init_rational
    frame #1: 0x00000001002e6b78 ruby`init_ext_call + 24
    frame #2: 0x00000001003febf6 ruby`rb_vm_call_cfunc + 390
    frame #3: 0x00000001002e6b15 ruby`ruby_init_ext + 69
    frame #4: 0x000000010012934e ruby`Init_ext + 574
    frame #5: 0x00000001003907c0 ruby`require_libraries + 80
    frame #6: 0x000000010038eb22 ruby`ruby_process_options + 2338
    frame #7: 0x00000001002e23c3 ruby`ruby_options + 163
    frame #8: 0x00000001001290f7 ruby`main + 71
    frame #9: 0x0000000100000d74 ruby`start + 52

Please confirm the patch was really applied.
----------------------------------------
Bug #8879: String#to_r fails after moving ruby to other OSX system
https://bugs.ruby-lang.org/issues/8879#change-42853

Author: mpapis (Michal Papis)
Status: Open
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: platform/darwin
Target version:
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674)
[x86_64-darwin12.3.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


=begin
I got reported by users (((<rvm issue
2189|URL:https://github.com/wayneeseguin/rvm/issues/2189>))) that a
static binary compiled for OSX after moving to other system fails for
the method (({String#to_r})):
 ruby -e 'puts ".8".to_r'
 0
The same binary checked on the build system produces proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Also the same version compiled from source on the target system produces
proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Please help me debug the problem, can it be related to compilation with
(({clang}))?
=end
3ec52ed58eb92026d86e62c39bdb7589?d=identicon&s=25 Michal Papis (mpapis)
on 2013-11-11 18:03
(Received via mailing list)
Issue #8879 has been updated by mpapis (Michal Papis).


it works! the patch was broken, updated binary is available here (OSX
10.6+) http://rvm.io/binaries/osx/10.9/x86_64/ruby-2.0.0-...
----------------------------------------
Bug #8879: String#to_r fails after moving ruby to other OSX system
https://bugs.ruby-lang.org/issues/8879#change-42871

Author: mpapis (Michal Papis)
Status: Open
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: platform/darwin
Target version:
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674)
[x86_64-darwin12.3.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


=begin
I got reported by users (((<rvm issue
2189|URL:https://github.com/wayneeseguin/rvm/issues/2189>))) that a
static binary compiled for OSX after moving to other system fails for
the method (({String#to_r})):
 ruby -e 'puts ".8".to_r'
 0
The same binary checked on the build system produces proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Also the same version compiled from source on the target system produces
proper result:
 ruby -e 'puts ".8".to_r'
 4/5
Please help me debug the problem, can it be related to compilation with
(({clang}))?
=end
This topic is locked and can not be replied to.