-
Notifications
You must be signed in to change notification settings - Fork 15.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seg Fault when running ruby google-protobuf 3.22.2 and newer #12904
Comments
Similar issue has been happened and pinning What version of protobuf and what language are you using? What operating system (Linux, Windows, ...) and version? Linux (debian 10.13 docker image, running on Amazon Linux 2) What runtime / compiler are you using (e.g., python version or gcc version) What did you see instead? error logs "message": "-- C level backtrace information -------------------------------------------",
"message": " R11: 0x0000563d94887950 R12: 0xcccccccccccccccd R13: 0x000000000008738e",
"message": " R14: 0x0000000000005024 R15: 0x0000563d957e8028 EFL: 0x0000000000010202",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/errors.rb:123: [BUG] Segmentation fault at 0x00007fc298af1fe6",
"message": "ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x86_64-linux]",
"message": "-- Control frame information -----------------------------------------------",
"message": "c:0047 p:---- s:0225 e:000224 CFUNC :each",
"message": "c:0046 p:---- s:0222 e:000221 CFUNC :map",
"message": "c:0045 p:0032 s:0218 e:000214 BLOCK /usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/errors.rb:123 [FINISH]",
"message": "c:0044 p:---- s:0208 e:000207 IFUNC ",
"message": "c:0043 p:---- s:0205 e:000204 CFUNC :each",
"message": "c:0042 p:---- s:0202 e:000201 CFUNC :each_with_object",
"message": "c:0041 p:0094 s:0197 e:000196 CLASS /usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/errors.rb:122",
"message": "c:0040 p:0007 s:0194 e:000193 CLASS /usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/errors.rb:22",
"message": "c:0039 p:0007 s:0191 e:000190 CLASS /usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/errors.rb:21",
"message": "c:0038 p:0007 s:0188 e:000187 CLASS /usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/errors.rb:20",
"message": "c:0037 p:0007 s:0185 e:000184 TOP /usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/errors.rb:19 [FINISH]",
"message": "c:0036 p:---- s:0182 e:000181 CFUNC :require",
"message": "c:0035 p:0258 s:0177 e:000176 METHOD /usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32",
"message": "c:0034 p:0007 s:0167 e:000166 BLOCK /usr/local/lib/ruby/gems/3.0.0/gems/activesupport-6.0.4.8/lib/active_support/dependencies.rb:324",
"message": "c:0033 p:0068 s:0164 e:000163 METHOD /usr/local/lib/ruby/gems/3.0.0/gems/activesupport-6.0.4.8/lib/active_support/dependencies.rb:291",
"message": "c:0032 p:0010 s:0157 e:000156 METHOD /usr/local/lib/ruby/gems/3.0.0/gems/activesupport-6.0.4.8/lib/active_support/dependencies.rb:324",
"message": "c:0031 p:0047 s:0151 e:000150 TOP /usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/google_ads_client.rb:27 [FINISH]",
"message": "c:0030 p:---- s:0148 e:000147 CFUNC :require",
"message": "c:0029 p:0258 s:0143 e:000142 METHOD /usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32",
"message": "c:0028 p:0007 s:0133 e:000132 BLOCK /usr/local/lib/ruby/gems/3.0.0/gems/activesupport-6.0.4.8/lib/active_support/dependencies.rb:324",
"message": "c:0027 p:0068 s:0130 e:000129 METHOD /usr/local/lib/ruby/gems/3.0.0/gems/activesupport-6.0.4.8/lib/active_support/dependencies.rb:291",
"message": "c:0026 p:0010 s:0123 e:000122 METHOD /usr/local/lib/ruby/gems/3.0.0/gems/activesupport-6.0.4.8/lib/active_support/dependencies.rb:324",
"message": "c:0025 p:0011 s:0117 e:000116 TOP /usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads.rb:19 [FINISH]",
"message": "c:0024 p:---- s:0114 e:000113 CFUNC :require",
"message": "c:0023 p:0258 s:0109 e:000108 METHOD /usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32",
"message": "c:0022 p:0032 s:0099 e:000098 BLOCK /usr/local/lib/ruby/gems/3.0.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:74 [FINISH]",
"message": "c:0021 p:---- s:0094 e:000093 CFUNC :each",
"message": "c:0020 p:0042 s:0090 e:000089 BLOCK /usr/local/lib/ruby/gems/3.0.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69 [FINISH]",
"message": "c:0019 p:---- s:0083 e:000082 CFUNC :each",
"message": "c:0018 p:0026 s:0079 e:000078 METHOD /usr/local/lib/ruby/gems/3.0.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58",
"message": "c:0017 p:0013 s:0074 e:000073 METHOD /usr/local/lib/ruby/gems/3.0.0/gems/bundler-2.1.4/lib/bundler.rb:174",
"message": "c:0016 p:0076 s:0069 e:000068 TOP /work/config/application.rb:11 [FINISH]",
"message": "c:0015 p:---- s:0065 e:000064 CFUNC :require_relative",
"message": "c:0014 p:0005 s:0060 e:000059 TOP /work/Rakefile:4 [FINISH]",
"message": "c:0013 p:---- s:0057 e:000056 CFUNC :load",
"message": "c:0012 p:0005 s:0052 e:000051 METHOD /usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/rake_module.rb:29",
"message": "c:0011 p:0180 s:0047 e:000046 METHOD /usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:710",
"message": "c:0010 p:0004 s:0041 e:000040 BLOCK /usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:104",
"message": "c:0009 p:0002 s:0038 e:000037 METHOD /usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:186",
"message": "c:0008 p:0004 s:0033 e:000032 METHOD /usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:103",
"message": "c:0007 p:0012 s:0029 e:000028 BLOCK /usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:82",
"message": "c:0006 p:0002 s:0026 e:000025 METHOD /usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:186",
"message": "c:0005 p:0015 s:0021 e:000020 METHOD /usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:80",
"message": "c:0004 p:0019 s:0016 e:000015 TOP /usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/exe/rake:27 [FINISH]",
"message": "c:0003 p:---- s:0013 e:000012 CFUNC :load",
"message": "c:0002 p:0124 s:0008 E:001480 EVAL /usr/local/bin/rake:25 [FINISH]",
"message": "c:0001 p:0000 s:0003 E:000540 (none) [FINISH]",
"message": "-- Ruby level backtrace information ----------------------------------------",
"message": "/usr/local/bin/rake:25:in `<main>'",
"message": "/usr/local/bin/rake:25:in `load'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:82:in `block in run'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:103:in `load_rakefile'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:104:in `block in load_rakefile'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:710:in `raw_load_rakefile'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/rake_module.rb:29:in `load_rakefile'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/rake_module.rb:29:in `load'",
"message": "/work/Rakefile:4:in `<top (required)>'",
"message": "/work/Rakefile:4:in `require_relative'",
"message": "/work/config/application.rb:11:in `<top (required)>'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/bundler-2.1.4/lib/bundler.rb:174:in `require'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `require'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `each'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `block in require'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `each'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `block (2 levels) in require'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads.rb:19:in `<main>'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/activesupport-6.0.4.8/lib/active_support/dependencies.rb:324:in `require'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/activesupport-6.0.4.8/lib/active_support/dependencies.rb:291:in `load_dependency'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/activesupport-6.0.4.8/lib/active_support/dependencies.rb:324:in `block in require'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/google_ads_client.rb:27:in `<main>'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/activesupport-6.0.4.8/lib/active_support/dependencies.rb:324:in `require'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/activesupport-6.0.4.8/lib/active_support/dependencies.rb:291:in `load_dependency'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/activesupport-6.0.4.8/lib/active_support/dependencies.rb:324:in `block in require'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/errors.rb:19:in `<main>'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/errors.rb:20:in `<module:Google>'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/errors.rb:21:in `<module:Ads>'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/errors.rb:22:in `<module:GoogleAds>'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/errors.rb:122:in `<module:Errors>'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/errors.rb:122:in `each_with_object'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/errors.rb:122:in `each'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/errors.rb:123:in `block in <module:Errors>'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/errors.rb:123:in `map'",
"message": "/usr/local/lib/ruby/gems/3.0.0/gems/google-ads-googleads-22.1.0/lib/google/ads/google_ads/errors.rb:123:in `each'",
"message": "-- Machine register context ------------------------------------------------",
"message": " RIP: 0x00007fc298ead799 RBP: 0x0000563d8cd116a0 RSP: 0x00007ffda6a84900",
"message": " RAX: 0x61e2005d70255b20 RBX: 0x00007fc298b29ca0 RCX: 0x00007fc298af1fe6",
"message": " RDX: 0x0000000000000037 RDI: 0x0000563d8cd116a0 RSI: 0xcccccccccccccccd",
"message": " R8: 0x000000000000002c R9: 0x0000563d94884010 R10: 0x00007fc29896e870",
(snip) |
I was able to reproduce this. I reduced it to a one-liner:
I think this started in 3.22.2 because that was the first version that included a binary gem for aarch64-linux. This also appears to be specific to Alpine and the gcompat package. For the Debian-based Ruby image, it works fine:
|
@dazuma This appears to be an issue with the aarch64-linux binary gem. It seems like there are two possible resolutions:
Ideally there would be a way to teach the |
The binary gems are not compatible with Alpine. This has been a problem since time immemorial, and we haven't yet found a good solution for it. The workaround is to pass |
Thanks Daniel. I'm closing this bug per #12904 (comment), which has suggested workarounds. |
@dazuma is there anything preventing publishing precompiled gems with platform |
Are there any other work arounds besides setting
It seems like One temporary but not great solution, I find if I edit our Gemfile.lock by hand and change Really hoping there's a better fix for this issue. |
Just wanted to update that I was able to fix my issue by adding the following to my Gemfile:
I didn't realize this option could be set on a gem but it appears to work on the latest bundler. For anyone that also runs into this, setting |
It’s sub-optimal to have to compile all your gems from source (when adding The very hack workaround I’m using right now is this:
|
What version of protobuf and what language are you using?
Version: from 3.22.2 to 3.23.1 (no problem in 3.22.1)
Language: ruby
What operating system (Linux, Windows, ...) and version?
alpine3.18 (docker image running in mac m1)
What runtime / compiler are you using (e.g., python version or gcc version)
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [aarch64-linux-musl]
What did you do?
I created a test repo here https://github.com/lamphanqg/test_protobuf
You can clone it, run
docker-compose run --rm ruby bash
, thenbundle install
andbundle exec rails s
inside the container.What did you expect to see
Rails server can start like with version 3.22.1
What did you see instead?
Please check full log in attached file. It's too long to paste here.
log.txt
Anything else we should know about your project / environment
Actually we don't use protobuf directly. It's just a dependency of the pg_query gem that we use.
The text was updated successfully, but these errors were encountered: