Project

General

Profile

Actions

Bug #20976

closed

ethon 0.15.0 began to segfault

Added by mtasaka (Mamoru TASAKA) 4 months ago. Updated 4 months ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
-
ruby -v:
ruby 3.4.0dev (2024-12-21 master 6114094aa0) +PRISM [x86_64-linux]
[ruby-core:120359]

Description

Looks like ethon 0.15.0:
https://github.com/typhoeus/ethon/tree/0b1c2278806502ecbc6814a245f6b11f5365e68c
began to segfault frequently (not always) with recent ruby 3.4.0dev.

Looks like:
fef8ecc708 does not cause segfault
018b775039 seems to cause segfault:

Trying with 6114094aa0 , segfaulting log is attached.


Files

backtrace.log.txt (86 KB) backtrace.log.txt mtasaka (Mamoru TASAKA), 12/22/2024 12:40 AM
Gemfile (819 Bytes) Gemfile mtasaka (Mamoru TASAKA), 12/23/2024 11:19 PM

Updated by mtasaka (Mamoru TASAKA) 4 months ago

curl is using 8.11.1 .

Updated by mtasaka (Mamoru TASAKA) 4 months ago

Well, fef8ecc708 also seems to cause segfault...

Updated by luke-gru (Luke Gruber) 4 months ago

@mtasaka can you please provide your Gemfile.lock? I'm getting issues with the gems after I run bundle, I think the versions in the Gemfile aren't constrained enough.

Updated by mtasaka (Mamoru TASAKA) 4 months ago

I've attached Gemfile, however there is actually no version constraint actually.

So what is installed is:

rubygem-diff-lcs-1.5.0
rubygem-ffi-1.17.0
rubygem-io-console-0.8.0
rubygem-irb-1.14.3
rubygem-json-2.9.1
rubygem-mime-types-3.4.1
rubygem-mime-types-data-3.2023.0218.1
rubygem-mustermann-3.0.3
rubygem-psych-5.2.2
rubygem-rack-2.2.4
rubygem-rack-protection-3.2.0
rubygem-rbs-3.8.0~20241223.1315git376ef474de
rubygem-rdoc-6.10.0
rubygem-rspec-3.13.0
rubygem-rspec-core-3.13.2
rubygem-rspec-expectations-3.13.3
rubygem-rspec-mocks-3.13.2
rubygem-rspec-support-3.13.2
rubygem-sinatra-3.2.0
rubygem-tilt-2.2.0
rubygem-webrick-1.9.0

Updated by alanwu (Alan Wu) 4 months ago

  • Status changed from Open to Third Party's Issue

ethon doesn't seem to be using the ffi gem correctly, since the following makes the spec you point to SEGV consistently, though in a different place than in the OP:

diff --git a/spec/ethon/multi_spec.rb b/spec/ethon/multi_spec.rb
index a483357..5712bdf 100644
--- a/spec/ethon/multi_spec.rb
+++ b/spec/ethon/multi_spec.rb
@@ -46,8 +46,9 @@ describe Ethon::Multi do
   describe "#socket_action" do
     let(:options) { { :execution_mode => :socket_action } }
     let(:select_state) { { :readers => [], :writers => [], :timeout => 0 } }
-    let(:multi) {
+    let(:multi) do
       multi = Ethon::Multi.new(options)
+      GC.stress = true
       multi.timerfunction = proc do |handle, timeout_ms, userp|
         timeout_ms = nil if timeout_ms == -1
         select_state[:timeout] = timeout_ms
@@ -73,7 +74,9 @@ describe Ethon::Multi do
         :ok
       end
       multi
-    }
+    ensure
+      GC.stress = false
+    end
 
     def fds_to_ios(fds)
       fds.map do |fd|

It could also be a bug in the ffi gem, but in any case this is highly unlikely to be an issue in ruby proper.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0