Project

General

Profile

Bug #10037

Since r46798 on Solaris, "[BUG] rb_vm_get_cref: unreachable" during make

Added by ngoto (Naohisa Goto) over 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.2.0dev (2014-07-13) [sparc64-solaris2.10]
[ruby-core:63721]

Description

Since r46798, failed to build on Solaris 10 running on SPARC64.

(snip)
converter from WINDOWS-874 to UTF-8
converter from UTF-8 to WINDOWS-874
enc/trans/single_byte.trans:22: [BUG] rb_vm_get_cref: unreachable
ruby 2.2.0dev (2014-07-13) [sparc64-solaris2.10]

-- Control frame information -----------------------------------------------
c:0008 p:---- s:0056 e:000053 TOP    [FINISH]
c:0007 p:---- s:0052 e:000051 CFUNC  :require
c:0006 p:0015 s:0048 e:000047 METHOD enc/trans/single_byte.trans:22
c:0005 p:0244 s:0041 E:0011d8 EVAL   enc/trans/single_byte.trans:48 [FINISH]
c:0004 p:---- s:0037 e:000036 CFUNC  :eval
c:0003 p:0045 s:0030 e:000029 METHOD /XXXXXXXXXX/lib/erb.rb:850
c:0002 p:1228 s:0026 E:000cf8 EVAL   ./tool/transcode-tblgen.rb:1043 [FINISH]
c:0001 p:0000 s:0002 E:001d68 TOP    [FINISH]

-- Ruby level backtrace information ----------------------------------------
./tool/transcode-tblgen.rb:1043:in `<main>'
/XXXXXXXXXX/lib/erb.rb:850:in `result'
/XXXXXXXXXX/lib/erb.rb:850:in `eval'
enc/trans/single_byte.trans:48:in `<main>'
enc/trans/single_byte.trans:22:in `transcode_tblgen_singlebyte'
enc/trans/single_byte.trans:22:in `require'
/XXXXXXXXXX/enc/trans/windows-1250-tbl.rb:1:in `<top (required)>'

-- Other runtime information -----------------------------------------------

* Loaded script: ./tool/transcode-tblgen.rb

* Loaded features:

    0 enumerator.so
    1 /XXXXXXXXXX/lib/optparse.rb
    2 /XXXXXXXXXX/lib/cgi/util.rb
    3 /XXXXXXXXXX/lib/erb.rb
    4 /XXXXXXXXXX/lib/fileutils.rb
    5 /XXXXXXXXXX/lib/prettyprint.rb
    6 /XXXXXXXXXX/lib/pp.rb
    7 /XXXXXXXXXX/enc/trans/iso-8859-1-tbl.rb
    8 /XXXXXXXXXX/enc/trans/iso-8859-2-tbl.rb
    9 /XXXXXXXXXX/enc/trans/iso-8859-3-tbl.rb
   10 /XXXXXXXXXX/enc/trans/iso-8859-4-tbl.rb
   11 /XXXXXXXXXX/enc/trans/iso-8859-5-tbl.rb
   12 /XXXXXXXXXX/enc/trans/iso-8859-6-tbl.rb
   13 /XXXXXXXXXX/enc/trans/iso-8859-7-tbl.rb
   14 /XXXXXXXXXX/enc/trans/iso-8859-8-tbl.rb
   15 /XXXXXXXXXX/enc/trans/iso-8859-9-tbl.rb
   16 /XXXXXXXXXX/enc/trans/iso-8859-10-tbl.rb
   17 /XXXXXXXXXX/enc/trans/iso-8859-11-tbl.rb
   18 /XXXXXXXXXX/enc/trans/iso-8859-13-tbl.rb
   19 /XXXXXXXXXX/enc/trans/iso-8859-14-tbl.rb
   20 /XXXXXXXXXX/enc/trans/iso-8859-15-tbl.rb
   21 /XXXXXXXXXX/enc/trans/iso-8859-16-tbl.rb
   22 /XXXXXXXXXX/enc/trans/windows-874-tbl.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Abort
make[1]: *** [enc/trans/single_byte.c] Error 134
make[1]: Leaving directory `/XXXXXXXXXX'
make: *** [srcs-enc] Error 2

The following patch fixed the problem (tested with r46821), but this completely breaks the benefit of r46798.

Index: vm_core.h
===================================================================
--- vm_core.h   (revision 46821)
+++ vm_core.h   (working copy)
@@ -205,6 +205,7 @@
        ISEQ_TYPE_MAIN,
        ISEQ_TYPE_DEFINED_GUARD
     } type;              /* instruction sequence type */
+    uint32_t dummy;
     uint32_t stack_max; /* for stack overflow check */

     rb_iseq_location_t location;

I think it is possbile that the first 8 byte (in 64-bit architecture) of "struct rb_iseq_struct" is sometimes used for some other purposes (maybe VALUE ?), and on big-endian 64-bit architecture (including SPARC64), it is frequently misunderstood as the other type.

By the way, I think "int stack_max" is better than "uint32_t stack_max" because it seems that all calculations of stack_max in compile.c(iseq_set_sequence) and vm_insnhelper.c(vm_push_frame) are conducted using int.


Related issues

Related to Ruby master - Bug #11219: bootstrap test failed on sparc Solaris since r50743ClosedActions

Associated revisions

Revision e4198a73
Added by ko1 (Koichi Sasada) over 4 years ago

  • make rb_iseq_t T_IMEMO object (type is imemo_iseq). All contents of previous rb_iseq_t is in rb_iseq_t::body. Remove rb_iseq_t::self because rb_iseq_t is an object. RubyVM::InstructionSequence is wrapper object points T_IMEMO/iseq. So RubyVM::ISeq.of(something) method returns different wrapper objects but they point the same T_IMEMO/iseq object. This patch is big, but most of difference is replacement of iseq->xxx to iseq->body->xxx. (previous) rb_iseq_t::compile_data is also located to rb_iseq_t::compile_data. It was moved from rb_iseq_body::compile_data. Now rb_iseq_t has empty two pointers. I will split rb_iseq_body data into static data and dynamic data.
  • compile.c: rename some functions/macros. Now, we don't need to separate iseq and iseqval (only VALUE).
  • eval.c (ruby_exec_internal): `n' is rb_iseq_t (T_IMEMO/iseq).
  • ext/objspace/objspace.c (count_imemo_objects): count T_IMEMO/iseq.
  • gc.c: check T_IMEMO/iseq.
  • internal.h: add imemo_type::imemo_iseq.
  • iseq.c: define RubyVM::InstructionSequnce as T_OBJECT. Methods are implemented by functions named iseqw_....
  • load.c (rb_load_internal0): rb_iseq_new_top() returns rb_iseq_t (T_IMEMO/iesq).
  • method.h (rb_add_method_iseq): accept rb_iseq_t (T_IMEMO/iseq).
  • vm_core.h (GetISeqPtr): removed because it is not T_DATA now.
  • vm_core.h (struct rb_iseq_body): remove padding for [Bug #10037][ruby-core:63721].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 51327
Added by ko1 (Koichi Sasada) over 4 years ago

  • make rb_iseq_t T_IMEMO object (type is imemo_iseq). All contents of previous rb_iseq_t is in rb_iseq_t::body. Remove rb_iseq_t::self because rb_iseq_t is an object. RubyVM::InstructionSequence is wrapper object points T_IMEMO/iseq. So RubyVM::ISeq.of(something) method returns different wrapper objects but they point the same T_IMEMO/iseq object. This patch is big, but most of difference is replacement of iseq->xxx to iseq->body->xxx. (previous) rb_iseq_t::compile_data is also located to rb_iseq_t::compile_data. It was moved from rb_iseq_body::compile_data. Now rb_iseq_t has empty two pointers. I will split rb_iseq_body data into static data and dynamic data.
  • compile.c: rename some functions/macros. Now, we don't need to separate iseq and iseqval (only VALUE).
  • eval.c (ruby_exec_internal): `n' is rb_iseq_t (T_IMEMO/iseq).
  • ext/objspace/objspace.c (count_imemo_objects): count T_IMEMO/iseq.
  • gc.c: check T_IMEMO/iseq.
  • internal.h: add imemo_type::imemo_iseq.
  • iseq.c: define RubyVM::InstructionSequnce as T_OBJECT. Methods are implemented by functions named iseqw_....
  • load.c (rb_load_internal0): rb_iseq_new_top() returns rb_iseq_t (T_IMEMO/iesq).
  • method.h (rb_add_method_iseq): accept rb_iseq_t (T_IMEMO/iseq).
  • vm_core.h (GetISeqPtr): removed because it is not T_DATA now.
  • vm_core.h (struct rb_iseq_body): remove padding for [Bug #10037][ruby-core:63721].

Revision 51327
Added by ko1 (Koichi Sasada) over 4 years ago

  • make rb_iseq_t T_IMEMO object (type is imemo_iseq). All contents of previous rb_iseq_t is in rb_iseq_t::body. Remove rb_iseq_t::self because rb_iseq_t is an object. RubyVM::InstructionSequence is wrapper object points T_IMEMO/iseq. So RubyVM::ISeq.of(something) method returns different wrapper objects but they point the same T_IMEMO/iseq object. This patch is big, but most of difference is replacement of iseq->xxx to iseq->body->xxx. (previous) rb_iseq_t::compile_data is also located to rb_iseq_t::compile_data. It was moved from rb_iseq_body::compile_data. Now rb_iseq_t has empty two pointers. I will split rb_iseq_body data into static data and dynamic data.
  • compile.c: rename some functions/macros. Now, we don't need to separate iseq and iseqval (only VALUE).
  • eval.c (ruby_exec_internal): `n' is rb_iseq_t (T_IMEMO/iseq).
  • ext/objspace/objspace.c (count_imemo_objects): count T_IMEMO/iseq.
  • gc.c: check T_IMEMO/iseq.
  • internal.h: add imemo_type::imemo_iseq.
  • iseq.c: define RubyVM::InstructionSequnce as T_OBJECT. Methods are implemented by functions named iseqw_....
  • load.c (rb_load_internal0): rb_iseq_new_top() returns rb_iseq_t (T_IMEMO/iesq).
  • method.h (rb_add_method_iseq): accept rb_iseq_t (T_IMEMO/iseq).
  • vm_core.h (GetISeqPtr): removed because it is not T_DATA now.
  • vm_core.h (struct rb_iseq_body): remove padding for [Bug #10037][ruby-core:63721].

Revision 51327
Added by ko1 (Koichi Sasada) over 4 years ago

  • make rb_iseq_t T_IMEMO object (type is imemo_iseq). All contents of previous rb_iseq_t is in rb_iseq_t::body. Remove rb_iseq_t::self because rb_iseq_t is an object. RubyVM::InstructionSequence is wrapper object points T_IMEMO/iseq. So RubyVM::ISeq.of(something) method returns different wrapper objects but they point the same T_IMEMO/iseq object. This patch is big, but most of difference is replacement of iseq->xxx to iseq->body->xxx. (previous) rb_iseq_t::compile_data is also located to rb_iseq_t::compile_data. It was moved from rb_iseq_body::compile_data. Now rb_iseq_t has empty two pointers. I will split rb_iseq_body data into static data and dynamic data.
  • compile.c: rename some functions/macros. Now, we don't need to separate iseq and iseqval (only VALUE).
  • eval.c (ruby_exec_internal): `n' is rb_iseq_t (T_IMEMO/iseq).
  • ext/objspace/objspace.c (count_imemo_objects): count T_IMEMO/iseq.
  • gc.c: check T_IMEMO/iseq.
  • internal.h: add imemo_type::imemo_iseq.
  • iseq.c: define RubyVM::InstructionSequnce as T_OBJECT. Methods are implemented by functions named iseqw_....
  • load.c (rb_load_internal0): rb_iseq_new_top() returns rb_iseq_t (T_IMEMO/iesq).
  • method.h (rb_add_method_iseq): accept rb_iseq_t (T_IMEMO/iseq).
  • vm_core.h (GetISeqPtr): removed because it is not T_DATA now.
  • vm_core.h (struct rb_iseq_body): remove padding for [Bug #10037][ruby-core:63721].

Revision 51327
Added by ko1 (Koichi Sasada) over 4 years ago

  • make rb_iseq_t T_IMEMO object (type is imemo_iseq). All contents of previous rb_iseq_t is in rb_iseq_t::body. Remove rb_iseq_t::self because rb_iseq_t is an object. RubyVM::InstructionSequence is wrapper object points T_IMEMO/iseq. So RubyVM::ISeq.of(something) method returns different wrapper objects but they point the same T_IMEMO/iseq object. This patch is big, but most of difference is replacement of iseq->xxx to iseq->body->xxx. (previous) rb_iseq_t::compile_data is also located to rb_iseq_t::compile_data. It was moved from rb_iseq_body::compile_data. Now rb_iseq_t has empty two pointers. I will split rb_iseq_body data into static data and dynamic data.
  • compile.c: rename some functions/macros. Now, we don't need to separate iseq and iseqval (only VALUE).
  • eval.c (ruby_exec_internal): `n' is rb_iseq_t (T_IMEMO/iseq).
  • ext/objspace/objspace.c (count_imemo_objects): count T_IMEMO/iseq.
  • gc.c: check T_IMEMO/iseq.
  • internal.h: add imemo_type::imemo_iseq.
  • iseq.c: define RubyVM::InstructionSequnce as T_OBJECT. Methods are implemented by functions named iseqw_....
  • load.c (rb_load_internal0): rb_iseq_new_top() returns rb_iseq_t (T_IMEMO/iesq).
  • method.h (rb_add_method_iseq): accept rb_iseq_t (T_IMEMO/iseq).
  • vm_core.h (GetISeqPtr): removed because it is not T_DATA now.
  • vm_core.h (struct rb_iseq_body): remove padding for [Bug #10037][ruby-core:63721].

Revision 51327
Added by ko1 (Koichi Sasada) over 4 years ago

  • make rb_iseq_t T_IMEMO object (type is imemo_iseq). All contents of previous rb_iseq_t is in rb_iseq_t::body. Remove rb_iseq_t::self because rb_iseq_t is an object. RubyVM::InstructionSequence is wrapper object points T_IMEMO/iseq. So RubyVM::ISeq.of(something) method returns different wrapper objects but they point the same T_IMEMO/iseq object. This patch is big, but most of difference is replacement of iseq->xxx to iseq->body->xxx. (previous) rb_iseq_t::compile_data is also located to rb_iseq_t::compile_data. It was moved from rb_iseq_body::compile_data. Now rb_iseq_t has empty two pointers. I will split rb_iseq_body data into static data and dynamic data.
  • compile.c: rename some functions/macros. Now, we don't need to separate iseq and iseqval (only VALUE).
  • eval.c (ruby_exec_internal): `n' is rb_iseq_t (T_IMEMO/iseq).
  • ext/objspace/objspace.c (count_imemo_objects): count T_IMEMO/iseq.
  • gc.c: check T_IMEMO/iseq.
  • internal.h: add imemo_type::imemo_iseq.
  • iseq.c: define RubyVM::InstructionSequnce as T_OBJECT. Methods are implemented by functions named iseqw_....
  • load.c (rb_load_internal0): rb_iseq_new_top() returns rb_iseq_t (T_IMEMO/iesq).
  • method.h (rb_add_method_iseq): accept rb_iseq_t (T_IMEMO/iseq).
  • vm_core.h (GetISeqPtr): removed because it is not T_DATA now.
  • vm_core.h (struct rb_iseq_body): remove padding for [Bug #10037][ruby-core:63721].

History

Updated by normalperson (Eric Wong) over 5 years ago

ngotogenome@gmail.com wrote:

I think it is possbile that the first 8 byte (in 64-bit architecture)
of "struct rb_iseq_struct" is sometimes used for some other purposes
(maybe VALUE ?), and on big-endian 64-bit architecture (including
SPARC64), it is frequently misunderstood as the other type.

That sounds strange. I'll wait for ko1 to comment.

I tried valgrind, but that did not report errors on x86-64 when I tried
"make newline.c". tool/transcode-tblgen.rb ran without errors.

By the way, I think "int stack_max" is better than "uint32_t
stack_max" because it seems that all calculations of stack_max in
compile.c(iseq_set_sequence) and vm_insnhelper.c(vm_push_frame) are
conducted using int.

I agree, that may be changed to int.

Since enum is also signed int type, maybe having 32-bit signed and
unsigned types next to each other is confusing the compiler?

Can you try "int stack_max"? Thanks.

Updated by ngoto (Naohisa Goto) over 5 years ago

With "int stack_max" without dummy, the same error.

(snip)
./miniruby -I./lib -I. -I.ext/common  "./tool/transcode-tblgen.rb" -vo "enc/trans/single_byte.c" "enc/trans/single_byte.trans"
generating enc/trans/single_byte.c ...
converter from US-ASCII to UTF-8
converter from UTF-8 to US-ASCII
converter from ASCII-8BIT to UTF-8
converter from UTF-8 to ASCII-8BIT
converter from ISO-8859-1 to UTF-8
converter from UTF-8 to ISO-8859-1
converter from ISO-8859-2 to UTF-8
converter from UTF-8 to ISO-8859-2
converter from ISO-8859-3 to UTF-8
converter from UTF-8 to ISO-8859-3
converter from ISO-8859-4 to UTF-8
converter from UTF-8 to ISO-8859-4
converter from ISO-8859-5 to UTF-8
converter from UTF-8 to ISO-8859-5
converter from ISO-8859-6 to UTF-8
converter from UTF-8 to ISO-8859-6
converter from ISO-8859-7 to UTF-8
converter from UTF-8 to ISO-8859-7
converter from ISO-8859-8 to UTF-8
converter from UTF-8 to ISO-8859-8
converter from ISO-8859-9 to UTF-8
converter from UTF-8 to ISO-8859-9
converter from ISO-8859-10 to UTF-8
converter from UTF-8 to ISO-8859-10
converter from ISO-8859-11 to UTF-8
converter from UTF-8 to ISO-8859-11
converter from ISO-8859-13 to UTF-8
converter from UTF-8 to ISO-8859-13
converter from ISO-8859-14 to UTF-8
converter from UTF-8 to ISO-8859-14
converter from ISO-8859-15 to UTF-8
converter from UTF-8 to ISO-8859-15
converter from ISO-8859-16 to UTF-8
converter from UTF-8 to ISO-8859-16
converter from WINDOWS-874 to UTF-8
converter from UTF-8 to WINDOWS-874
enc/trans/single_byte.trans:22: [BUG] rb_vm_get_cref: unreachable
ruby 2.2.0dev (2014-07-15) [sparc64-solaris2.10]

-- Control frame information -----------------------------------------------
c:0008 p:---- s:0056 e:000053 TOP    [FINISH]
c:0007 p:---- s:0052 e:000051 CFUNC  :require
c:0006 p:0015 s:0048 e:000047 METHOD enc/trans/single_byte.trans:22
c:0005 p:0244 s:0041 E:000a08 EVAL   enc/trans/single_byte.trans:48 [FINISH]
c:0004 p:---- s:0037 e:000036 CFUNC  :eval
c:0003 p:0045 s:0030 e:000029 METHOD /XXXXXXXXXX/lib/erb.rb:850
c:0002 p:1228 s:0026 E:0011e8 EVAL   ./tool/transcode-tblgen.rb:1043 [FINISH]
c:0001 p:0000 s:0002 E:001478 TOP    [FINISH]

-- Ruby level backtrace information ----------------------------------------
./tool/transcode-tblgen.rb:1043:in `<main>'
/XXXXXXXXXX/lib/erb.rb:850:in `result'
/XXXXXXXXXX/lib/erb.rb:850:in `eval'
enc/trans/single_byte.trans:48:in `<main>'
enc/trans/single_byte.trans:22:in `transcode_tblgen_singlebyte'
enc/trans/single_byte.trans:22:in `require'
/XXXXXXXXXX/enc/trans/windows-1250-tbl.rb:1:in `<top (required)>'

-- Other runtime information -----------------------------------------------

* Loaded script: ./tool/transcode-tblgen.rb

* Loaded features:

    0 enumerator.so
    1 /XXXXXXXXXX/lib/optparse.rb
    2 /XXXXXXXXXX/lib/cgi/util.rb
    3 /XXXXXXXXXX/lib/erb.rb
    4 /XXXXXXXXXX/lib/fileutils.rb
    5 /XXXXXXXXXX/lib/prettyprint.rb
    6 /XXXXXXXXXX/lib/pp.rb
    7 /XXXXXXXXXX/enc/trans/iso-8859-1-tbl.rb
    8 /XXXXXXXXXX/enc/trans/iso-8859-2-tbl.rb
    9 /XXXXXXXXXX/enc/trans/iso-8859-3-tbl.rb
   10 /XXXXXXXXXX/enc/trans/iso-8859-4-tbl.rb
   11 /XXXXXXXXXX/enc/trans/iso-8859-5-tbl.rb
   12 /XXXXXXXXXX/enc/trans/iso-8859-6-tbl.rb
   13 /XXXXXXXXXX/enc/trans/iso-8859-7-tbl.rb
   14 /XXXXXXXXXX/enc/trans/iso-8859-8-tbl.rb
   15 /XXXXXXXXXX/enc/trans/iso-8859-9-tbl.rb
   16 /XXXXXXXXXX/enc/trans/iso-8859-10-tbl.rb
   17 /XXXXXXXXXX/enc/trans/iso-8859-11-tbl.rb
   18 /XXXXXXXXXX/enc/trans/iso-8859-13-tbl.rb
   19 /XXXXXXXXXX/enc/trans/iso-8859-14-tbl.rb
   20 /XXXXXXXXXX/enc/trans/iso-8859-15-tbl.rb
   21 /XXXXXXXXXX/enc/trans/iso-8859-16-tbl.rb
   22 /XXXXXXXXXX/enc/trans/windows-874-tbl.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Abort
make[1]: *** [enc/trans/single_byte.c] Error 134
make[1]: Leaving directory `/XXXXXXXXXX'
make: *** [srcs-enc] Error 2

Updated by normalperson (Eric Wong) over 5 years ago

ngotogenome@gmail.com wrote:

With "int stack_max" without dummy, the same error.

Thanks for trying. Do you have a different compiler to try?
Maybe do some rearranging of the struct, I'm out of ideas :(
The current iseq struct looks like portable C to me.

Anybody else on non-x86* machines have reports?
I only have access to x86* machines.

Updated by ko1 (Koichi Sasada) over 5 years ago

    enum iseq_type {
    ISEQ_TYPE_TOP,
    ISEQ_TYPE_METHOD,
    ISEQ_TYPE_BLOCK,
    ISEQ_TYPE_CLASS,
    ISEQ_TYPE_RESCUE,
    ISEQ_TYPE_ENSURE,
    ISEQ_TYPE_EVAL,
    ISEQ_TYPE_MAIN,
    ISEQ_TYPE_DEFINED_GUARD
    } type;              /* instruction sequence type */
    uint32_t stack_max; /* for stack overflow check */

...

#define RUBY_VM_IFUNC_P(ptr)        (BUILTIN_TYPE(ptr) == T_NODE)
#define RUBY_VM_NORMAL_ISEQ_P(ptr) \
  ((ptr) && !RUBY_VM_IFUNC_P(ptr))

On little endian, first 8 bytes (corresponds to RBasic::flags) of rb_iseq_t can not become T_NODE bit pattern. However, big endian can become.

Goto-san, could you check it?
Like that:

Index: iseq.c
===================================================================
--- iseq.c  (revision 46821)
+++ iseq.c  (working copy)
@@ -450,6 +450,8 @@
     prepare_iseq_build(iseq, name, path, absolute_path, first_lineno, parent, type, bopt, option);
     rb_iseq_compile_node(self, node);
     cleanup_iseq_build(iseq);
+
+    if (BUILTIN_TYPE((VALUE)iseq) == T_NODE) rb_bug("unreachable");
     return self;
 }

Updated by ngoto (Naohisa Goto) over 5 years ago

With the patch, the following error occurs. (using r46830)

(snip)
./miniruby -I./lib -I. -I.ext/common  "./tool/transcode-tblgen.rb" -vo "enc/trans/single_byte.c" "enc/trans/single_byte.trans"
generating enc/trans/single_byte.c ...
converter from US-ASCII to UTF-8
converter from UTF-8 to US-ASCII
converter from ASCII-8BIT to UTF-8
converter from UTF-8 to ASCII-8BIT
converter from ISO-8859-1 to UTF-8
converter from UTF-8 to ISO-8859-1
converter from ISO-8859-2 to UTF-8
converter from UTF-8 to ISO-8859-2
converter from ISO-8859-3 to UTF-8
converter from UTF-8 to ISO-8859-3
converter from ISO-8859-4 to UTF-8
converter from UTF-8 to ISO-8859-4
converter from ISO-8859-5 to UTF-8
converter from UTF-8 to ISO-8859-5
converter from ISO-8859-6 to UTF-8
converter from UTF-8 to ISO-8859-6
converter from ISO-8859-7 to UTF-8
converter from UTF-8 to ISO-8859-7
converter from ISO-8859-8 to UTF-8
converter from UTF-8 to ISO-8859-8
converter from ISO-8859-9 to UTF-8
converter from UTF-8 to ISO-8859-9
converter from ISO-8859-10 to UTF-8
converter from UTF-8 to ISO-8859-10
converter from ISO-8859-11 to UTF-8
converter from UTF-8 to ISO-8859-11
converter from ISO-8859-13 to UTF-8
converter from UTF-8 to ISO-8859-13
converter from ISO-8859-14 to UTF-8
converter from UTF-8 to ISO-8859-14
converter from ISO-8859-15 to UTF-8
converter from UTF-8 to ISO-8859-15
converter from ISO-8859-16 to UTF-8
converter from UTF-8 to ISO-8859-16
converter from WINDOWS-874 to UTF-8
converter from UTF-8 to WINDOWS-874
enc/trans/single_byte.trans:22: [BUG] unreachable
ruby 2.2.0dev (2014-07-16) [sparc64-solaris2.10]

-- Control frame information -----------------------------------------------
c:0007 p:---- s:0052 e:000051 CFUNC  :require
c:0006 p:0015 s:0048 e:000047 METHOD enc/trans/single_byte.trans:22
c:0005 p:0244 s:0041 E:001cd8 EVAL   enc/trans/single_byte.trans:48 [FINISH]
c:0004 p:---- s:0037 e:000036 CFUNC  :eval
c:0003 p:0045 s:0030 e:000029 METHOD /XXXXXXXXXX/lib/erb.rb:850
c:0002 p:1228 s:0026 E:001c38 EVAL   ./tool/transcode-tblgen.rb:1043 [FINISH]
c:0001 p:0000 s:0002 E:002068 TOP    [FINISH]

-- Ruby level backtrace information ----------------------------------------
./tool/transcode-tblgen.rb:1043:in `<main>'
/XXXXXXXXXX/lib/erb.rb:850:in `result'
/XXXXXXXXXX/lib/erb.rb:850:in `eval'
enc/trans/single_byte.trans:48:in `<main>'
enc/trans/single_byte.trans:22:in `transcode_tblgen_singlebyte'
enc/trans/single_byte.trans:22:in `require'

-- Other runtime information -----------------------------------------------

* Loaded script: ./tool/transcode-tblgen.rb

* Loaded features:

    0 enumerator.so
    1 /XXXXXXXXXX/lib/optparse.rb
    2 /XXXXXXXXXX/lib/cgi/util.rb
    3 /XXXXXXXXXX/lib/erb.rb
    4 /XXXXXXXXXX/lib/fileutils.rb
    5 /XXXXXXXXXX/lib/prettyprint.rb
    6 /XXXXXXXXXX/lib/pp.rb
    7 /XXXXXXXXXX/enc/trans/iso-8859-1-tbl.rb
    8 /XXXXXXXXXX/enc/trans/iso-8859-2-tbl.rb
    9 /XXXXXXXXXX/enc/trans/iso-8859-3-tbl.rb
   10 /XXXXXXXXXX/enc/trans/iso-8859-4-tbl.rb
   11 /XXXXXXXXXX/enc/trans/iso-8859-5-tbl.rb
   12 /XXXXXXXXXX/enc/trans/iso-8859-6-tbl.rb
   13 /XXXXXXXXXX/enc/trans/iso-8859-7-tbl.rb
   14 /XXXXXXXXXX/enc/trans/iso-8859-8-tbl.rb
   15 /XXXXXXXXXX/enc/trans/iso-8859-9-tbl.rb
   16 /XXXXXXXXXX/enc/trans/iso-8859-10-tbl.rb
   17 /XXXXXXXXXX/enc/trans/iso-8859-11-tbl.rb
   18 /XXXXXXXXXX/enc/trans/iso-8859-13-tbl.rb
   19 /XXXXXXXXXX/enc/trans/iso-8859-14-tbl.rb
   20 /XXXXXXXXXX/enc/trans/iso-8859-15-tbl.rb
   21 /XXXXXXXXXX/enc/trans/iso-8859-16-tbl.rb
   22 /XXXXXXXXXX/enc/trans/windows-874-tbl.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Abort
make[1]: *** [enc/trans/single_byte.c] Error 134
make[1]: Leaving directory `/XXXXXXXXXX'
make: *** [srcs-enc] Error 2

Updated by ngoto (Naohisa Goto) over 5 years ago

With the following additional patch, the "[BUG] unreachable" occurs after iseq->stack_max is set to 124 (== 0x7c).

Index: compile.c
===================================================================
--- compile.c   (revision 46830)
+++ compile.c   (working copy)
@@ -1650,6 +1650,7 @@

     iseq->iseq = (void *)generated_iseq;
     iseq->iseq_size = pos;
+    rb_warn("stack_max = %d", stack_max);
     iseq->stack_max = stack_max;

     line_info_table = ruby_xrealloc(line_info_table, k * sizeof(struct iseq_line_info_entry));
(snip)
./miniruby -I./lib -I. -I.ext/common  "./tool/transcode-tblgen.rb" -vo "enc/trans/single_byte.c" "enc/trans/single_byte.trans"
warning: stack_max = 1
./miniruby: warning: stack_max = 1
(snip)
converter from ISO-8859-16 to UTF-8
converter from UTF-8 to ISO-8859-16
enc/trans/single_byte.trans:22: warning: stack_max = 98
enc/trans/single_byte.trans:24: warning: stack_max = 1
converter from WINDOWS-874 to UTF-8
converter from UTF-8 to WINDOWS-874
enc/trans/single_byte.trans:22: warning: stack_max = 124
enc/trans/single_byte.trans:22: [BUG] unreachable
ruby 2.2.0dev (2014-07-16) [sparc64-solaris2.10]

-- Control frame information -----------------------------------------------
c:0007 p:---- s:0052 e:000051 CFUNC  :require
c:0006 p:0015 s:0048 e:000047 METHOD enc/trans/single_byte.trans:22
c:0005 p:0244 s:0041 E:0009b8 EVAL   enc/trans/single_byte.trans:48 [FINISH]
c:0004 p:---- s:0037 e:000036 CFUNC  :eval
c:0003 p:0045 s:0030 e:000029 METHOD /XXXXXXXXXX/lib/erb.rb:850
c:0002 p:1228 s:0026 E:001b58 EVAL   ./tool/transcode-tblgen.rb:1043 [FINISH]
c:0001 p:0000 s:0002 E:002068 TOP    [FINISH]

-- Ruby level backtrace information ----------------------------------------
./tool/transcode-tblgen.rb:1043:in `<main>'
/XXXXXXXXXX/lib/erb.rb:850:in `result'
/XXXXXXXXXX/lib/erb.rb:850:in `eval'
enc/trans/single_byte.trans:48:in `<main>'
enc/trans/single_byte.trans:22:in `transcode_tblgen_singlebyte'
enc/trans/single_byte.trans:22:in `require'

-- Other runtime information -----------------------------------------------

* Loaded script: ./tool/transcode-tblgen.rb

* Loaded features:

    0 enumerator.so
    1 /XXXXXXXXXX/lib/optparse.rb
    2 /XXXXXXXXXX/lib/cgi/util.rb
    3 /XXXXXXXXXX/lib/erb.rb
    4 /XXXXXXXXXX/lib/fileutils.rb
    5 /XXXXXXXXXX/lib/prettyprint.rb
    6 /XXXXXXXXXX/lib/pp.rb
    7 /XXXXXXXXXX/enc/trans/iso-8859-1-tbl.rb
    8 /XXXXXXXXXX/enc/trans/iso-8859-2-tbl.rb
    9 /XXXXXXXXXX/enc/trans/iso-8859-3-tbl.rb
   10 /XXXXXXXXXX/enc/trans/iso-8859-4-tbl.rb
   11 /XXXXXXXXXX/enc/trans/iso-8859-5-tbl.rb
   12 /XXXXXXXXXX/enc/trans/iso-8859-6-tbl.rb
   13 /XXXXXXXXXX/enc/trans/iso-8859-7-tbl.rb
   14 /XXXXXXXXXX/enc/trans/iso-8859-8-tbl.rb
   15 /XXXXXXXXXX/enc/trans/iso-8859-9-tbl.rb
   16 /XXXXXXXXXX/enc/trans/iso-8859-10-tbl.rb
   17 /XXXXXXXXXX/enc/trans/iso-8859-11-tbl.rb
   18 /XXXXXXXXXX/enc/trans/iso-8859-13-tbl.rb
   19 /XXXXXXXXXX/enc/trans/iso-8859-14-tbl.rb
   20 /XXXXXXXXXX/enc/trans/iso-8859-15-tbl.rb
   21 /XXXXXXXXXX/enc/trans/iso-8859-16-tbl.rb
   22 /XXXXXXXXXX/enc/trans/windows-874-tbl.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Abort
make[1]: *** [enc/trans/single_byte.c] Error 134
make[1]: Leaving directory `/XXXXXXXXXX'
make: *** [srcs-enc] Error 2

Updated by ko1 (Koichi Sasada) over 5 years ago

(2014/07/16 1:38), ngotogenome@gmail.com wrote:

With the patch, the following error occurs. (using r46830)

That't it.

Please add padding zero's 2bytes after type for workaround.
I will make drastic solution.

--
// SASADA Koichi at atdot dot net

Updated by normalperson (Eric Wong) over 5 years ago

SASADA Koichi ko1@atdot.net wrote:

(2014/07/16 1:38), ngotogenome@gmail.com wrote:

With the patch, the following error occurs. (using r46830)

That't it.

Please add padding zero's 2bytes after type for workaround.

Padding should be wrapped by #ifdef WORDS_BIGENDIAN

I will make drastic solution.

Looking forward to it :)

Updated by ngoto (Naohisa Goto) over 5 years ago

r46838 is temporal workaround for this bug. Please remove when the drastic solution come.

r46839 changes the type of stack_max to int. This reverts r42401 and part of r23945.

Updated by hsbt (Hiroshi SHIBATA) over 5 years ago

  • Status changed from Open to Assigned
#11

Updated by ngoto (Naohisa Goto) over 4 years ago

  • Related to Bug #11219: bootstrap test failed on sparc Solaris since r50743 added
#12

Updated by ko1 (Koichi Sasada) over 4 years ago

  • Status changed from Assigned to Closed

Applied in changeset r51327.


  • make rb_iseq_t T_IMEMO object (type is imemo_iseq). All contents of previous rb_iseq_t is in rb_iseq_t::body. Remove rb_iseq_t::self because rb_iseq_t is an object. RubyVM::InstructionSequence is wrapper object points T_IMEMO/iseq. So RubyVM::ISeq.of(something) method returns different wrapper objects but they point the same T_IMEMO/iseq object. This patch is big, but most of difference is replacement of iseq->xxx to iseq->body->xxx. (previous) rb_iseq_t::compile_data is also located to rb_iseq_t::compile_data. It was moved from rb_iseq_body::compile_data. Now rb_iseq_t has empty two pointers. I will split rb_iseq_body data into static data and dynamic data.
  • compile.c: rename some functions/macros. Now, we don't need to separate iseq and iseqval (only VALUE).
  • eval.c (ruby_exec_internal): `n' is rb_iseq_t (T_IMEMO/iseq).
  • ext/objspace/objspace.c (count_imemo_objects): count T_IMEMO/iseq.
  • gc.c: check T_IMEMO/iseq.
  • internal.h: add imemo_type::imemo_iseq.
  • iseq.c: define RubyVM::InstructionSequnce as T_OBJECT. Methods are implemented by functions named iseqw_....
  • load.c (rb_load_internal0): rb_iseq_new_top() returns rb_iseq_t (T_IMEMO/iesq).
  • method.h (rb_add_method_iseq): accept rb_iseq_t (T_IMEMO/iseq).
  • vm_core.h (GetISeqPtr): removed because it is not T_DATA now.
  • vm_core.h (struct rb_iseq_body): remove padding for [Bug #10037][ruby-core:63721].

Also available in: Atom PDF