[SERVER-13944] Provide richer unwind information in logged stack traces on POSIX systems. Created: 14/May/14  Updated: 08/Jun/18  Resolved: 22/May/14

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 2.7.1

Type: Improvement Priority: Major - P3
Reporter: Andy Schwerin Assignee: Andy Schwerin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-14038 implement addr2line replacement for n... Closed
Related
related to SERVER-13956 Add unique build-ids to built binarie... Closed
related to SERVER-13957 In OS X stack traces, supply the soma... Closed
related to SERVER-13958 In Solaris stack traces, supply the s... Closed
related to SERVER-13959 In FreeBSD stack traces, supply the s... Closed
related to SERVER-13942 Consider placing mongodb version info... Closed
is related to SERVER-35503 Backtrace document should include bui... Closed
Participants:

 Description   

The new format should include the load addresses of shared objects, to enable stack tracing in the presence of ASLR, and the GUID/unique build id of the binary, when available, to make it easier to identify the exact set of debugging symbols to use when decoding the backtrace.

Proposed format:

----- BEGIN BACKTRACE -----
{"backtrace":[{"b":"400000","o":"13f62f0"},{"b":"400000","o":"992c05"},{"b":"400000","o":"992cc6"},{"b":"7f974d559000","o":"fbb0"},{"b":"400000","o":"527072"},{"b":"400000","o":"51a501"},{"b":"400000","o":"51a888"},{"b":"400000","o":"51b38b"},{"b":"400000","o":"51c0d1"},{"b":"400000","o":"6f7b10"},{"b":"400000","o":"5ea49f"},{"b":"400000","o":"39afab"},{"b":"400000","o":"95c822"},{"b":"7f974d559000","o":"7f6e"},{"b":"7f974c76f000","o":"fa9cd"}],"somap"
: [ { "elfType" : 2, "loadAddr" : "400000", "gnuBuildId" :
"7BEB4A8E858537106C4D6206BE5D0461849B0912" }, { "loadAddr" : "7FFFA72FE000",
"elfType" : 3, "gnuBuildId" : "E042D946DA13DAAE6D922FD5B7B080EBBD617E79" }, {
"loadAddr" : "7F974D559000", "path" : "/lib/x86_64-linux-gnu/libpthread.so.0",
"elfType" : 3, "gnuBuildId" : "B4F5DA4C0C174F671A96E33F25274E0A8CD45984" }, {
"loadAddr" : "7F974D355000", "path" : "/lib/x86_64-linux-gnu/libdl.so.2",
"elfType" : 3, "gnuBuildId" : "939D9DA345BA46EB891AEE110BF9D57199D9671E" }, {
"loadAddr" : "7F974D051000", "path" :
"/usr/lib/x86_64-linux-gnu/libstdc++.so.6", "elfType" : 3, "gnuBuildId" :
"693661673B9FE5B38C19B83D8A296B6619B8CC39" }, { "loadAddr" : "7F974CD4D000",
"path" : "/lib/x86_64-linux-gnu/libm.so.6", "elfType" : 3, "gnuBuildId" :
"50AE4A8465A9569459546AE74EE5B158B73E04C9" }, { "loadAddr" : "7F974CB37000",
"path" : "/lib/x86_64-linux-gnu/libgcc_s.so.1", "elfType" : 3, "gnuBuildId" :
"DF05C4900D5D16CE6BF6C4F5B5BA52176C334AC9" }, { "loadAddr" : "7F974C76F000",
"path" : "/lib/x86_64-linux-gnu/libc.so.6", "elfType" : 3, "gnuBuildId" :
"A2CF0D8A921941EC2D98B231AF91DC1DFE6D2465" }, { "loadAddr" : "7F974D776000",
"path" : "/lib64/ld-linux-x86-64.so.2", "elfType" : 3, "gnuBuildId" :
"91A818FFB801CEC66C0D351DF3D66BE58C4402DA" } ]}
 mongod(_ZN5mongo15SomeCrazyNumberE+0x0) [0x17f62f0]
 mongod(+0x992c05) [0xd92c05]
 mongod(+0x992cc6) [0xd92cc6]
 libpthread.so.0(+0xfbb0) [0x7f974d568bb0]
 mongod(_ZN5mongo11CmdShutdown14shutdownHelperEv+0x152) [0x927072]
 
mongod(_ZN5mongo11CmdShutdown3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb+0x271)
[0x91a501]
 
mongod(_ZN5mongo12_execCommandEPNS_7CommandERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb+0x28)
[0x91a888]
 
mongod(_ZN5mongo7Command11execCommandEPS0_RNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb+0x8eb)
[0x91b38b]
 
mongod(_ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi+0x2b1)
[0x91c0d1]
 
mongod(_ZN5mongo11newRunQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_+0x14c0)
[0xaf7b10]
 
mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE+0x5ff)
[0x9ea49f]
 
mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE+0xbb)
[0x79afab]
 mongod(_ZN5mongo17PortMessageServer17handleIncomingMsgEPv+0x482) [0xd5c822]
 libpthread.so.0(+0x7f6e) [0x7f974d560f6e]
 libc.so.6(clone+0x6d) [0x7f974c8699cd]
----- END BACKTRACE -----



 Comments   
Comment by Githook User [ 16/May/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-13944 Switch back to -fPIC instead of -fPIE to fix RHEL6.2 build.

On RHEL6 builders, the -fPIE compiler flag causes the mongo shell to make
a pure virtual function call inside the V8 engine at startup. Since
the swtitch to -fPIE was unnecessary for SERVER-13944, switching back to
-fPIC pending investigation.
Branch: master
https://github.com/mongodb/mongo/commit/c9310a020780e9c226b5ef33ed65c88fce8523b4

Comment by Githook User [ 16/May/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-13944 Switch back to -fPIC instead of -fPIE to fix RHEL6.2 build.

On RHEL6 builders, the -fPIE compiler flag causes the mongo shell to make
a pure virtual function call inside the V8 engine at startup. Since
the swtitch to -fPIE was unnecessary for SERVER-13944, switching back to
-fPIC pending investigation.
Branch: master
https://github.com/mongodb/mongo/commit/c9310a020780e9c226b5ef33ed65c88fce8523b4

Comment by Githook User [ 15/May/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-13944 New stack dump format, on non-Windows systems.

Implementation of the "somap" object, which can be used to identify the correct
binary from which to extract debug symbols and supports ASLR, is only implemented
on Linux. Other POSIX systems still need work to implement that object.
Branch: master
https://github.com/mongodb/mongo/commit/0417d9b6639fbcd6f09a6bf2f235668e6b57a809

Generated at Thu Feb 08 03:33:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.