[SERVER-27874] Display locks and generate digraph for threads using LockManager locks and/or pthread_mutexes Created: 31/Jan/17 Updated: 07/Sep/17 Resolved: 16/Mar/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Testing Infrastructure |
| Affects Version/s: | None |
| Fix Version/s: | 3.4.5, 3.5.5 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Jonathan Abrahams | Assignee: | Jonathan Abrahams |
| Resolution: | Done | Votes: | 0 |
| Labels: | bkp | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Backport Requested: |
v3.4
|
||||||||||||||||||||
| Sprint: | TIG 2017-03-06, TIG 2017-03-27 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
This just needs to be done for mongod in GDB. Integrate siyuan.zhou's code and verify it works with all combinations of --dbg=off/--dbg=on and --opt=off/--opt=on builds. |
| Comments |
| Comment by Githook User [ 09/May/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 28/Apr/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}Message:
(cherry picked from commit 19abe0c2dacef784aad78b89d6c6111109fbca88) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 28/Apr/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}Message: (cherry picked from commit 5fe822f53e4bb28e15af2541c0ca931fa05a0e20) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 21/Mar/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}Message:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 16/Mar/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jonathan Abrahams [ 28/Feb/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Per eddie.louie's comment in BF-4651:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Siyuan Zhou [ 15/Feb/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I ran the visualization tool on the core dump of a deadlock found in my patch build. Luckily, it only involved mutexes, so the tool worked. I managed to get the dot graph by running the following commands in gdb after downloading mongo_lock.py from my repo.
This website can visualize the following graph for you. It's clear that there's a cycle.
It took 30 mins in total from starting a spawn host to finding the deadlock. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Siyuan Zhou [ 13/Feb/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Here is the latest version of the code, including the change of hang analyzer. It generates the dot format of the dependency graph, which can be visualized here. This patch on evergreen shows the result of a deadlock in unit test. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Siyuan Zhou [ 13/Feb/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I used gdb.parse_and_eval(), but it also doesn't work with core dump. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Max Hirschhorn [ 12/Feb/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
siyuan.zhou, you had mentioned that you worked on your script again during Skunkworks to avoid calling a function and support performing the automatic deadlock detection on a core dump. Is that code available somewhere? |