https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112018-02-12T01:33:02ZRuby Issue Tracking SystemRuby master - Bug #14464: MJIT & MinGW / gcc 7.3.0 seemed ok as of 62337, fail or skip afterhttps://bugs.ruby-lang.org/issues/14464?journal_id=702972018-02-12T01:33:02Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul></ul><p>It seems that all JIT compilations on MinGW started to fail from r62340, and I fixed it on r62376. Now the tests won't be skipped on MinGW builds. For now, I recommend to specify environment variable RUBY_FORCE_TEST_JIT=1 when running test-all.</p>
<p>After r62376, JIT infrastructure seems working. But some tests in test_jit.rb is failing. The test failure seems to be caused by pointing to invalid address in generated code. As Linux builds with gcc 7.2 are perfectly working, probably it's caused by difference between size of variable types and wrong casting. This was NOT working as of r62337 too. We need deeper investigation for it...</p> Ruby master - Bug #14464: MJIT & MinGW / gcc 7.3.0 seemed ok as of 62337, fail or skip afterhttps://bugs.ruby-lang.org/issues/14464?journal_id=702982018-02-12T02:24:47ZMSP-Greg (Greg L)
<ul></ul><p>k0kubun,</p>
<p>Thank you for the response. A few notes:</p>
<p>The test-all log for 62337 showed the two MJIT tests passing, but subsequent builds skipped (or failed with RUBY_FORCE_TEST_JIT).</p>
<p>In the 62375 build (after my first post), both tests skipped.</p>
<p>RubyCI.org is rather 'tablet unfriendly', which biases me away from all use (gotta get over that), but I'll keep an eye on the Linux/gcc 7.2+ builds for the tests results.</p>
<p>Since ruby-loco is used for CI, I won't force fails with RUBY_FORCE_TEST_JIT, so I'll keep checking the logs...</p>
<blockquote>
<p>We need deeper investigation for it...</p>
</blockquote>
<p>As stated prev, not being a c type, I'm not much help. If there is anything I can add to the build to help identify the issue, I'll be happy to.</p>
<p>NOTE: I just saw 62376 (thanks), the next scheduled build is done at Noon JST. I'll post back when done...</p>
<p>Thanks again, Greg</p> Ruby master - Bug #14464: MJIT & MinGW / gcc 7.3.0 seemed ok as of 62337, fail or skip afterhttps://bugs.ruby-lang.org/issues/14464?journal_id=702992018-02-12T05:21:10ZMSP-Greg (Greg L)
<ul><li><strong>File</strong> <a href="/attachments/7018">TestJIT_info_62380.txt</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/7018/TestJIT_info_62380.txt">TestJIT_info_62380.txt</a> added</li></ul><p><a class="user active user-mention" href="https://bugs.ruby-lang.org/users/10073">@k0kubun (Takashi Kokubun)</a>,</p>
<p>Appveyor run of 62377 had the following (added backticks for web view):</p>
<pre><code>Retrying...
[1/2] 8 TestJIT#test_compile_insns = 11.33 s = F
[2/2] 7 TestJIT#test_jit_output = 5.58 s = .
1) Failure:
TestJIT#test_compile_insns [C:/projects/ruby-loco/src/ruby/test/ruby/test_jit.rb:30]:
Failed to run script with JIT:
'``
def foo(&b)
a = b
b = 2
a.call + 2
end
print foo { 1 }
'``
stdout:
'``
'``
stderr:
'``
JIT success (1318.5ms): foo@-e:1 -> C:/Users/appveyor/AppData/Local/temp/_ruby_mjit_p12476u0.c
-e:2:in `foo': wrong argument type Binding (expected Class) (TypeError)
from -e:7:in `<main>'
Successful MJIT finish
'``
.
<true> expected but was
<false>.
</code></pre>
<p>I ran the test locally, and I'm wondering what is using the /Users/user name/AppData/Local/temp folder, as on my system, all TEMP/TMP env variables are set to different folders. I've built ruby for quite a while, and also MSYS2 packages, and I don't ever recall anything using that. For many windows users, their user name may have a space (as mine does). That hasn't been an issue with config files, --user-install gems, etc.</p>
<p>But, when I ran the tests, it mangles the path...</p>
<p>The test-all summary for TestJIT is attached for 62380. I believe there are 9 failures & 5 skips in 64 tests?</p>
<p>Thanks again,</p>
<p>Greg</p> Ruby master - Bug #14464: MJIT & MinGW / gcc 7.3.0 seemed ok as of 62337, fail or skip afterhttps://bugs.ruby-lang.org/issues/14464?journal_id=705242018-02-21T06:22:10Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>k0kubun (Takashi Kokubun)</i></li></ul> Ruby master - Bug #14464: MJIT & MinGW / gcc 7.3.0 seemed ok as of 62337, fail or skip afterhttps://bugs.ruby-lang.org/issues/14464?journal_id=715252018-04-18T15:04:49Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul></ul><blockquote>
<p>I'm wondering what is using the /Users/user name/AppData/Local/temp folder, as on my system, all TEMP/TMP env variables are set to different folders.</p>
</blockquote>
<p>Now MJIT seems to use the result of rb_w32_system_tmpdir(), not just $TEMP or $TMP.</p>
<blockquote>
<p>If there is anything I can add to the build to help identify the issue, I'll be happy to.</p>
</blockquote>
<p>Current status of investigation for this ticket: I've investigated why #test_compile_insn_intern_duparray in test_jit.rb fails. I minimized the reproductive code to be <code>ruby --disable-gems -e 'p proc { 0.to_s }.call' --jit-wait --jit-min-calls=1</code>.</p>
<p>As far as I've debugged with gdb, the code crashes because <code>rb_class_of(FIXNUM(0))</code>, which is called by <code>vm_search_method</code> in <code>_mjit0</code>, returns the value of <code>&rb_cInteger</code> instead of <code>rb_cInteger</code>, and then <code>Module#to_s</code> is dispatched for <code>0.to_s</code>. As 0 is not Module, it crashes. The <code>rb_class_of</code> code in MJIT header looks to properly return <code>rb_cInteger</code>. So I have no idea why it returns <code>&rb_cInteger</code>.</p>
<p>For those who help me for this issue, it would be helpful to confirm that my above understanding is correct or comment some wrong assumption in it. Thanks.</p> Ruby master - Bug #14464: MJIT & MinGW / gcc 7.3.0 seemed ok as of 62337, fail or skip afterhttps://bugs.ruby-lang.org/issues/14464?journal_id=718312018-05-03T21:00:25ZMSP-Greg (Greg L)
<ul><li><strong>File</strong> <a href="/attachments/7139">MJIT-MinGW-63333.txt</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/7139/MJIT-MinGW-63333.txt">MJIT-MinGW-63333.txt</a> added</li></ul><p>k0kubun,</p>
<p>Thanks for looking into this. The motherboard on my home desktop stopped working, so I've been without a good dev system. The temp folder issue seems corrected; I looked thru the c code, and added TEMPDIR, which I hadn't used before.</p>
<p>It may not be helpful, but I've attached a log of 63333 and test_jit.rb. It's at 9 failures...</p>
<p>Thanks, Greg</p> Ruby master - Bug #14464: MJIT & MinGW / gcc 7.3.0 seemed ok as of 62337, fail or skip afterhttps://bugs.ruby-lang.org/issues/14464?journal_id=722162018-05-22T22:43:53ZMSP-Greg (Greg L)
<ul><li><strong>ruby -v</strong> changed from <i>ruby 2.6.0dev (2018-02-11 trunk 62371) [x64-mingw32]</i> to <i>ruby 2.6.0dev (2018-05-23 trunk 63492) [x64-mingw32]</i></li></ul><p><a class="user active user-mention" href="https://bugs.ruby-lang.org/users/10073">@k0kubun (Takashi Kokubun)</a>,</p>
<p>Just ran with 63492, all passed with 5 skips, partial log:</p>
<pre><code> 1) Skipped:
TestJIT#test_compile_insn_getblockparamproxy [C:/Greg/GitHub/ruby/test/ruby/test_jit.rb:89]:
support this in mjit_compile
2) Skipped:
TestJIT#test_compile_insn_opt_call_c_function [C:/Greg/GitHub/ruby/test/ruby/test_jit.rb:523]:
support this in opt_call_c_function (low priority)
3) Skipped:
TestJIT#test_compile_insn_reput [C:/Greg/GitHub/ruby/test/ruby/test_jit.rb:246]:
write test
4) Skipped:
TestJIT#test_compile_insn_tracecoverage [C:/Greg/GitHub/ruby/test/ruby/test_jit.rb:277]:
write test
5) Skipped:
TestJIT#test_compile_insn_defineclass [C:/Greg/GitHub/ruby/test/ruby/test_jit.rb:281]:
support this in mjit_compile (low priority)
Finished tests in 226.166094s, 0.3228 tests/s, 1.9808 assertions/s.
73 tests, 448 assertions, 0 failures, 0 errors, 5 skips
ruby -v: ruby 2.6.0dev (2018-05-23 trunk 63492) [x64-mingw32]
</code></pre>
<p>Thanks for your work on this, Greg</p> Ruby master - Bug #14464: MJIT & MinGW / gcc 7.3.0 seemed ok as of 62337, fail or skip afterhttps://bugs.ruby-lang.org/issues/14464?journal_id=722272018-05-23T12:06:29Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>Oh, that's very good to know. TBH I don't know which revision fixed the problem, but I'm very happy to know the tests can succeed on the platform. Thank you to report this.</p> Ruby master - Bug #14464: MJIT & MinGW / gcc 7.3.0 seemed ok as of 62337, fail or skip afterhttps://bugs.ruby-lang.org/issues/14464?journal_id=722312018-05-23T20:00:38ZMSP-Greg (Greg L)
<ul></ul><p><a class="user active user-mention" href="https://bugs.ruby-lang.org/users/10073">@k0kubun (Takashi Kokubun)</a>,</p>
<p>I narrowed it down using ruby-loco builds:</p>
<pre><code>All ruby 2.6.0dev
(2018-05-21 trunk 63475) [x64-mingw32] 73 tests, 429 assertions, 10 failures, 0 errors, 5 skips
(2018-05-21 trunk 63480) [x64-mingw32] 73 tests, 448 assertions, 0 failures, 0 errors, 5 skips
</code></pre>
<p>All failing builds left artifacts in TEMPDIR, but 63480, 63492, and 63496 left it clean.</p>
<p>Thanks again, Greg</p> Ruby master - Bug #14464: MJIT & MinGW / gcc 7.3.0 seemed ok as of 62337, fail or skip afterhttps://bugs.ruby-lang.org/issues/14464?journal_id=722522018-05-26T12:56:02Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul></ul><p>Thanks for letting me know that. I also confirmed r63479 doesn't pass the tests but r63480 does. So somehow r63480 fixed the issue.</p> Ruby master - Bug #14464: MJIT & MinGW / gcc 7.3.0 seemed ok as of 62337, fail or skip afterhttps://bugs.ruby-lang.org/issues/14464?journal_id=722542018-05-27T14:49:09ZMSP-Greg (Greg L)
<ul></ul><p><a class="user active user-mention" href="https://bugs.ruby-lang.org/users/10073">@k0kubun (Takashi Kokubun)</a>,</p>
<blockquote>
<p>Thanks for letting me know that</p>
</blockquote>
<p>Not being a c type, it's the least I can do. I often feel like a dumb rock, as I can identify issues, but I can't fix them...</p>
<p>FYI, as of:</p>
<pre><code>ruby 2.6.0dev (2018-05-27 trunk 63508) [x64-mingw32]
</code></pre>
<p>I re-enabled MJIT in ruby-loco, and the build passed. I've got quite a bit of logging for it, so -</p>
<p>When parallel testing ran, <code>TestJIT#test_compile_insn_opt_aset</code> failed at (I believe) the second assert. It passed three asserts on the retry.</p>
<p>Thanks again for your work on JIT, Greg</p> Ruby master - Bug #14464: MJIT & MinGW / gcc 7.3.0 seemed ok as of 62337, fail or skip afterhttps://bugs.ruby-lang.org/issues/14464?journal_id=725292018-06-20T04:15:33ZMSP-Greg (Greg L)
<ul></ul><p>k0kubun,</p>
<p>First of all, thanks for all your work on MJIT. Lately, I've been testing a few extension gems, and I just decided to try JIT on EventMachine, which normally passes. Got thru quite a bit of it, but then a SEGV.</p>
<ol>
<li>
<p>Would you like a log, etc?</p>
</li>
<li>
<p>If so, here, or open a new issue?</p>
</li>
</ol>
<p>Re Windows, many gems are not testing with new Ruby versions, and they're also behind in releasing fat-binary gems for new Ruby versions. I've been involved in the first issue, now I'm moving to the second.</p>
<p>While working to help build Windows fat-binary gems on Appveyor, I realized that most of the work needed to build fat binaries is the same as the work needed to test on Appveyor.</p>
<p>Hence, to repo these issues, a fat-binary will be available...</p>
<p>Thanks, Greg</p> Ruby master - Bug #14464: MJIT & MinGW / gcc 7.3.0 seemed ok as of 62337, fail or skip afterhttps://bugs.ruby-lang.org/issues/14464?journal_id=725352018-06-20T11:00:05Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul></ul><p>New issue would be helpful since it seems to be a different problem. And if possible, please minimize the reproductive code. A bug report with reproductive steps using EventMachine might help, but it would be more helpful if you were able to omit EventMachine code to reproduce the SEGV and used very few lines of code.</p>