Bug #12327
closedSeg Fault - ruby 2.3.0 mongo & OpenSSL issue??
Description
/opt/rbenv/versions/2.3.0/lib/ruby/2.3.0/openssl/buffering.rb:57: [BUG] Segmentation fault at 0x007fd27558dd80
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0019 p:---- s:0075 e:000074 CFUNC :sysread
c:0018 p:0020 s:0071 e:000069 METHOD /opt/rbenv/versions/2.3.0/lib/ruby/2.3.0/openssl/buffering.rb:57
c:0017 p:0090 s:0067 e:000066 METHOD /opt/rbenv/versions/2.3.0/lib/ruby/2.3.0/openssl/buffering.rb:98
c:0016 p:0012 s:0061 e:000060 METHOD /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/socket.rb:172
c:0015 p:0010 s:0057 e:000056 BLOCK /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/socket.rb:123
c:0014 p:0008 s:0053 e:000052 METHOD /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/socket.rb:191
c:0013 p:0009 s:0049 e:000048 METHOD /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/socket.rb:122
c:0012 p:0030 s:0045 e:000042 METHOD /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/protocol/message.rb:113
c:0011 p:0033 s:0035 e:000034 BLOCK /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/server/monitor/connection.rb:56
c:0010 p:0026 s:0032 e:000031 METHOD /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/server/connectable.rb:91
c:0009 p:0009 s:0028 e:000027 METHOD /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/server/monitor/connection.rb:54
c:0008 p:0027 s:0025 e:000024 BLOCK /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/server/monitor.rb:163 [FINISH]
c:0007 p:---- s:0021 e:000020 CFUNC :synchronize
c:0006 p:0011 s:0018 e:000017 METHOD /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/server/monitor.rb:160
c:0005 p:0023 s:0015 e:000012 METHOD /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/server/monitor.rb:66
c:0004 p:0017 s:0010 e:000009 BLOCK /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/server/monitor.rb:118 [FINISH]
c:0003 p:---- s:0008 e:000007 CFUNC :loop
c:0002 p:0009 s:0005 e:000004 BLOCK /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/server/monitor.rb:116 [FINISH]
c:0001 p:---- s:0002 e:000001 (none) [FINISH]
-- Ruby level backtrace information ----------------------------------------
/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/server/monitor.rb:116:in block in run!' /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/server/monitor.rb:116:in
loop'
/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/server/monitor.rb:118:in block (2 levels) in run!' /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/server/monitor.rb:66:in
scan!'
/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/server/monitor.rb:160:in ismaster' /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/server/monitor.rb:160:in
synchronize'
/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/server/monitor.rb:163:in block in ismaster' /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/server/monitor/connection.rb:54:in
ismaster'
/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/server/connectable.rb:91:in ensure_connected' /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/server/monitor/connection.rb:56:in
block in ismaster'
/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/protocol/message.rb:113:in deserialize' /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/socket.rb:122:in
read'
/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/socket.rb:191:in handle_errors' /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/socket.rb:123:in
block in read'
/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mongo-2.2.4/lib/mongo/socket.rb:172:in read_from_socket' /opt/rbenv/versions/2.3.0/lib/ruby/2.3.0/openssl/buffering.rb:98:in
read'
/opt/rbenv/versions/2.3.0/lib/ruby/2.3.0/openssl/buffering.rb:57:in fill_rbuff' /opt/rbenv/versions/2.3.0/lib/ruby/2.3.0/openssl/buffering.rb:57:in
sysread'
Updated by alexanderbrowne (Alexander Browne) over 8 years ago
I am almost certain this is to do with thread safety within the ssl lib. I am running ubuntu. details:
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
OpenSSL 1.0.1f 6 Jan 2014
Updated by hsbt (Hiroshi SHIBATA) over 8 years ago
- Status changed from Open to Feedback
Can you try with Ruby 2.3.1?
Updated by jrusev (Jivko Rusev) about 8 years ago
- ruby -v changed from 2.3.0 to 2.3.1
Hiroshi SHIBATA wrote:
Can you try with Ruby 2.3.1?
I tried with 2.3.1 - it happens again. This is the trace:
: /opt/rbenv/versions/2.3.1/lib/ruby/2.3.0/openssl/buffering.rb:57: [BUG] Segmentation fault at 0x007f7f895f9b60
: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
: -- Control frame information -----------------------------------------------
: c:0006 p:---- s:0024 e:000023 CFUNC :sysread
: c:0005 p:0020 s:0020 e:000018 METHOD /opt/rbenv/versions/2.3.1/lib/ruby/2.3.0/openssl/buffering.rb:57
: c:0004 p:0090 s:0016 e:000015 METHOD /opt/rbenv/versions/2.3.1/lib/ruby/2.3.0/openssl/buffering.rb:98
: c:0003 p:0009 s:0010 e:000009 METHOD /opt/rbenv/versions/2.3.1/lib/ruby/2.3.0/openssl/buffering.rb:259
: c:0002 p:0020 s:0007 e:000006 BLOCK /opt/.../deploy/.../shared/bundle/ruby/2.3.0/gems/websocket-client-simple-0.3.0/lib/websocket-client-simple/client.rb:45 [FINISH]
: c:0001 p:---- s:0002 e:000001 (none) [FINISH]
: -- Ruby level backtrace information ----------------------------------------
: /opt/.../deploy/.../shared/bundle/ruby/2.3.0/gems/websocket-client-simple-0.3.0/lib/websocket-client-simple/client.rb:45:in `block in connect'
: /opt/rbenv/versions/2.3.1/lib/ruby/2.3.0/openssl/buffering.rb:259:in `getc'
: /opt/rbenv/versions/2.3.1/lib/ruby/2.3.0/openssl/buffering.rb:98:in `read'
: /opt/rbenv/versions/2.3.1/lib/ruby/2.3.0/openssl/buffering.rb:57:in `fill_rbuff'
: /opt/rbenv/versions/2.3.1/lib/ruby/2.3.0/openssl/buffering.rb:57:in `sysread'
: -- Machine register context ------------------------------------------------
: RIP: 0x00007f7f895f9b60 RBP: 0x00007f7f584cfbb8 RSP: 0x00007f7e42dec4d8
: RAX: 0x00007f7f895f9b60 RBX: 0x00007f7f871812a0 RCX: 0x0000000000000005
: RDX: 0x0000000000004000 RDI: 0x00007f7f871812a0 RSI: 0x00007f7f3806d880
: R8: 0x0000000000000000 R9: 0x0000000000005d6a R10: 0x0000000000000000
: R11: 0x0000000000000000 R12: 0x00007f7e1d85a230 R13: 0x00007f7f88812e70
: R14: 0x00007f7f6383af88 R15: 0x00007f7e1d85a230 EFL: 0x0000000000010246
: -- C level backtrace information -------------------------------------------
: /opt/rbenv/versions/2.3.1/bin/ruby(rb_vm_bugreport+0x51f) [0x7f7f61a1cdff] vm_dump.c:688
: /opt/rbenv/versions/2.3.1/bin/ruby(rb_bug_context+0xd0) [0x7f7f619f7530] error.c:435
: /opt/rbenv/versions/2.3.1/bin/ruby(sigsegv+0x3e) [0x7f7f618f270e] signal.c:890
: /lib64/libpthread.so.0 [0x7f7f613d3100]
: [0x7f7f895f9b60]
: ----------------------------------------------------------------------------
Updated by rhenium (Kazuki Yamaguchi) about 8 years ago
What is shown if you run under valgrind? I suspect this is also #12292.
Updated by rhenium (Kazuki Yamaguchi) about 8 years ago
- Related to Bug #12292: Race between OpenSSL::SSL::SSLSocket#stop and #connect can cause a segmentation fault added
Updated by jeremyevans0 (Jeremy Evans) over 5 years ago
- Status changed from Feedback to Closed