From: xtkoba+ruby@... Date: 2021-02-16T00:27:18+00:00 Subject: [ruby-core:102511] [Ruby master Bug#17606] Make failed on i386-cygwin (miniruby.exe aborted) Issue #17606 has been updated by xtkoba (Tee KOBAYASHI). File ruby-iseq_inline_constant_cache_entry.patch added Consider the following code, in which all the assertions would be expected to hold: ``` #include #include /* excerpts from rb_mjit_header.h */ typedef unsigned long VALUE; typedef unsigned long long rb_serial_t; typedef void *rb_cref_t; /* a pointer type */ /* from vm_core.h */ struct iseq_inline_constant_cache_entry { VALUE flags; VALUE value; // v0 const rb_cref_t *ic_cref; // v1 rb_serial_t ic_serial; // v2 // v3 }; /* from ractor.c */ struct RVALUE { VALUE flags; VALUE klass; VALUE v1; VALUE v2; VALUE v3; }; int main() { assert(offsetof(struct iseq_inline_constant_cache_entry, flags) == offsetof(struct RVALUE, flags)); assert(offsetof(struct iseq_inline_constant_cache_entry, value) == offsetof(struct RVALUE, klass)); assert(offsetof(struct iseq_inline_constant_cache_entry, ic_cref) == offsetof(struct RVALUE, v1)); /* the following assertion fails on i686-cygwin */ assert(offsetof(struct iseq_inline_constant_cache_entry, ic_serial) == offsetof(struct RVALUE, v2)); return 0; } ``` Actually the last assertion does not hold, due to the padding in `struct iseq_inline_constant_cache_entry`. A workaround is to use the pack pragma, as in the attached patch. ---------------------------------------- Bug #17606: Make failed on i386-cygwin (miniruby.exe aborted) https://bugs.ruby-lang.org/issues/17606#change-90405 * Author: fd0 (Daisuke Fujimura) * Status: Open * Priority: Normal * ruby -v: ruby 3.1.0dev (2021-02-01T20:20:34Z master 8ef30bcc04) [i386-cygwin] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- Make failed on i386-cygwin (miniruby.exe aborted) ``` $ git clone https://github.com/ruby/ruby.git $ cd ruby $ (./configure && make V=1) |& tee i386-cygwin-make.log 2>&1 (snip) ./miniruby.exe -I./lib -I. -I.ext/common ./tool/generic_erb.rb -c -o encdb.h ./template/encdb.h.tmpl ./enc enc :9: [BUG] vm_get_cref: unreachable ruby 3.1.0dev (2021-02-01T20:20:34Z master 8ef30bcc04) [i386-cygwin] -- Control frame information ----------------------------------------------- c:0002 p:0012 s:0006 e:000005 TOP :9 [FINISH] c:0001 p:0000 s:0003 E:ffffe4f8 (none) [FINISH] -- Ruby level backtrace information ---------------------------------------- :9:in `' -- Other runtime information ----------------------------------------------- * Loaded script: ./miniruby * Loaded features: 0 enumerator.so 1 thread.rb 2 fiber.so 3 rational.so 4 complex.so 5 ruby2_keywords.rb make: *** [uncommon.mk:1098: encdb.h] Aborted (core dumped) $ ``` This problem seems to have occurred since e7fc353f044f9280222ca41b029b1368d2bf2fe3. - https://github.com/ruby/ruby/commit/e7fc353f044f9280222ca41b029b1368d2bf2fe3 (I am aware that it may not be possible to fix it because of the absence of an active maintainer for cygwin.) ---Files-------------------------------- i386-cygwin-make.log (107 KB) ruby-iseq_inline_constant_cache_entry.patch (432 Bytes) -- https://bugs.ruby-lang.org/ Unsubscribe: