Ruby Issue Tracking System: Issueshttps://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17097754782023-01-21T18:53:10ZRuby Issue Tracking System
Redmine Ruby master - Bug #19363 (Open): Fix rb_transient_heap_mark: wrong header (T_STRUCT) segfaulthttps://redmine.ruby-lang.org/issues/193632023-01-21T18:53:10Zbkuhlmann (Brooke Kuhlmann)brooke@alchemists.io
<a name="Overview"></a>
<h2 >Overview<a href="#Overview" class="wiki-anchor">¶</a></h2>
<p>Hello. 👋 I'm hitting an issue where my build is constantly failing with a segfault. The following is a snippet taken from my local machine with YJIT enabled (see attachments for details):</p>
<pre><code>/Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/gems/3.2.0/gems/puma-6.0.2/lib/puma/runner.rb: [BUG] rb_transient_heap_mark: wrong header, T_STRUCT (0x0000000109ea98a0)
ruby 3.2.0 (2022-12-25 revision a528908271) +YJIT [arm64-darwin22.2.0]
</code></pre>
<p>The closest issue I could find that might be related to this issue (but not sure) is this issue: <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Segfault in rb_transient_heap_mark when running Sequel's specs (Closed)" href="https://redmine.ruby-lang.org/issues/15358">#15358</a>.</p>
<a name="Steps-to-Recreate"></a>
<h2 >Steps to Recreate<a href="#Steps-to-Recreate" class="wiki-anchor">¶</a></h2>
<p>You should be able to quickly recreate this issue via these steps:</p>
<ul>
<li>Download/clone my <a href="https://github.com/bkuhlmann/hemo" class="external">Hemo</a> project.</li>
<li>Run the setup steps.</li>
<li>Run the test suite by running <code>bin/rspec</code>.</li>
</ul>
<p>If you need an example of the same segfault (but not on my macOS machine), you can see the same segfault via my <a href="https://app.circleci.com/pipelines/github/bkuhlmann/hemo/11/workflows/f19abf41-60bc-4e8e-9ba9-b964a67ece73/jobs/10" class="external">Circle CI Build</a>. My Circle CI build is using my <a href="https://www.alchemists.io/projects/docker-alpine-ruby" class="external">Docker Alpine Linux Ruby</a> image which might be of interest as well. This Docker image is also built with YJIT enabled.</p>
<p>Interestingly, is if you were to run the test suite with <code>bin/guard</code> instead of <code>bin/rspec</code> then the segfault doesn't occur.</p>
<a name="Environment"></a>
<h2 >Environment<a href="#Environment" class="wiki-anchor">¶</a></h2>
<pre><code>ruby 3.2.0 (2022-12-25 revision a528908271) +YJIT [arm64-darwin22.2.0]
1.43.0 (using Parser 3.2.0.0, rubocop-ast 1.24.1, running on ruby 3.2.0) [arm64-darwin22.2.0]
- rubocop-performance 1.15.2
- rubocop-rake 0.6.0
- rubocop-rspec 2.18.1
- rubocop-sequel 0.3.4
- rubocop-thread_safety 0.4.4
</code></pre>