protocolbuffers / protobuf

Protocol Buffers - Google's data interchange format
http://protobuf.dev
Other
65.25k stars 15.45k forks source link

ruby: segfault iterating over protobuf objects #11968

Closed semanticart closed 1 year ago

semanticart commented 1 year ago

Iterating over Protobuf objects in threads causes a segfault.

What version of protobuf and what language are you using? Version: 3.21.12

Language: Ruby

What operating system (Linux, Windows, ...) and version? OSX darwin19 (Catalina) and darwin22 (Ventura) -- probably others, I've only been able to test these.

What runtime / compiler are you using (e.g., python version or gcc version)

What did you do?

Iterating over Protobuf objects in threads causes a segfault. Here's the minimal reproduction:

require 'json'
require 'google/protobuf'

Google::Protobuf::DescriptorPool.generated_pool.build do
  add_message 'example.Config' do
    repeated :rows, :message, 1, 'example.ConfigRow'
  end

  add_message 'example.ConfigRow' do
    repeated :values, :message, 1, 'example.Value'
  end

  add_message 'example.Value' do
    optional :string, :string, 1
  end
end

module Example
  Config = Google::Protobuf::DescriptorPool.generated_pool.lookup('example.Config').msgclass
  ConfigRow = Google::Protobuf::DescriptorPool.generated_pool.lookup('example.ConfigRow').msgclass
  Value = Google::Protobuf::DescriptorPool.generated_pool.lookup('example.Value').msgclass
end

content = { "rows": [{ "values": [{ "string": 'hello' }, { "string": 'world' }] },
                     { "values": [{ "string": 'thanks' },
                                  { "string": 'again' }] }] }.to_json

config = Example::Config.decode_json(content)

thread_count = 500
iterations_per_thread = 1000

threads = []
(1..thread_count).each do |i|
  threads << Thread.new do
    (1..iterations_per_thread).each do |iter|
      config.rows.each do |row|
        row.values.each do |conditional_value|
          conditional_value
        end
      end

      puts "assert #{i} #{iter}"
    end
  end
end

threads.map(&:join)

puts 'DONE!'

What did you expect to see

No segfault.

What did you see instead?

The segfault.

Example crash output for v3.21.12:

-- Control frame information -----------------------------------------------
c:0007 p:---- s:0026 e:000025 CFUNC  :each
c:0006 p:0007 s:0022 e:000021 BLOCK  thread_example.rb:42 [FINISH]
c:0005 p:---- s:0018 e:000017 CFUNC  :each
c:0004 p:0008 s:0014 e:000013 BLOCK  thread_example.rb:41 [FINISH]
c:0003 p:---- s:0010 e:000009 CFUNC  :each
c:0002 p:0009 s:0006 e:000005 BLOCK  thread_example.rb:40 [FINISH]
c:0001 p:---- s:0003 e:000002 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
thread_example.rb:40:in `block (2 levels) in <main>'
thread_example.rb:40:in `each'
thread_example.rb:41:in `block (3 levels) in <main>'
thread_example.rb:41:in `each'
thread_example.rb:42:in `block (4 levels) in <main>'
thread_example.rb:42:in `each'

Example content from ~/Library/Logs/DiagnosticReports

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               ruby [90659]
Path:                  /Users/USER/*/ruby
Identifier:            ruby
Version:               ???
Code Type:             ARM-64 (Native)
Parent Process:        fish [12064]
User ID:               501

Date/Time:             2023-02-15 15:32:09.6486 -0500
OS Version:            macOS 13.1 (22C65)
Report Version:        12
Anonymous UUID:        86A9AA47-CD12-13F2-C078-E4784197ABEF

Sleep/Wake UUID:       3E3C60C0-79AC-47D0-8E8B-27EE980939EC

Time Awake Since Boot: 780000 seconds
Time Since Wake:       26946 seconds

System Integrity Protection: enabled

Crashed Thread:        221  thread_example.rb:39

Exception Type:        EXC_BAD_ACCESS (SIGABRT)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000008
Exception Codes:       0x0000000000000001, 0x0000000000000008

VM Region Info: 0x8 is not in any region.  Bytes before following region: 105553518919672
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      MALLOC_NANO (reserved)   600018000000-600020000000 [128.0M] rw-/rwx SM=NUL  ...(unallocated)

Application Specific Information:
abort() called

Thread 0::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib                 0x19cfae2c0 poll + 8
1   libruby.3.1.dylib                      0x10525060c rb_sigwait_sleep + 916
2   libruby.3.1.dylib                      0x105251c0c native_sleep + 476
3   libruby.3.1.dylib                      0x10525c168 thread_join_sleep + 392
4   libruby.3.1.dylib                      0x1050f34fc rb_ensure + 344
5   libruby.3.1.dylib                      0x10525bf10 thread_join + 156
6   libruby.3.1.dylib                      0x1052589bc thread_join_m + 220
7   libruby.3.1.dylib                      0x105297e98 vm_call0_body + 928
8   libruby.3.1.dylib                      0x1052b02f8 rb_call0 + 812
9   libruby.3.1.dylib                      0x10529a560 rb_yield + 180
10  libruby.3.1.dylib                      0x10505e764 rb_ary_collect + 276
11  libruby.3.1.dylib                      0x1052aac38 vm_call_cfunc_with_frame + 232
12  libruby.3.1.dylib                      0x1052acf7c vm_sendish + 320
13  libruby.3.1.dylib                      0x10528d7d0 vm_exec_core + 9752
14  libruby.3.1.dylib                      0x1052a1dbc rb_vm_exec + 2596
15  libruby.3.1.dylib                      0x1050f253c rb_ec_exec_node + 300
16  libruby.3.1.dylib                      0x1050f23b4 ruby_run_node + 96
17  ruby                                   0x104babf38 main + 92
18  dyld                                   0x19ccbbe50 start + 2544

Thread 1:
0   libsystem_kernel.dylib                 0x19cfae2c0 poll + 8
1   libruby.3.1.dylib                      0x10525c40c timer_pthread_fn + 168
2   libsystem_pthread.dylib                0x19cfe506c _pthread_start + 148
3   libsystem_pthread.dylib                0x19cfdfe2c thread_start + 8

Thread 2:: thread_example.rb:39
0   libsystem_kernel.dylib                 0x19cfa9564 __psynch_cvwait + 8
1   libsystem_pthread.dylib                0x19cfe5638 _pthread_cond_wait + 1232
2   libruby.3.1.dylib                      0x10525a9cc native_cond_sleep + 568
3   libruby.3.1.dylib                      0x105251ac0 native_sleep + 144
4   libruby.3.1.dylib                      0x105250bf8 do_mutex_lock + 412
5   libruby.3.1.dylib                      0x10525140c rb_mutex_synchronize + 36
6   libruby.3.1.dylib                      0x105139f80 io_fwritev + 952
7   libruby.3.1.dylib                      0x105139b0c io_writev + 304
8   libruby.3.1.dylib                      0x105297e98 vm_call0_body + 928
9   libruby.3.1.dylib                      0x10529598c rb_funcallv + 460
10  libruby.3.1.dylib                      0x10512a1fc rb_io_puts + 108
11  libruby.3.1.dylib                      0x105297e98 vm_call0_body + 928
12  libruby.3.1.dylib                      0x1052b02f8 rb_call0 + 812
13  libruby.3.1.dylib                      0x1052aac38 vm_call_cfunc_with_frame + 232
14  libruby.3.1.dylib                      0x1052acf7c vm_sendish + 320
15  libruby.3.1.dylib                      0x10528d820 vm_exec_core + 9832
16  libruby.3.1.dylib                      0x1052a1dbc rb_vm_exec + 2596
17  libruby.3.1.dylib                      0x1052b1600 invoke_block_from_c_bh + 932
18  libruby.3.1.dylib                      0x10529a560 rb_yield + 180
19  libruby.3.1.dylib                      0x1051d7f38 range_each + 356
20  libruby.3.1.dylib                      0x1052aac38 vm_call_cfunc_with_frame + 232
21  libruby.3.1.dylib                      0x1052acf7c vm_sendish + 320
22  libruby.3.1.dylib                      0x10528d7d0 vm_exec_core + 9752
23  libruby.3.1.dylib                      0x1052a1dbc rb_vm_exec + 2596
24  libruby.3.1.dylib                      0x10529fa7c rb_vm_invoke_proc + 1204
25  libruby.3.1.dylib                      0x10525ba30 thread_do_start_proc + 688
26  libruby.3.1.dylib                      0x10525b210 thread_start_func_2 + 1184
27  libruby.3.1.dylib                      0x10525abfc thread_start_func_1 + 264
28  libsystem_pthread.dylib                0x19cfe506c _pthread_start + 148
29  libsystem_pthread.dylib                0x19cfdfe2c thread_start + 8

...

Anything else we should know about your project / environment

It seems to affect any ruby version I build with ruby-build (via asdf) or homebrew on both intel and apple silicon.

System rubies seem unaffected.

I've got a repro repository here: https://github.com/semanticart/proto-segfault-example

I'll note that I've been unable to recreate the segfault reliably in github actions.

FWIW, the pre-release 4.0.0 gem seems unaffected.

haberman commented 1 year ago

The fact that this only occurs with custom built Rubies is suspicious.

Is it possible that you are mixing versions? eg. you are building against headers for Ruby version A and then loading into Ruby version B?

FWIW, the pre-release 4.0.0 gem seems unaffected.

This is a very old and obsolete pre-release. We decided not to bump the major version at that time.

semanticart commented 1 year ago

It is suspicious. I don't think I'm mixing versions but I'm happy to run any commands that might help rule that out.

It looks like I'm building native extensions for the correct ruby w/ native extensions (I'm using asdf, FWIW)

Fetching google-protobuf 3.21.12
Installing google-protobuf 3.21.12 with native extensions

Here's some more info from the crash in case it helps:

    6 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
    7 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/trans/transdb.bundle
    8 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/rbconfig.rb
    9 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/compatibility.rb
   10 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/defaults.rb
   11 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/deprecate.rb
   12 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/errors.rb
   13 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/unknown_command_spell_checker.rb
   14 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/exceptions.rb
   15 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/basic_specification.rb
   16 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/stub_specification.rb
   17 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/platform.rb
   18 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/version.rb
   19 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/requirement.rb
   20 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/util/list.rb
   21 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/specification.rb
   22 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/util.rb
   23 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/dependency.rb
   24 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_gem.rb
   25 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
   26 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/monitor.rb
   27 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb
   28 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_warn.rb
   29 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems.rb
   30 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/path_support.rb
   31 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/error_highlight/version.rb
   32 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/error_highlight/base.rb
   33 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/error_highlight/formatter.rb
   34 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/error_highlight/core_ext.rb
   35 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/error_highlight.rb
   36 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/did_you_mean/version.rb
   37 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/did_you_mean/core_ext/name_error.rb
   38 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/did_you_mean/levenshtein.rb
   39 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/did_you_mean/jaro_winkler.rb
   40 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/did_you_mean/spell_checker.rb
   41 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb
   42 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb
   43 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/did_you_mean/spell_checkers/name_error_checkers.rb
   44 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/did_you_mean/spell_checkers/method_name_checker.rb
   45 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/did_you_mean/spell_checkers/key_error_checker.rb
   46 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/did_you_mean/spell_checkers/null_checker.rb
   47 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/did_you_mean/tree_spell_checker.rb
   48 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/did_you_mean/spell_checkers/require_path_checker.rb
   49 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/did_you_mean/spell_checkers/pattern_key_name_checker.rb
   50 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/did_you_mean/formatter.rb
   51 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/did_you_mean.rb
   52 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/version.rb
   53 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/ostruct.rb
   54 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/generic_object.rb
   55 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/common.rb
   56 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/ext/parser.bundle
   57 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/ext/generator.bundle
   58 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/ext.rb
   59 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json.rb
   60 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf/message_exts.rb
   61 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
   62 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf/descriptor_pb.rb
   63 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf/descriptor_dsl.rb
   64 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/forwardable/impl.rb
   65 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/forwardable.rb
   66 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf/repeated_field.rb
   67 /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf.rb

* Process memory map:

1000d8000-1000dc000 r-x /Users/ship/.asdf/installs/ruby/3.1.2/bin/ruby
1000dc000-1000e0000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/bin/ruby
1000e0000-1000e4000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/bin/ruby
1000e4000-100124000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100124000-100128000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100128000-10012c000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100130000-100134000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100138000-10013c000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100140000-100144000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100148000-10014c000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100150000-100154000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100158000-10015c000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100160000-100164000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100164000-10016c000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
10016c000-100170000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100170000-100174000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100174000-100178000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100178000-10017c000 --- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
10017c000-100184000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100184000-100188000 --- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100188000-10018c000 --- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
10018c000-100194000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100194000-100198000 --- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100198000-10019c000 --- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
10019c000-1001a4000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
1001a4000-1001a8000 --- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
1001a8000-1001ac000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
1001ac000-1001b0000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
1001b0000-1001b4000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
1001b8000-1001bc000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
1001c0000-1001c4000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
1001c8000-1001cc000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
1001d0000-1001d4000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
1001d8000-1001dc000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
1001e0000-1001e4000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
1001e8000-1001ec000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
1001f0000-1001f4000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
1001f8000-1001fc000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100200000-100204000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100208000-10020c000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100210000-100214000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100218000-10021c000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100220000-100224000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100228000-10022c000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100230000-100234000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100238000-10023c000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100240000-100244000 r-x /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100244000-100248000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
100248000-10024c000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/encdb.bundle
10024c000-100250000 r-x /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/trans/transdb.bundle
100250000-100254000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/trans/transdb.bundle
100254000-100258000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/enc/trans/transdb.bundle
10025c000-100260000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
100264000-100268000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
10026c000-100270000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
100274000-100278000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
10027c000-100280000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
100284000-100288000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
10028c000-100290000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
100294000-100298000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
10029c000-1002a0000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
1002a4000-1002a8000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
1002ac000-1002b0000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
1002b4000-1002b8000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
1002bc000-1002c0000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
1002c4000-1002c8000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
1002cc000-1002d0000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
1002d4000-1002d8000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
1002dc000-1002e0000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
1002e4000-1002e8000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
1002ec000-1002f0000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
1002f4000-1002f8000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
1002fc000-100300000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
100304000-100308000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
10030c000-100310000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
100314000-100318000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
10031c000-100320000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
100324000-100328000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
10032c000-100330000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
100334000-100338000 r-x /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
100338000-10033c000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
10033c000-100340000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
100340000-100344000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/arm64-darwin21/monitor.bundle
100344000-100348000 r-x /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/ext/parser.bundle
100348000-10034c000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/ext/parser.bundle
10034c000-100350000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/ext/parser.bundle
100350000-100354000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/ext/parser.bundle
100358000-10035c000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/ext/generator.bundle
100360000-100364000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/ext/generator.bundle
100364000-10036c000 r-x /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/ext/generator.bundle
10036c000-100370000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/ext/generator.bundle
100370000-100374000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/ext/generator.bundle
100374000-100378000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/ext/generator.bundle
10037c000-100380000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
100384000-100388000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
10038c000-100390000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
100394000-100398000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
10039c000-1003a0000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
1003a4000-1003a8000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
1003ac000-1003b0000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
1003b4000-1003b8000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
1003bc000-1003c0000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
1003c4000-1003c8000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
1003cc000-1003d0000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
1003d4000-1003d8000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
1003dc000-1003e0000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
1003e4000-1003e8000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
1003ec000-1003f0000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
1003f4000-1003f8000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
1003fc000-100400000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
100404000-100408000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
10040c000-100410000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
100414000-100418000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
10041c000-100420000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
100424000-100428000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
10042c000-100430000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
100434000-100438000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
10043c000-100440000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
100444000-100448000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
10044c000-100450000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
100454000-100458000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
10045c000-100460000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
100464000-100468000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
10046c000-100470000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
100474000-100478000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
10047c000-100480000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
100484000-100488000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
10048c000-100490000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
100494000-100498000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
10049c000-1004a0000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
1004a4000-1004d0000 r-x /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
1004d0000-1004d4000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
1004d4000-1004d8000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
1004d8000-1004f0000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/google-protobuf-3.21.12/lib/google/protobuf_c.bundle
1004f4000-1004f8000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
1004fc000-100500000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
100504000-100508000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
10050c000-100510000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
100514000-100518000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
10051c000-100520000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
100524000-100528000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
10052c000-100530000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
100534000-100538000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
10053c000-100540000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
100544000-100548000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
10054c000-100550000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
100554000-100558000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
10055c000-100560000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
100564000-100568000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
10056c000-100570000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
100574000-100578000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
10057c000-100580000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
100584000-1008a4000 r-x /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
1008a4000-1008ac000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
1008ac000-1008b0000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
1008b0000-1008bc000 rw- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
1008bc000-1009b0000 r-- /Users/ship/.asdf/installs/ruby/3.1.2/lib/libruby.3.1.dylib
stakach commented 1 year ago

We have the same issue, it only occurs on ARM - our x86 docker images have no issues and it looks likes it's an issue with the pre-packaged binaries. We reverted to version 3.21.12 which resolves the issue as the binaries are compiled on ARM with this version.

krystof-k commented 1 year ago

I'm facing probably something similar on M1 – 3.22.0 works fine, 3.22.2 throws segmentation fault:

Log ``` 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/google-protobuf-3.22.2-aarch64-linux/lib/google/protobuf/descriptor_pb.rb:7: [BUG] Segmentation fault at 0x0000000000003540 2023-03-19 17:13:35 ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5) [aarch64-linux-musl] 2023-03-19 17:13:35 2023-03-19 17:13:35 -- Control frame information ----------------------------------------------- 2023-03-19 17:13:35 c:0053 p:---- s:0311 e:000310 CFUNC :add_serialized_file 2023-03-19 17:13:35 c:0052 p:0053 s:0306 e:000305 TOP /app/vendor/bundle/ruby/2.7.0/gems/google-protobuf-3.22.2-aarch64-linux/lib/google/protobuf/descriptor_pb.rb:7 [FINISH] 2023-03-19 17:13:35 c:0051 p:---- s:0302 e:000301 CFUNC :require 2023-03-19 17:13:35 c:0050 p:0258 s:0297 e:000296 METHOD /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32 2023-03-19 17:13:35 c:0049 p:0007 s:0287 e:000286 BLOCK /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332 2023-03-19 17:13:35 c:0048 p:0068 s:0284 e:000283 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:299 2023-03-19 17:13:35 c:0047 p:0010 s:0277 e:000276 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332 2023-03-19 17:13:35 c:0046 p:0013 s:0271 e:000270 TOP /app/vendor/bundle/ruby/2.7.0/gems/google-protobuf-3.22.2-aarch64-linux/lib/google/protobuf/descriptor_dsl.rb:9 [FINISH] 2023-03-19 17:13:35 c:0045 p:---- s:0267 e:000266 CFUNC :require 2023-03-19 17:13:35 c:0044 p:0258 s:0262 e:000261 METHOD /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32 2023-03-19 17:13:35 c:0043 p:0007 s:0252 e:000251 BLOCK /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332 2023-03-19 17:13:35 c:0042 p:0068 s:0249 e:000248 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:299 2023-03-19 17:13:35 c:0041 p:0010 s:0242 e:000241 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332 2023-03-19 17:13:35 c:0040 p:0083 s:0236 e:000235 TOP /app/vendor/bundle/ruby/2.7.0/gems/google-protobuf-3.22.2-aarch64-linux/lib/google/protobuf.rb:56 [FINISH] 2023-03-19 17:13:35 c:0039 p:---- s:0233 e:000232 CFUNC :require 2023-03-19 17:13:35 c:0038 p:0258 s:0228 e:000227 METHOD /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32 2023-03-19 17:13:35 c:0037 p:0007 s:0218 e:000217 BLOCK /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332 2023-03-19 17:13:35 c:0036 p:0068 s:0215 e:000214 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:299 2023-03-19 17:13:35 c:0035 p:0010 s:0208 e:000207 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332 2023-03-19 17:13:35 c:0034 p:0005 s:0202 e:000201 TOP /app/vendor/bundle/ruby/2.7.0/gems/pg_query-2.2.1/lib/pg_query/pg_query_pb.rb:4 [FINISH] 2023-03-19 17:13:35 c:0033 p:---- s:0199 e:000198 CFUNC :require 2023-03-19 17:13:35 c:0032 p:0258 s:0194 e:000193 METHOD /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32 2023-03-19 17:13:35 c:0031 p:0007 s:0184 e:000183 BLOCK /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332 2023-03-19 17:13:35 c:0030 p:0068 s:0181 e:000180 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:299 2023-03-19 17:13:35 c:0029 p:0010 s:0174 e:000173 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332 2023-03-19 17:13:35 c:0028 p:0017 s:0168 e:000167 TOP /app/vendor/bundle/ruby/2.7.0/gems/pg_query-2.2.1/lib/pg_query.rb:4 [FINISH] 2023-03-19 17:13:35 c:0027 p:---- s:0165 e:000164 CFUNC :require 2023-03-19 17:13:35 c:0026 p:0258 s:0160 e:000159 METHOD /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32 2023-03-19 17:13:35 c:0025 p:0032 s:0150 e:000149 BLOCK /usr/local/bundle/gems/bundler-2.4.8/lib/bundler/runtime.rb:60 [FINISH] 2023-03-19 17:13:35 c:0024 p:---- s:0145 e:000144 CFUNC :each 2023-03-19 17:13:35 c:0023 p:0042 s:0141 e:000140 BLOCK /usr/local/bundle/gems/bundler-2.4.8/lib/bundler/runtime.rb:55 [FINISH] 2023-03-19 17:13:35 c:0022 p:---- s:0134 e:000133 CFUNC :each 2023-03-19 17:13:35 c:0021 p:0026 s:0130 e:000129 METHOD /usr/local/bundle/gems/bundler-2.4.8/lib/bundler/runtime.rb:44 2023-03-19 17:13:35 c:0020 p:0013 s:0125 e:000124 METHOD /usr/local/bundle/gems/bundler-2.4.8/lib/bundler.rb:195 2023-03-19 17:13:35 c:0019 p:0042 s:0120 e:000119 TOP /app/config/application.rb:8 [FINISH] 2023-03-19 17:13:35 c:0018 p:---- s:0117 e:000116 CFUNC :require 2023-03-19 17:13:35 c:0017 p:0258 s:0112 e:000111 METHOD /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32 2023-03-19 17:13:35 c:0016 p:0007 s:0102 e:000101 BLOCK /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332 2023-03-19 17:13:35 c:0015 p:0068 s:0099 e:000098 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:299 2023-03-19 17:13:35 c:0014 p:0010 s:0092 e:000091 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332 2023-03-19 17:13:35 c:0013 p:0013 s:0086 e:000085 BLOCK /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.3/lib/rails/commands/server/server_command.rb:138 [FINISH] 2023-03-19 17:13:35 c:0012 p:---- s:0081 e:000080 CFUNC :tap 2023-03-19 17:13:35 c:0011 p:0033 s:0077 e:000076 METHOD /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.3/lib/rails/commands/server/server_command.rb:135 2023-03-19 17:13:35 c:0010 p:0054 s:0073 e:000072 METHOD /app/vendor/bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor/command.rb:27 2023-03-19 17:13:35 c:0009 p:0040 s:0065 e:000064 METHOD /app/vendor/bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:127 2023-03-19 17:13:35 c:0008 p:0235 s:0058 e:000057 METHOD /app/vendor/bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor.rb:392 2023-03-19 17:13:35 c:0007 p:0045 s:0045 e:000044 METHOD /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.3/lib/rails/command/base.rb:69 2023-03-19 17:13:35 c:0006 p:0149 s:0038 e:000037 METHOD /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.3/lib/rails/command.rb:48 2023-03-19 17:13:35 c:0005 p:0063 s:0026 e:000025 TOP /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.3/lib/rails/commands.rb:18 [FINISH] 2023-03-19 17:13:35 c:0004 p:---- s:0021 e:000020 CFUNC :require 2023-03-19 17:13:35 c:0003 p:0258 s:0016 e:000015 METHOD /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32 2023-03-19 17:13:35 c:0002 p:0031 s:0006 e:000005 EVAL bin/rails:4 [FINISH] 2023-03-19 17:13:35 c:0001 p:0000 s:0003 E:0017f0 (none) [FINISH] 2023-03-19 17:13:35 2023-03-19 17:13:35 -- Ruby level backtrace information ---------------------------------------- 2023-03-19 17:13:35 bin/rails:4:in `
' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.3/lib/rails/commands.rb:18:in `
' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.3/lib/rails/command.rb:48:in `invoke' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.3/lib/rails/command/base.rb:69:in `perform' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.3/lib/rails/commands/server/server_command.rb:135:in `perform' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.3/lib/rails/commands/server/server_command.rb:135:in `tap' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.3/lib/rails/commands/server/server_command.rb:138:in `block in perform' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332:in `require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:299:in `load_dependency' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332:in `block in require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' 2023-03-19 17:13:35 /app/config/application.rb:8:in `
' 2023-03-19 17:13:35 /usr/local/bundle/gems/bundler-2.4.8/lib/bundler.rb:195:in `require' 2023-03-19 17:13:35 /usr/local/bundle/gems/bundler-2.4.8/lib/bundler/runtime.rb:44:in `require' 2023-03-19 17:13:35 /usr/local/bundle/gems/bundler-2.4.8/lib/bundler/runtime.rb:44:in `each' 2023-03-19 17:13:35 /usr/local/bundle/gems/bundler-2.4.8/lib/bundler/runtime.rb:55:in `block in require' 2023-03-19 17:13:35 /usr/local/bundle/gems/bundler-2.4.8/lib/bundler/runtime.rb:55:in `each' 2023-03-19 17:13:35 /usr/local/bundle/gems/bundler-2.4.8/lib/bundler/runtime.rb:60:in `block (2 levels) in require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/pg_query-2.2.1/lib/pg_query.rb:4:in `
' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332:in `require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:299:in `load_dependency' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332:in `block in require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/pg_query-2.2.1/lib/pg_query/pg_query_pb.rb:4:in `
' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332:in `require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:299:in `load_dependency' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332:in `block in require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/google-protobuf-3.22.2-aarch64-linux/lib/google/protobuf.rb:56:in `
' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332:in `require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:299:in `load_dependency' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332:in `block in require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/google-protobuf-3.22.2-aarch64-linux/lib/google/protobuf/descriptor_dsl.rb:9:in `
' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332:in `require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:299:in `load_dependency' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332:in `block in require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/google-protobuf-3.22.2-aarch64-linux/lib/google/protobuf/descriptor_pb.rb:7:in `
' 2023-03-19 17:13:35 /app/vendor/bundle/ruby/2.7.0/gems/google-protobuf-3.22.2-aarch64-linux/lib/google/protobuf/descriptor_pb.rb:7:in `add_serialized_file' ```
gagalago commented 1 year ago

same for me too, the 3.22.2 version throw the error when 3.22.0 is working

krystof-k commented 1 year ago

3.22.3 unfortunately still the same.

theanurin commented 1 year ago

+1 on Docker on MacBook Air M1.

/usr/local/bundle/gems/google-protobuf-3.22.3-aarch64-linux/lib/google/protobuf/descriptor_pb.rb:7: [BUG] Segmentation fault at 0x00000000000035d0
krystof-k commented 1 year ago

3.23.1 still not working.

haberman commented 1 year ago

I was able to reproduce the crash from https://github.com/semanticart/proto-segfault-example. I got the following stack trace:

-- Control frame information -----------------------------------------------
c:0005 p:---- s:0018 e:000017 CFUNC  :each
c:0004 p:0008 s:0014 e:000013 BLOCK  thread_example.rb:37 [FINISH]
c:0003 p:---- s:0010 e:000009 CFUNC  :each
c:0002 p:0009 s:0006 e:000005 BLOCK  thread_example.rb:36 [FINISH]
c:0001 p:---- s:0003 e:000002 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
thread_example.rb:36:in `block (2 levels) in <main>'
thread_example.rb:36:in `each'
thread_example.rb:37:in `block (3 levels) in <main>'
thread_example.rb:37:in `each'

-- Machine register context ------------------------------------------------
 rax: 0x000060000301da70 rbx: 0x000060000302d620 rcx: 0x000000010684b618
 rdx: 0x000070003521de18 rdi: 0x0000000000000000 rsi: 0x000000010684b618
 rbp: 0x000070003521d3c0 rsp: 0x000070003521d3c0  r8: 0x0000000000000000
  r9: 0x0000600000289328 r10: 0x000070003531dca0 r11: 0x000070003521d128
 r12: 0x0000000000000000 r13: 0x0000000055550083 r14: 0x00000001067cff40
 r15: 0x000060000301da70 rip: 0x00000001068297a4 rfl: 0x0000000000010206

-- C level backtrace information -------------------------------------------
/Users/haberman/.rubies/ruby-3.1.2/bin/ruby(rb_vm_bugreport+0x72b) [0x102cf795b]
/Users/haberman/.rubies/ruby-3.1.2/bin/ruby(rb_bug_for_fatal_signal+0x1cd) [0x102b0f5bd]
/Users/haberman/.rubies/ruby-3.1.2/bin/ruby(sigsegv+0x5b) [0x102c4e00b]
/usr/lib/system/libsystem_platform.dylib(_sigtramp+0x1d) [0x7ff806a115ed]
/Users/haberman/.gem/ruby/3.1.2/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/3.1/protobuf_c.bundle(upb_Array_Size+0x4) [0x1068297a4]
/Users/haberman/.gem/ruby/3.1.2/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/3.1/protobuf_c.bundle(RepeatedField_each+0x25) [0x106827825]
/Users/haberman/.rubies/ruby-3.1.2/bin/ruby(vm_call_cfunc_with_frame+0x157) [0x102cebb07]
/Users/haberman/.rubies/ruby-3.1.2/bin/ruby(vm_sendish+0x50d) [0x102cee1bd]
/Users/haberman/.rubies/ruby-3.1.2/bin/ruby(vm_exec_core+0x3225) [0x102ccb825]
/Users/haberman/.rubies/ruby-3.1.2/bin/ruby(rb_vm_exec+0xbcc) [0x102ce14ec]
/Users/haberman/.rubies/ruby-3.1.2/bin/ruby(invoke_block_from_c_bh+0x714) [0x102cf2834]
/Users/haberman/.rubies/ruby-3.1.2/bin/ruby(rb_yield+0xa7) [0x102cd9087]
/Users/haberman/.rubies/ruby-3.1.2/bin/ruby(range_each+0x278) [0x102c08128]
/Users/haberman/.rubies/ruby-3.1.2/bin/ruby(vm_call_cfunc_with_frame+0x157) [0x102cebb07]
/Users/haberman/.rubies/ruby-3.1.2/bin/ruby(vm_sendish+0x50d) [0x102cee1bd]
/Users/haberman/.rubies/ruby-3.1.2/bin/ruby(vm_exec_core+0x3225) [0x102ccb825]
/Users/haberman/.rubies/ruby-3.1.2/bin/ruby(rb_vm_exec+0xbcc) [0x102ce14ec]
/Users/haberman/.rubies/ruby-3.1.2/bin/ruby(rb_vm_invoke_proc+0xd3d) [0x102cdf15d]
/Users/haberman/.rubies/ruby-3.1.2/bin/ruby(thread_do_start_proc+0x2a0) [0x102c99e50]
/Users/haberman/.rubies/ruby-3.1.2/bin/ruby(thread_start_func_2+0x4eb) [0x102c995ab]
/Users/haberman/.rubies/ruby-3.1.2/bin/ruby(thread_start_func_1+0x10d) [0x102c98efd]
/usr/lib/system/libsystem_pthread.dylib(_pthread_start+0x7d) [0x7ff8069e41d3]
semanticart commented 1 year ago

@haberman That's good to hear!

haberman commented 1 year ago

This appears to be a race condition involving the object cache.

With assertions enabled, I've isolated this to two different assertion failures:

repeated_crash_test.rb:39: [BUG] Assertion failed at ruby/ext/google/protobuf_c/protobuf.c:406, expr: ObjectCache_Get(key) == val
ruby 3.2.1 (2023-02-08 revision 31819e82c8) [x86_64-darwin22]

-- C level backtrace information -------------------------------------------
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(rb_vm_bugreport+0x7cb) [0x106b711bb]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(rb_bug_without_die+0x17b) [0x10697acbb]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(rb_bug+0x6f) [0x106b7efd9]
/private/var/tmp/_bazel_haberman/4ceeddaa0759d4b2bc7fa2dfc50ab669/execroot/com_google_protobuf/bazel-out/darwin-dbg/bin/ruby/lib/google/protobuf_c.bundle(ObjectCache_Add+0xaf) [0x10977a44f]
/private/var/tmp/_bazel_haberman/4ceeddaa0759d4b2bc7fa2dfc50ab669/execroot/com_google_protobuf/bazel-out/darwin-dbg/bin/ruby/lib/google/protobuf_c.bundle(RepeatedField_GetRubyWrapper+0x7b) [0x10977adab]
/private/var/tmp/_bazel_haberman/4ceeddaa0759d4b2bc7fa2dfc50ab669/execroot/com_google_protobuf/bazel-out/darwin-dbg/bin/ruby/lib/google/protobuf_c.bundle(Message_getfield+0x136) [0x109775476]
/private/var/tmp/_bazel_haberman/4ceeddaa0759d4b2bc7fa2dfc50ab669/execroot/com_google_protobuf/bazel-out/darwin-dbg/bin/ruby/lib/google/protobuf_c.bundle(Message_field_accessor+0x427) [0x109779677]
/private/var/tmp/_bazel_haberman/4ceeddaa0759d4b2bc7fa2dfc50ab669/execroot/com_google_protobuf/bazel-out/darwin-dbg/bin/ruby/lib/google/protobuf_c.bundle(Message_method_missing+0x139) [0x109777bf9]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(vm_call_cfunc_with_frame+0x157) [0x106b64b97]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(vm_call_method_missing_body+0x1d6) [0x106b65fd6]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(vm_sendish+0x4ae) [0x106b6735e]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(vm_exec_core+0x2b8d) [0x106b4536d]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(rb_vm_exec+0xc6c) [0x106b5a34c]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(invoke_block_from_c_bh+0x703) [0x106b6bc33]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(rb_yield+0xa7) [0x106b51f27]
/private/var/tmp/_bazel_haberman/4ceeddaa0759d4b2bc7fa2dfc50ab669/execroot/com_google_protobuf/bazel-out/darwin-dbg/bin/ruby/lib/google/protobuf_c.bundle(RepeatedField_each+0x80) [0x10977c4f0]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(vm_call_cfunc_with_frame+0x157) [0x106b64b97]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(vm_sendish+0x4ae) [0x106b6735e]

And:

repeated_crash_test.rb:39: [BUG] Assertion failed at ruby/ext/google/protobuf_c/repeated_field.c:100, expr: ruby_to_RepeatedField(val)->type_info.type == type_info.type
ruby 3.2.1 (2023-02-08 revision 31819e82c8) [x86_64-darwin22]

-- C level backtrace information -------------------------------------------
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(rb_vm_bugreport+0x7cb) [0x10a7671bb]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(rb_bug_without_die+0x17b) [0x10a570cbb]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(rb_bug+0x6f) [0x10a774fd9]
/private/var/tmp/_bazel_haberman/4ceeddaa0759d4b2bc7fa2dfc50ab669/execroot/com_google_protobuf/bazel-out/darwin-dbg/bin/ruby/lib/google/protobuf_c.bundle(RepeatedField_GetRubyWrapper+0x117) [0x10d36ae47]
/private/var/tmp/_bazel_haberman/4ceeddaa0759d4b2bc7fa2dfc50ab669/execroot/com_google_protobuf/bazel-out/darwin-dbg/bin/ruby/lib/google/protobuf_c.bundle(Message_getfield+0x136) [0x10d365476]
/private/var/tmp/_bazel_haberman/4ceeddaa0759d4b2bc7fa2dfc50ab669/execroot/com_google_protobuf/bazel-out/darwin-dbg/bin/ruby/lib/google/protobuf_c.bundle(Message_field_accessor+0x427) [0x10d369677]
/private/var/tmp/_bazel_haberman/4ceeddaa0759d4b2bc7fa2dfc50ab669/execroot/com_google_protobuf/bazel-out/darwin-dbg/bin/ruby/lib/google/protobuf_c.bundle(Message_method_missing+0x139) [0x10d367bf9]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(vm_call_cfunc_with_frame+0x157) [0x10a75ab97]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(vm_call_method_missing_body+0x1d6) [0x10a75bfd6]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(vm_sendish+0x4ae) [0x10a75d35e]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(vm_exec_core+0x2b8d) [0x10a73b36d]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(rb_vm_exec+0xc6c) [0x10a75034c]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(invoke_block_from_c_bh+0x703) [0x10a761c33]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(rb_yield+0xa7) [0x10a747f27]
/private/var/tmp/_bazel_haberman/4ceeddaa0759d4b2bc7fa2dfc50ab669/execroot/com_google_protobuf/bazel-out/darwin-dbg/bin/ruby/lib/google/protobuf_c.bundle(RepeatedField_each+0x80) [0x10d36c4f0]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(vm_call_cfunc_with_frame+0x157) [0x10a75ab97]
/Users/haberman/.rubies/ruby-3.2.1/bin/ruby(vm_sendish+0x4ae) [0x10a75d35e] 

This looks really similar to what @casperisfine was debugging in https://github.com/protocolbuffers/protobuf/pull/12216

haberman commented 1 year ago

Also I was able to make the test case more reproducible with less output by using GC.stress:

require 'json'
require 'google/protobuf'

Google::Protobuf::DescriptorPool.generated_pool.build do
  add_message 'example.Config' do
    repeated :rows, :message, 1, 'example.ConfigRow'
  end

  add_message 'example.ConfigRow' do
    repeated :values, :message, 1, 'example.Value'
  end 

  add_message 'example.Value' do
    optional :string, :string, 1
  end 
end 

module Example
  Config = Google::Protobuf::DescriptorPool.generated_pool.lookup('example.Config').msgclass
  ConfigRow = Google::Protobuf::DescriptorPool.generated_pool.lookup('example.ConfigRow').msgclass
  Value = Google::Protobuf::DescriptorPool.generated_pool.lookup('example.Value').msgclass
end 

content = { "rows": [{ "values": [{ "string": 'hello' }] },
                     { "values": [{ "string": 'thanks' }] }] }.to_json

config = Example::Config.decode_json(content)

thread_count = 2
iterations_per_thread = 100

GC.stress = 0x01 | 0x04

threads = []
(1..thread_count).each do |i|
  threads << Thread.new do
    (1..iterations_per_thread).each do |iter|
      config.rows.each do |row|
        row.values.each do |conditional_value|
          conditional_value
        end
      end
    end
  end
end 

threads.map(&:join)

puts 'DONE!'
opsengine commented 1 year ago

I bisected the latest repro to https://github.com/protocolbuffers/protobuf/commit/a00125024e9231d76746bd394fef8876f5cc15e2

Can someone confirm?

BrianBland commented 1 year ago

For what it's worth, the repro can be even further simplified, as it looks like simply fetching the size of the repeated field is sufficient to cause a segfault. It even happens if the values themselves are empty, but not if there's only one row. Here's a smaller repro:

require 'json'
require 'google/protobuf'

Google::Protobuf::DescriptorPool.generated_pool.build do
  add_message 'example.Config' do
    repeated :rows, :message, 1, 'example.ConfigRow'
  end

  add_message 'example.ConfigRow' do
    repeated :values, :string, 1
  end 
end 

module Example
  Config = Google::Protobuf::DescriptorPool.generated_pool.lookup('example.Config').msgclass
  ConfigRow = Google::Protobuf::DescriptorPool.generated_pool.lookup('example.ConfigRow').msgclass
end 

content = { "rows": [{}, {}] }.to_json

config = Example::Config.decode_json(content)

thread_count = 2
iterations_per_thread = 100

GC.stress = 0x04

threads = []
(1..thread_count).each do |i|
  threads << Thread.new do
    (1..iterations_per_thread).each do |iter|
      config.rows.each do |row|
        row.values.size
      end
    end
  end
end 

threads.map(&:join)

Oddly enough, calling row.json in the inner loop instead of row.values.size does not trigger a segfault.

opsengine commented 1 year ago

The weak map implementation of the object cache introduced here is not thread safe.

Here's a timeline of the relevant commits and the results on Mac OS.

a0012502 (v3.15.0)
introduce weak map, which has a concurrency bug
ruby 2.6 works
ruby 2.7 SEGV
ruby 2.7 works if USE_WEAK_MAP=0

9879f423 (v3.15.3)
extend weak map to ruby 2.6. remove strong map. replace USE_WEAK_MAP with USE_SECONDARY_MAP (its inverse)
ruby 2.6 SEGV
ruby 2.6 breaks with ArgumentError if USE_SECONDARY_MAP=0
ruby 2.7 SEGV regardless of USE_SECONDARY_MAP

f0d6fcb2 (v3.15.7)
add mutex for secondary map
ruby 2.6 SEGV
ruby 2.6 breaks with ArgumentError if USE_SECONDARY_MAP=0
ruby 2.7 SEGV

2fe27d87 (v3.15.7)
fix mutex usage
ruby 2.6 works
ruby 2.6 breaks with ArgumentError if USE_SECONDARY_MAP=0
ruby 2.7 SEGV
ruby 2.7 works if USE_SECONDARY_MAP=1

We could do one of these 3: 1) Make USE_SECONDARY_MAP configurable at build time so that the user can set it to 1. This is the easiest fix 2) Restore strong cache implementation removed in 9879f423 3) Fix weak map

haberman commented 1 year ago

If USE_SECONDARY_MAP fixes the problem, and we don't have any other fix available at the moment, we should just do that for now (by default).

casperisfine commented 1 year ago

The problem is that if I'm not mistaken USE_SECONDARY_MAP tend to cause "leaks" (not per say but IIRC the memory use is severely increased).

haberman commented 1 year ago

Hmm, I don't want to make users choose between much higher memory usage and SEGV race conditions.

@casperisfine from what you said before, it sounds like we could almost write our own weak map, but there is one missing function that we would need. Any possible workarounds for that?

casperisfine commented 1 year ago

but there is one missing function that we would need.

Yes, we'd need rb_objspace_garbage_object_p which is not exposed to the API (https://github.com/protocolbuffers/protobuf/pull/12216#issuecomment-1494042832).

I don't think there's a way to work around that I'm afraid. We could make a feature request for it, but it would at best come with Ruby 3.3 at the end of the year, and IIRC all current issues are already fixed in WeakMap upstream (and will be backported eventually).

I haven't dug in this issue though, not 100% sure if it's caused by the bugs I fixed in Ruby's WeakMap.

casperisfine commented 1 year ago

Ah I see there is a minimal reproduction provided, it should be easy to check if it's fixed on ruby-head. (it's late here though, so I'm not gonna do it now)

haberman commented 1 year ago

Yes, we'd need rb_objspace_garbage_object_p which is not exposed to the API (https://github.com/protocolbuffers/protobuf/pull/12216#issuecomment-1494042832).

It looks like that symbol is available in Ruby 2.7 up to 3.0, but was removed in 3.1. :(

$ readelf -W --dyn-syms ~/.rubies/ruby-2.7.6/bin/ruby | grep rb_objspace_garbage_object_p
   901: 000000000003f140    99 FUNC    GLOBAL DEFAULT   15 rb_objspace_garbage_object_p
$ readelf -W --dyn-syms ~/.rubies/ruby-3.0.6/bin/ruby | grep rb_objspace_garbage_object_p
   919: 000000000004b180    99 FUNC    GLOBAL DEFAULT   15 rb_objspace_garbage_object_p
$ readelf -W --dyn-syms ~/.rubies/ruby-3.1.2/bin/ruby | grep rb_objspace_garbage_object_p
$ readelf -W --dyn-syms ~/.rubies/ruby-3.2.2/bin/ruby | grep rb_objspace_garbage_object_p
casperisfine commented 1 year ago

it should be easy to check if it's fixed on ruby-head.

So apparently it's still crashing on ruby-head.

* thread #3, name = 'proto-repro.rb:30', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
  * frame #0: 0x0000000106e46ff4 protobuf_c.bundle`upb_Array_Size
    frame #1: 0x0000000106e45800 protobuf_c.bundle`RepeatedField_length + 28
    frame #2: 0x000000010022dddc ruby`vm_call_cfunc_with_frame_(ec=0x0000000105f8e810, reg_cfp=0x0000000170092be0, calling=<unavailable>, argc=0, argv=0x000000016ff92e18, stack_bottom=0x000000016ff92e10) at vm_insnhelper.c:3438:11
    frame #3: 0x00000001002130bc ruby`vm_exec_core [inlined] vm_sendish(ec=0x0000000105f8e810, reg_cfp=0x0000000170092be0, cd=0x0000600000232350, block_handler=0, method_explorer=mexp_search_method) at vm_insnhelper.c:5492:15
    frame #4: 0x0000000100212ff0 ruby`vm_exec_core(ec=<unavailable>, initial=<unavailable>) at insns.def:835:11
    frame #5: 0x0000000100224ac4 ruby`rb_vm_exec(ec=0x0000000105f8e810) at vm.c:0:28
    frame #6: 0x0000000100235b68 ruby`invoke_block_from_c_bh [inlined] invoke_iseq_block_from_c(ec=0x0000000105f8e810, captured=<unavailable>, self=4302228880, argc=<unavailable>, argv=<unavailable>, kw_splat=<unavailable>, passed_block_handler=<unavailable>, cref=0x0000000000000000, is_lambda=0, me=0x0000000000000000) at vm.c:0
    frame #7: 0x0000000100235994 ruby`invoke_block_from_c_bh(ec=0x0000000105f8e810, block_handler=<unavailable>, argc=<unavailable>, argv=<unavailable>, kw_splat=<unavailable>, passed_block_handler=<unavailable>, cref=<unavailable>, is_lambda=<unavailable>, force_blockarg=0) at vm.c:1474:20
    frame #8: 0x000000010021e354 ruby`rb_yield(val=<unavailable>) at vm_eval.c:0
    frame #9: 0x0000000106e4510c protobuf_c.bundle`RepeatedField_each + 88
casperisfine commented 1 year ago

We investigated this with @peterzhu2118 and found the fix: https://github.com/protocolbuffers/protobuf/pull/13054

It's a fairly basic race condition.

fowles commented 1 year ago

This is a great find. Thanks for doing it. I am going to take the discussion over to the PR itself

haberman commented 1 year ago

Using the repro in https://github.com/semanticart/proto-segfault-example, I was able to confirm that 3.24.0.rc.2 (which contains the fix from https://github.com/protocolbuffers/protobuf/pull/13204) fixes the issue.

krystof-k commented 1 year ago

Unfortunately, 3.24.0.rc.2 is still not working for me on M1.

Log ``` /app/vendor/bundle/ruby/2.7.0/gems/google-protobuf-3.24.0.rc.2-aarch64-linux/lib/google/protobuf/descriptor_pb.rb:13: [BUG] Segmentation fault at 0x00000000000038a0 ruby 2.7.8p225 (2023-03-30 revision 1f4d455848) [aarch64-linux-musl] -- Control frame information ----------------------------------------------- c:0053 p:---- s:0317 e:000316 CFUNC :add_serialized_file c:0052 p:0037 s:0312 e:000311 TOP /app/vendor/bundle/ruby/2.7.0/gems/google-protobuf-3.24.0.rc.2-aarch64-linux/lib/google/protobuf/descriptor_pb.rb:13 [FINISH] c:0051 p:---- s:0302 e:000301 CFUNC :require c:0050 p:0258 s:0297 e:000296 METHOD /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32 c:0049 p:0007 s:0287 e:000286 BLOCK /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332 c:0048 p:0068 s:0284 e:000283 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:299 c:0047 p:0010 s:0277 e:000276 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332 c:0046 p:0013 s:0271 e:000270 TOP /app/vendor/bundle/ruby/2.7.0/gems/google-protobuf-3.24.0.rc.2-aarch64-linux/lib/google/protobuf/descriptor_dsl.rb:9 [FINISH] c:0045 p:---- s:0267 e:000266 CFUNC :require c:0044 p:0258 s:0262 e:000261 METHOD /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32 c:0043 p:0007 s:0252 e:000251 BLOCK /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332 c:0042 p:0068 s:0249 e:000248 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:299 c:0041 p:0010 s:0242 e:000241 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332 c:0040 p:0089 s:0236 e:000235 TOP /app/vendor/bundle/ruby/2.7.0/gems/google-protobuf-3.24.0.rc.2-aarch64-linux/lib/google/protobuf.rb:57 [FINISH] c:0039 p:---- s:0233 e:000232 CFUNC :require c:0038 p:0258 s:0228 e:000227 METHOD /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32 c:0037 p:0007 s:0218 e:000217 BLOCK /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332 c:0036 p:0068 s:0215 e:000214 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:299 c:0035 p:0010 s:0208 e:000207 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332 c:0034 p:0005 s:0202 e:000201 TOP /app/vendor/bundle/ruby/2.7.0/gems/pg_query-2.2.1/lib/pg_query/pg_query_pb.rb:4 [FINISH] c:0033 p:---- s:0199 e:000198 CFUNC :require c:0032 p:0258 s:0194 e:000193 METHOD /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32 c:0031 p:0007 s:0184 e:000183 BLOCK /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332 c:0030 p:0068 s:0181 e:000180 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:299 c:0029 p:0010 s:0174 e:000173 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332 c:0028 p:0017 s:0168 e:000167 TOP /app/vendor/bundle/ruby/2.7.0/gems/pg_query-2.2.1/lib/pg_query.rb:4 [FINISH] c:0027 p:---- s:0165 e:000164 CFUNC :require c:0026 p:0258 s:0160 e:000159 METHOD /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32 c:0025 p:0032 s:0150 e:000149 BLOCK /usr/local/bundle/gems/bundler-2.4.8/lib/bundler/runtime.rb:60 [FINISH] c:0024 p:---- s:0145 e:000144 CFUNC :each c:0023 p:0042 s:0141 e:000140 BLOCK /usr/local/bundle/gems/bundler-2.4.8/lib/bundler/runtime.rb:55 [FINISH] c:0022 p:---- s:0134 e:000133 CFUNC :each c:0021 p:0026 s:0130 e:000129 METHOD /usr/local/bundle/gems/bundler-2.4.8/lib/bundler/runtime.rb:44 c:0020 p:0013 s:0125 e:000124 METHOD /usr/local/bundle/gems/bundler-2.4.8/lib/bundler.rb:195 c:0019 p:0042 s:0120 e:000119 TOP /app/config/application.rb:8 [FINISH] c:0018 p:---- s:0117 e:000116 CFUNC :require c:0017 p:0258 s:0112 e:000111 METHOD /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32 c:0016 p:0007 s:0102 e:000101 BLOCK /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332 c:0015 p:0068 s:0099 e:000098 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:299 c:0014 p:0010 s:0092 e:000091 METHOD /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332 c:0013 p:0013 s:0086 e:000085 BLOCK /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.4/lib/rails/commands/server/server_command.rb:138 [FINISH] c:0012 p:---- s:0081 e:000080 CFUNC :tap c:0011 p:0033 s:0077 e:000076 METHOD /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.4/lib/rails/commands/server/server_command.rb:135 c:0010 p:0054 s:0073 e:000072 METHOD /app/vendor/bundle/ruby/2.7.0/gems/thor-1.2.2/lib/thor/command.rb:27 c:0009 p:0040 s:0065 e:000064 METHOD /app/vendor/bundle/ruby/2.7.0/gems/thor-1.2.2/lib/thor/invocation.rb:127 c:0008 p:0235 s:0058 e:000057 METHOD /app/vendor/bundle/ruby/2.7.0/gems/thor-1.2.2/lib/thor.rb:392 c:0007 p:0045 s:0045 e:000044 METHOD /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.4/lib/rails/command/base.rb:69 c:0006 p:0149 s:0038 e:000037 METHOD /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.4/lib/rails/command.rb:48 c:0005 p:0063 s:0026 e:000025 TOP /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.4/lib/rails/commands.rb:18 [FINISH] c:0004 p:---- s:0021 e:000020 CFUNC :require c:0003 p:0258 s:0016 e:000015 METHOD /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32 c:0002 p:0031 s:0006 e:000005 EVAL bin/rails:4 [FINISH] c:0001 p:0000 s:0003 E:000470 (none) [FINISH] -- Ruby level backtrace information ---------------------------------------- bin/rails:4:in `
' /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.4/lib/rails/commands.rb:18:in `
' /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.4/lib/rails/command.rb:48:in `invoke' /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.4/lib/rails/command/base.rb:69:in `perform' /app/vendor/bundle/ruby/2.7.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch' /app/vendor/bundle/ruby/2.7.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command' /app/vendor/bundle/ruby/2.7.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run' /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.4/lib/rails/commands/server/server_command.rb:135:in `perform' /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.4/lib/rails/commands/server/server_command.rb:135:in `tap' /app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.7.4/lib/rails/commands/server/server_command.rb:138:in `block in perform' /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332:in `require' /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:299:in `load_dependency' /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332:in `block in require' /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' /app/config/application.rb:8:in `
' /usr/local/bundle/gems/bundler-2.4.8/lib/bundler.rb:195:in `require' /usr/local/bundle/gems/bundler-2.4.8/lib/bundler/runtime.rb:44:in `require' /usr/local/bundle/gems/bundler-2.4.8/lib/bundler/runtime.rb:44:in `each' /usr/local/bundle/gems/bundler-2.4.8/lib/bundler/runtime.rb:55:in `block in require' /usr/local/bundle/gems/bundler-2.4.8/lib/bundler/runtime.rb:55:in `each' /usr/local/bundle/gems/bundler-2.4.8/lib/bundler/runtime.rb:60:in `block (2 levels) in require' /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' /app/vendor/bundle/ruby/2.7.0/gems/pg_query-2.2.1/lib/pg_query.rb:4:in `
' /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332:in `require' /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:299:in `load_dependency' /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332:in `block in require' /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' /app/vendor/bundle/ruby/2.7.0/gems/pg_query-2.2.1/lib/pg_query/pg_query_pb.rb:4:in `
' /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332:in `require' /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:299:in `load_dependency' /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332:in `block in require' /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' /app/vendor/bundle/ruby/2.7.0/gems/google-protobuf-3.24.0.rc.2-aarch64-linux/lib/google/protobuf.rb:57:in `
' /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332:in `require' /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:299:in `load_dependency' /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332:in `block in require' /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' /app/vendor/bundle/ruby/2.7.0/gems/google-protobuf-3.24.0.rc.2-aarch64-linux/lib/google/protobuf/descriptor_dsl.rb:9:in `
' /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332:in `require' /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:299:in `load_dependency' /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.7.4/lib/active_support/dependencies.rb:332:in `block in require' /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' /app/vendor/bundle/ruby/2.7.0/gems/google-protobuf-3.24.0.rc.2-aarch64-linux/lib/google/protobuf/descriptor_pb.rb:13:in `
' /app/vendor/bundle/ruby/2.7.0/gems/google-protobuf-3.24.0.rc.2-aarch64-linux/lib/google/protobuf/descriptor_pb.rb:13:in `add_serialized_file' ```
haberman commented 1 year ago

@krystof-k that stack trace looks unrelated to what is described in this bug. Could you open a new bug with a repro for this crash?

krystof-k commented 1 year ago

I opened #13355. I have no idea how to create a repro, I'm just using a gem which has protobuf as a dependency.