Description
Hi! I see this gem uses Typheous as an HTTP library. Unfortunately, Typheous is poorly-maintained (no commits in two years!) and often segfaults on Apple Silicon when combined with forking processes (a very common practice in Ruby). As this is a library, my recommendation is to switch to Faraday which allows users to switch the underlying HTTP library to something which doesn't segfault.
Noticed because I started having this happen more locally again (I cannot consistently reproduce, unfortunately):
/Users/emma/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/ethon-0.16.0/lib/ethon/curl.rb:61: [BUG] Segmentation fault at 0x0000000000000110
ruby 3.2.5 (2024-07-26 revision 31d0f1a2e7) [arm64-darwin23]
-- Crash Report log information --------------------------------------------
See Crash Report log file in one of the following locations:
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
Don't forget to include the above Crash Report log file in bug reports.
-- Control frame information -----------------------------------------------
c:0078 p:---- s:0438 e:000437 CFUNC :global_init
c:0077 p:0014 s:0433 e:000432 BLOCK /Users/emma/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/ethon-0.16.0/lib/ethon/curl.rb:61 [FINISH]
c:0076 p:---- s:0430 e:000429 CFUNC :synchronize
c:0075 p:0006 s:0426 e:000425 METHOD /Users/emma/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/ethon-0.16.0/lib/ethon/curl.rb:59
c:0074 p:0008 s:0422 e:000421 METHOD /Users/emma/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/ethon-0.16.0/lib/ethon/easy.rb:219 [FINISH]
c:0073 p:---- s:0417 e:000416 CFUNC :new
c:0072 p:0014 s:0413 e:000412 METHOD /Users/emma/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/typhoeus-1.4.1/lib/typhoeus/pool.rb:43
c:0071 p:0011 s:0409 e:000408 METHOD /Users/emma/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/typhoeus-1.4.1/lib/typhoeus/easy_factory.rb:70
c:0070 p:0014 s:0405 e:000404 METHOD /Users/emma/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/typhoeus-1.4.1/lib/typhoeus/easy_factory.rb:83
c:0069 p:0007 s:0398 e:000397 METHOD /Users/emma/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/typhoeus-1.4.1/lib/typhoeus/request/operations.rb:15
c:0068 p:0025 s:0393 e:000392 METHOD /Users/emma/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/typhoeus-1.4.1/lib/typhoeus/request/cacheable.rb:18
c:0067 p:0018 s:0388 e:000387 METHOD /Users/emma/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/typhoeus-1.4.1/lib/typhoeus/request/block_connection.rb:31
c:0066 p:0033 s:0384 e:000383 METHOD /Users/emma/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/typhoeus-1.4.1/lib/typhoeus/request/stubbable.rb:25
c:0065 p:0012 s:0379 e:000378 METHOD /Users/emma/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/typhoeus-1.4.1/lib/typhoeus/request/before.rb:26
c:0064 p:0139 s:0375 e:000374 BLOCK /Users/emma/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/typesense-2.0.0/lib/typesense/api_call.rb:85 [FINISH]
c:0063 p:---- s:0364 e:000363 CFUNC :each
c:0062 p:0008 s:0360 e:000359 METHOD /Users/emma/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7.6/lib/active_support/core_ext/range/each.rb:
c:0061 p:0058 s:0355 e:000354 METHOD /Users/emma/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/typesense-2.0.0/lib/typesense/api_call.rb:66
c:0060 p:0013 s:0344 e:000343 METHOD /Users/emma/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/typesense-2.0.0/lib/typesense/api_call.rb:51
c:0059 p:0008 s:0338 e:000337 METHOD /Users/emma/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/typesense-2.0.0/lib/typesense/collection.rb:16
...
Description
Hi! I see this gem uses Typheous as an HTTP library. Unfortunately, Typheous is poorly-maintained (no commits in two years!) and often segfaults on Apple Silicon when combined with forking processes (a very common practice in Ruby). As this is a library, my recommendation is to switch to Faraday which allows users to switch the underlying HTTP library to something which doesn't segfault.
Noticed because I started having this happen more locally again (I cannot consistently reproduce, unfortunately):