You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Release a version including #611 (GC compaction segfault fix) #612
Thanks a lot for merging #611 (74a2232). It fixes a production crash we have been hitting, and we would love to pick it up from RubyGems.
What we see
tiny_tds 3.4.0 (precompiled x86_64-linux-gnu), Ruby 4.0.7, Rails 8.1, Puma in cluster mode with preload_app!.
Our before_fork hook calls Process.warmup, which compacts the heap in the Puma master before the workers fork.
On some deploys, compaction moves TinyTds::Error. Every forked worker then inherits the stale cTinyTdsError pointer and crashes with SIGSEGV (SEGV_MAPERR) on its first connection to Azure SQL:
All crashes of a given deploy share the same fault address, across different worker PIDs. Puma restarts the dead workers, and they crash again on their next connection. We had 26 crashes on one deploy and 4 on another. Builds where the class does not move are unaffected, which matches the compaction root cause described in Segfault in connect under multithreaded use: cTinyTdsError/mTinyTds not registered with the Ruby GC #608.
Request
Could you publish a release (3.4.1?) that contains #611, including the precompiled native gems? Until then we will skip heap compaction before forking.
Activity
andyundso commentedon Oct 8, 2026
Release is published:
https://github.com/rails-sqlserver/tiny_tds/releases/tag/v3.4.1