ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:101121] [Ruby master Bug#17350] mongo-ruby-driver causes the segfault at program's exit
@ 2020-11-27 10:19 tadatoshi.tokutake
  2020-11-27 18:20 ` [ruby-core:101134] " mame
  2021-01-12  4:10 ` [ruby-core:102011] " tadatoshi.tokutake
  0 siblings, 2 replies; 3+ messages in thread
From: tadatoshi.tokutake @ 2020-11-27 10:19 UTC (permalink / raw)
  To: ruby-core

Issue #17350 has been reported by ttokutake (Tadatoshi Tokutake).

----------------------------------------
Bug #17350: mongo-ruby-driver causes the segfault at program's exit
https://bugs.ruby-lang.org/issues/17350

* Author: ttokutake (Tadatoshi Tokutake)
* Status: Open
* Priority: Normal
* ruby -v: Ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
## Overview

mongo-ruby-driver 2.11.0 has caused the segfault at program's exit when connecting a certain MongoDB cluster.
I also reported this issue to mongo-ruby-driver.
https://jira.mongodb.org/browse/RUBY-2453

This is the reproduction example. Please check it out.
https://github.com/ttokutake/mongo-ruby-driver-segfault

You can see full result by using the above example, and also debug it by GDB.

```
Fetching gem metadata from https://rubygems.org/........
Resolving dependencies...
Fetching bson 4.11.1
Installing bson 4.11.1 with native extensions
Using bundler 1.17.2
Fetching mongo 2.11.0
Installing mongo 2.11.0
D, [2020-11-27T00:20:31.035863 #11] DEBUG -- : MONGODB | EVENT: #<TopologyOpening topology=Unknown[]>
... (snip)
D, [2020-11-27T00:20:31.145112 #11] DEBUG -- : MONGODB | [14] mongodb-sharded.cluster.local:27017 | admin.endSessions | SUCCEEDED | 0.000s
[BUG] Segmentation fault at 0x0000000000000050
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0001 p:---- s:0003 e:000002 (none) [FINISH]


-- Machine register context ------------------------------------------------
 RIP: 0x00007f52358f4078 RBP: 0x00007f5230b4fdd0 RSP: 0x00007f5230b4fc90
 RAX: 0x0000000000000000 RBX: 0x0000563b4b746370 RCX: 0x0000563b44ad4158
 RDX: 0x0000563b44ad4570 RDI: 0x0000563b4b8bd318 RSI: 0x0000563b44ad4020
  R8: 0x0000000000000011  R9: 0x0000000000000000 R10: 0x0000563b4a8dc050
 R11: 0x0000000000000003 R12: 0x0000000000000009 R13: 0x0000563b44b7f630
 R14: 0x0000563b46ce6ac0 R15: 0x0000563b498440d8 EFL: 0x0000000000010297

-- C level backtrace information -------------------------------------------
corrupted double-linked list
Aborted
```

## Consideration

- https://bugs.ruby-lang.org/issues/16288 may be a similar issue.
  - [a similar result](https://github.com/ruby-concurrency/concurrent-ruby/issues/808#issuecomment-534944201).
- [This commit](https://github.com/mongodb/mongo-ruby-driver/commit/485ee7b24a1d34b3ea52b998dfd4dcc25454b6a5) has caused the segfault.
  - It does not happen if [this line](https://github.com/mongodb/mongo-ruby-driver/commit/485ee7b24a1d34b3ea52b998dfd4dcc25454b6a5#diff-10c9bc0ac2ab9e61b772cab992027054809ec5e71268a32541e374a7e7b5af9aR70) is commented out.

## Ruby versions

- Ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
- Ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-12  4:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27 10:19 [ruby-core:101121] [Ruby master Bug#17350] mongo-ruby-driver causes the segfault at program's exit tadatoshi.tokutake
2020-11-27 18:20 ` [ruby-core:101134] " mame
2021-01-12  4:10 ` [ruby-core:102011] " tadatoshi.tokutake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).