Skip to content
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

Throw exception in Any.encode #4718

Closed
igorpeshansky opened this issue Jun 3, 2018 · 8 comments
Closed

Throw exception in Any.encode #4718

igorpeshansky opened this issue Jun 3, 2018 · 8 comments
Assignees

Comments

@igorpeshansky
Copy link
Contributor

The following reliably crashes all three of ruby-2.2.7, ruby-2.3.4, and ruby-2.4.1 for me:

ruby -e "require 'google/gax'; require 'google/logging/v2/logging_pb'; Google::Protobuf::Any.encode(Google::Logging::V2::WriteLogEntriesPartialErrors.new)"

Here's the full output for ruby-2.2.7. Happy to provide the output for other rubies and attach the crash reports if it helps:

-e:1: [BUG] Segmentation fault at 0x00000000000000
ruby 2.2.7p470 (2017-03-28 revision 58194) [x86_64-darwin16]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/CrashReporter
     * /Library/Logs/CrashReporter
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   for more details.

-- Control frame information -----------------------------------------------
c:0003 p:---- s:0008 e:000007 CFUNC  :encode
c:0002 p:0042 s:0004 E:001fa0 EVAL   -e:1 [FINISH]
c:0001 p:0000 s:0002 E:0014b0 TOP    [FINISH]

-- Ruby level backtrace information ----------------------------------------
-e:1:in `<main>'
-e:1:in `encode'

-- Machine register context ------------------------------------------------
 rax: 0x0000000000000000 rbx: 0x00007f8fa74c8860 rcx: 0x00007f8fa744e0c0
 rdx: 0x0000000000000002 rdi: 0x2e322e322d796275 rsi: 0x00007f8fa74c8860
 rbp: 0x00007ffeebf7cf50 rsp: 0x00007ffeebf7cd10  r8: 0x0000000000000000
  r9: 0x0000000000000000 r10: 0x000007f8faa42b51 r11: 0x0000000000000032
 r12: 0x0000000000000018 r13: 0xf004edfc2246003a r14: 0x00007ffeebf7cdb8
 r15: 0x0000000000000000 rip: 0x00000001043d1a84 rfl: 0x0000000000010246

-- C level backtrace information -------------------------------------------
0   libruby.2.2.0.dylib                 0x0000000103e255b1 rb_vm_bugreport + 145
1   libruby.2.2.0.dylib                 0x0000000103cc9145 rb_bug_context + 437
2   libruby.2.2.0.dylib                 0x0000000103d9e604 sigsegv + 68
3   libsystem_platform.dylib            0x00007fff72593f5a _sigtramp + 26
4   protobuf_c.bundle                   0x00000001043d1a84 putmsg + 1892
5   protobuf_c.bundle                   0x00000001043d12cf Message_encode + 303
6   libruby.2.2.0.dylib                 0x0000000103e1bbe2 vm_call_cfunc + 1106
7   libruby.2.2.0.dylib                 0x0000000103e1ae93 vm_call_method + 1043
8   libruby.2.2.0.dylib                 0x0000000103e070f4 vm_exec_core + 13588
9   libruby.2.2.0.dylib                 0x0000000103e1692c vm_exec + 124
10  libruby.2.2.0.dylib                 0x0000000103e17480 rb_iseq_eval_main + 496
11  libruby.2.2.0.dylib                 0x0000000103cd18c6 ruby_exec_internal + 150
12  libruby.2.2.0.dylib                 0x0000000103cd17d8 ruby_run_node + 56
13  ruby                                0x0000000103c81f2f main + 79

-- Other runtime information -----------------------------------------------

* Loaded script: -e

* Loaded features:

    0 enumerator.so
    1 rational.so
    2 complex.so
    3 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/x86_64-darwin16/enc/encdb.bundle
    4 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/x86_64-darwin16/enc/trans/transdb.bundle
    5 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/unicode_normalize.rb
    6 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/x86_64-darwin16/rbconfig.rb
    7 thread.rb
    8 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/x86_64-darwin16/thread.bundle
    9 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/site_ruby/2.2.0/rubygems/compatibility.rb
   10 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/site_ruby/2.2.0/rubygems/defaults.rb
   11 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/site_ruby/2.2.0/rubygems/deprecate.rb
   12 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/site_ruby/2.2.0/rubygems/errors.rb
   13 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/site_ruby/2.2.0/rubygems/version.rb
   14 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/site_ruby/2.2.0/rubygems/requirement.rb
   15 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/site_ruby/2.2.0/rubygems/platform.rb
   16 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb
   17 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/site_ruby/2.2.0/rubygems/stub_specification.rb
   18 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/site_ruby/2.2.0/rubygems/util/list.rb
   19 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/x86_64-darwin16/stringio.bundle
   20 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb
   21 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/site_ruby/2.2.0/rubygems/exceptions.rb
   22 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb
   23 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/monitor.rb
   24 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb
   25 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/site_ruby/2.2.0/rubygems.rb
   26 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/site_ruby/2.2.0/rubygems/path_support.rb
   27 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb
   28 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/x86_64-darwin16/date_core.bundle
   29 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/date.rb
   30 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/time.rb
   31 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/English.rb
   32 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/grpc-1.7.2-universal-darwin/src/ruby/lib/grpc/2.2/grpc_c.bundle
   33 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/grpc-1.7.2-universal-darwin/src/ruby/lib/grpc/grpc.rb
   34 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/grpc-1.7.2-universal-darwin/src/ruby/lib/grpc/errors.rb
   35 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/grpc-1.7.2-universal-darwin/src/ruby/lib/grpc/logconfig.rb
   36 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/grpc-1.7.2-universal-darwin/src/ruby/lib/grpc/notifier.rb
   37 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/grpc-1.7.2-universal-darwin/src/ruby/lib/grpc/version.rb
   38 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/grpc-1.7.2-universal-darwin/src/ruby/lib/grpc/core/time_consts.rb
   39 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/forwardable.rb
   40 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/delegate.rb
   41 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/weakref.rb
   42 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/grpc-1.7.2-universal-darwin/src/ruby/lib/grpc/generic/bidi_call.rb
   43 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/grpc-1.7.2-universal-darwin/src/ruby/lib/grpc/generic/active_call.rb
   44 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/grpc-1.7.2-universal-darwin/src/ruby/lib/grpc/generic/client_stub.rb
   45 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/grpc-1.7.2-universal-darwin/src/ruby/lib/grpc/generic/rpc_desc.rb
   46 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/grpc-1.7.2-universal-darwin/src/ruby/lib/grpc/generic/service.rb
   47 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/grpc-1.7.2-universal-darwin/src/ruby/lib/grpc/generic/rpc_server.rb
   48 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/grpc-1.7.2-universal-darwin/src/ruby/lib/grpc/generic/interceptor_registry.rb
   49 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/grpc-1.7.2-universal-darwin/src/ruby/lib/grpc/generic/interceptors.rb
   50 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/grpc-1.7.2-universal-darwin/src/ruby/lib/grpc.rb
   51 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-protobuf-3.5.0-universal-darwin/lib/google/protobuf/message_exts.rb
   52 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-protobuf-3.5.0-universal-darwin/lib/google/2.2/protobuf_c.bundle
   53 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-protobuf-3.5.0-universal-darwin/lib/google/protobuf/repeated_field.rb
   54 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-protobuf-3.5.0-universal-darwin/lib/google/protobuf.rb
   55 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-protobuf-3.5.0-universal-darwin/lib/google/protobuf/any_pb.rb
   56 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleapis-common-protos-types-1.0.1/lib/google/rpc/status_pb.rb
   57 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/grpc-1.7.2-universal-darwin/src/ruby/lib/grpc/google_rpc_status_utils.rb
   58 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/cgi/core.rb
   59 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/cgi/util.rb
   60 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/cgi/cookie.rb
   61 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/cgi.rb
   62 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/set.rb
   63 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/timeout.rb
   64 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/faraday-0.13.1/lib/faraday/utils.rb
   65 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/faraday-0.13.1/lib/faraday/options.rb
   66 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/faraday-0.13.1/lib/faraday/connection.rb
   67 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/faraday-0.13.1/lib/faraday/rack_builder.rb
   68 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/faraday-0.13.1/lib/faraday/parameters.rb
   69 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/faraday-0.13.1/lib/faraday/middleware.rb
   70 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/faraday-0.13.1/lib/faraday/adapter.rb
   71 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/faraday-0.13.1/lib/faraday/request.rb
   72 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/faraday-0.13.1/lib/faraday/response.rb
   73 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/multipart-post-2.0.0/lib/composite_io.rb
   74 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/multipart-post-2.0.0/lib/parts.rb
   75 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/faraday-0.13.1/lib/faraday/upload_io.rb
   76 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/faraday-0.13.1/lib/faraday/error.rb
   77 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/faraday-0.13.1/lib/faraday/autoload.rb
   78 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/faraday-0.13.1/lib/faraday.rb
   79 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/addressable-2.5.2/lib/addressable/version.rb
   80 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/addressable-2.5.2/lib/addressable/idna/pure.rb
   81 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/addressable-2.5.2/lib/addressable/idna.rb
   82 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/public_suffix-3.0.1/lib/public_suffix/domain.rb
   83 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/public_suffix-3.0.1/lib/public_suffix/version.rb
   84 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/public_suffix-3.0.1/lib/public_suffix/errors.rb
   85 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/public_suffix-3.0.1/lib/public_suffix/rule.rb
   86 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/public_suffix-3.0.1/lib/public_suffix/list.rb
   87 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/public_suffix-3.0.1/lib/public_suffix.rb
   88 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/addressable-2.5.2/lib/addressable/uri.rb
   89 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/signet-0.8.1/lib/signet/version.rb
   90 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/signet-0.8.1/lib/signet.rb
   91 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/signet-0.8.1/lib/signet/errors.rb
   92 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/base64.rb
   93 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/multi_json-1.12.2/lib/multi_json/options.rb
   94 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/multi_json-1.12.2/lib/multi_json/version.rb
   95 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/multi_json-1.12.2/lib/multi_json/adapter_error.rb
   96 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/multi_json-1.12.2/lib/multi_json/parse_error.rb
   97 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/multi_json-1.12.2/lib/multi_json/options_cache.rb
   98 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/multi_json-1.12.2/lib/multi_json.rb
   99 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/signet-0.8.1/lib/signet/oauth_2.rb
  100 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/json-1.8.6/lib/json/version.rb
  101 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/ostruct.rb
  102 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/json-1.8.6/lib/json/generic_object.rb
  103 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/json-1.8.6/lib/json/common.rb
  104 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/x86_64-darwin16/enc/utf_16be.bundle
  105 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/x86_64-darwin16/enc/utf_16le.bundle
  106 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/x86_64-darwin16/enc/utf_32be.bundle
  107 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/x86_64-darwin16/enc/utf_32le.bundle
  108 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/json-1.8.6/lib/json/ext/parser.bundle
  109 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/json-1.8.6/lib/json/ext/generator.bundle
  110 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/json-1.8.6/lib/json/ext.rb
  111 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/json-1.8.6/lib/json.rb
  112 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/jwt-2.1.0/lib/jwt/decode.rb
  113 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/jwt-2.1.0/lib/jwt/default_options.rb
  114 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/jwt-2.1.0/lib/jwt/encode.rb
  115 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/jwt-2.1.0/lib/jwt/error.rb
  116 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/jwt-2.1.0/lib/jwt/security_utils.rb
  117 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/x86_64-darwin16/digest.bundle
  118 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/digest.rb
  119 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/x86_64-darwin16/openssl.bundle
  120 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/openssl/bn.rb
  121 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/openssl/cipher.rb
  122 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/openssl/config.rb
  123 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/openssl/digest.rb
  124 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/openssl/x509.rb
  125 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/openssl/buffering.rb
  126 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/x86_64-darwin16/fcntl.bundle
  127 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/openssl/ssl.rb
  128 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/openssl.rb
  129 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/jwt-2.1.0/lib/jwt/algos/hmac.rb
  130 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/jwt-2.1.0/lib/jwt/algos/eddsa.rb
  131 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/jwt-2.1.0/lib/jwt/algos/ecdsa.rb
  132 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/jwt-2.1.0/lib/jwt/algos/rsa.rb
  133 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/jwt-2.1.0/lib/jwt/algos/unsupported.rb
  134 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/jwt-2.1.0/lib/jwt/signature.rb
  135 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/jwt-2.1.0/lib/jwt/verify.rb
  136 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/jwt-2.1.0/lib/jwt.rb
  137 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/signet-0.8.1/lib/signet/oauth_2/client.rb
  138 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleauth-0.6.2/lib/googleauth/signet.rb
  139 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/memoist-0.16.0/lib/memoist/version.rb
  140 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/memoist-0.16.0/lib/memoist/core_ext/singleton_class.rb
  141 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/memoist-0.16.0/lib/memoist.rb
  142 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleauth-0.6.2/lib/googleauth/compute_engine.rb
  143 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/exception.rb
  144 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/syntax_error.rb
  145 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/x86_64-darwin16/psych.bundle
  146 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/omap.rb
  147 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/set.rb
  148 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/class_loader.rb
  149 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/x86_64-darwin16/strscan.bundle
  150 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/scalar_scanner.rb
  151 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/nodes/node.rb
  152 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/nodes/stream.rb
  153 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/nodes/document.rb
  154 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/nodes/sequence.rb
  155 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/nodes/scalar.rb
  156 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/nodes/mapping.rb
  157 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/nodes/alias.rb
  158 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/nodes.rb
  159 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/streaming.rb
  160 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/visitors/visitor.rb
  161 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/visitors/to_ruby.rb
  162 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/visitors/emitter.rb
  163 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/handler.rb
  164 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/tree_builder.rb
  165 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/visitors/yaml_tree.rb
  166 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/json/ruby_events.rb
  167 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/visitors/json_tree.rb
  168 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/visitors/depth_first.rb
  169 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/visitors.rb
  170 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/parser.rb
  171 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/coder.rb
  172 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/core_ext.rb
  173 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/deprecated.rb
  174 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/stream.rb
  175 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/json/yaml_events.rb
  176 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/json/tree_builder.rb
  177 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/json/stream.rb
  178 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych/handlers/document_stream.rb
  179 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/psych.rb
  180 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/yaml.rb
  181 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/os-0.9.6/lib/os.rb
  182 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleauth-0.6.2/lib/googleauth/credentials_loader.rb
  183 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleauth-0.6.2/lib/googleauth/service_account.rb
  184 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleauth-0.6.2/lib/googleauth/scope_util.rb
  185 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleauth-0.6.2/lib/googleauth/user_refresh.rb
  186 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleauth-0.6.2/lib/googleauth/default_credentials.rb
  187 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleauth-0.6.2/lib/googleauth/application_default.rb
  188 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleauth-0.6.2/lib/googleauth/client_id.rb
  189 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleauth-0.6.2/lib/googleauth/credentials.rb
  190 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/uri/rfc2396_parser.rb
  191 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/uri/rfc3986_parser.rb
  192 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/uri/common.rb
  193 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/uri/generic.rb
  194 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/uri/ftp.rb
  195 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/uri/http.rb
  196 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/uri/https.rb
  197 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/uri/ldap.rb
  198 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/uri/ldaps.rb
  199 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/uri/mailto.rb
  200 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/uri.rb
  201 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleauth-0.6.2/lib/googleauth/user_authorizer.rb
  202 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/securerandom.rb
  203 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleauth-0.6.2/lib/googleauth/web_user_authorizer.rb
  204 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleauth-0.6.2/lib/googleauth.rb
  205 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-protobuf-3.5.0-universal-darwin/lib/google/protobuf/duration_pb.rb
  206 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-protobuf-3.5.0-universal-darwin/lib/google/protobuf/field_mask_pb.rb
  207 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-protobuf-3.5.0-universal-darwin/lib/google/protobuf/struct_pb.rb
  208 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-protobuf-3.5.0-universal-darwin/lib/google/protobuf/timestamp_pb.rb
  209 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-protobuf-3.5.0-universal-darwin/lib/google/protobuf/well_known_types.rb
  210 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleapis-common-protos-types-1.0.1/lib/google/rpc/error_details_pb.rb
  211 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-gax-0.10.2/lib/google/gax/grpc.rb
  212 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-gax-0.10.2/lib/google/gax/errors.rb
  213 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-gax-0.10.2/lib/google/gax/bundling.rb
  214 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-gax-0.10.2/lib/google/gax/api_callable.rb
  215 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-gax-0.10.2/lib/google/gax/constants.rb
  216 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/rly-0.2.3/lib/rly/version.rb
  217 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/rly-0.2.3/lib/rly/lex_token.rb
  218 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/rly-0.2.3/lib/rly/lex.rb
  219 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/rly-0.2.3/lib/rly/file_lex.rb
  220 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/rly-0.2.3/lib/rly/parse/production.rb
  221 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/rly-0.2.3/lib/rly/parse/lr_item.rb
  222 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/rly-0.2.3/lib/rly/parse/grammar.rb
  223 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/rly-0.2.3/lib/rly/parse/yacc_production.rb
  224 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/rly-0.2.3/lib/rly/parse/yacc_symbol.rb
  225 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/rly-0.2.3/lib/rly/parse/lr_table.rb
  226 /Users/igorp/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/erb.rb
  227 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/rly-0.2.3/lib/rly/parse/ply_dump.rb
  228 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/rly-0.2.3/lib/rly/yacc.rb
  229 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/rly-0.2.3/lib/rly/parse/rule_parser.rb
  230 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/rly-0.2.3/lib/rly.rb
  231 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-gax-0.10.2/lib/google/gax/path_template.rb
  232 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-gax-0.10.2/lib/google/gax/settings.rb
  233 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-gax-0.10.2/lib/google/gax/util.rb
  234 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-gax-0.10.2/lib/google/gax/version.rb
  235 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-gax-0.10.2/lib/google/gax.rb
  236 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleapis-common-protos-types-1.0.1/lib/google/api/http_pb.rb
  237 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleapis-common-protos-types-1.0.1/lib/google/api/annotations_pb.rb
  238 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleapis-common-protos-types-1.0.1/lib/google/api/label_pb.rb
  239 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleapis-common-protos-types-1.0.1/lib/google/api/monitored_resource_pb.rb
  240 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleapis-common-protos-types-1.0.1/lib/google/logging/type/http_request_pb.rb
  241 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/googleapis-common-protos-types-1.0.1/lib/google/logging/type/log_severity_pb.rb
  242 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-cloud-logging-1.3.2/lib/google/logging/v2/log_entry_pb.rb
  243 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-protobuf-3.5.0-universal-darwin/lib/google/protobuf/empty_pb.rb
  244 /Users/igorp/.rvm/gems/ruby-2.2.7/gems/google-cloud-logging-1.3.2/lib/google/logging/v2/logging_pb.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
Don't forget to include the above Crash Report log file.
For details: http://www.ruby-lang.org/bugreport.html

Abort trap: 6
@TeBoring
Copy link
Contributor

Does this happen with latest 3.6.0 release?

@TeBoring
Copy link
Contributor

`require': cannot load such file -- google/gax (LoadError)
Could you provide more detailed steps to reproduce?

@igorpeshansky
Copy link
Contributor Author

Yes, it reproduces with 3.6.0. Here's the full repro:

gem install google-gax google-cloud-logging google-protobuf
ruby -e "require 'google/gax'; require 'google/logging/v2/logging_pb'; Google::Protobuf::Any.encode(Google::Logging::V2::WriteLogEntriesPartialErrors.new)"

@TeBoring
Copy link
Contributor

TeBoring commented Jul 9, 2018

Unlike pack and unpack, Any.encode can only encode Any message. You should do:

any = Google::Protobuf::Any.new
any.pack(Google::Logging::V2::WriteLogEntriesPartialErrors.new)
Google::Protobuf::Any.encode(any)

@TeBoring TeBoring closed this as completed Jul 9, 2018
@TeBoring
Copy link
Contributor

TeBoring commented Jul 9, 2018

However, segmentation fault is not what we want. Instead, exception should be thrown. We will fix that.

@TeBoring TeBoring reopened this Jul 9, 2018
@TeBoring TeBoring changed the title Segfault in Any.encode Throw exception instead of Segfault in Any.encode Jul 9, 2018
@TeBoring TeBoring changed the title Throw exception instead of Segfault in Any.encode Throw exception in Any.encode Jul 9, 2018
@igorpeshansky
Copy link
Contributor Author

Right, I understand that the repro case is contrived. This bug was opened exactly to turn a segfault into some reasonable Ruby-level error or exception.

@TeBoring
Copy link
Contributor

Fixed in #4885

qingling128 added a commit to GoogleCloudPlatform/fluent-plugin-google-cloud that referenced this issue Aug 10, 2018
qingling128 added a commit to GoogleCloudPlatform/fluent-plugin-google-cloud that referenced this issue Aug 10, 2018
@archonic
Copy link

I've added gem "google-protobuf", github: "protocolbuffers/protobuf", tag: "v3.7.0" to my Gemfile, and I'm getting LoadError: cannot load such file -- google/protobuf/any_pb when attempting to update to Ruby 2.6.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants