[SERVER-3870] improve the output of backtrace Created: 15/Sep/11  Updated: 10/Dec/14  Resolved: 16/Dec/13

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

Type: Improvement Priority: Minor - P4
Reporter: Guanqun Lu Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

linux environment


Participants:

 Description   

The output of backtrace is not friendly to read. e.g.
_ZN5mongo12QueryPlanSetC1EPKcSt8auto_ptrINS_17FieldRangeSetPairEES5_RKNS_7BSONObjES8_bPKNS_11BSONElementEbS8_S8_bb+0x214

We should demangle this symbol automatically, so the output is human readable.



 Comments   
Comment by Matt Kangas [ 16/Dec/13 ]

Dup of SERVER-9586

Comment by Guanqun Lu [ 16/Sep/11 ]

Yes, this doesn't help release builds.

The goal of this improvement is to help developers to grasp what's wrong in the first place without using c++filt or addr2line and other tools to analyse the output.

Comment by Eliot Horowitz (Inactive) [ 15/Sep/11 ]

Not sure this makes sense.
The release builds don't have debugging symbols, so won't help there.
Also, we want to have as little code in handlers as possible as they often execute after a segv, so we don't want to create more problems.
Will look into it though.

Comment by Guanqun Lu [ 15/Sep/11 ]

The pull request is here:
https://github.com/mongodb/mongo/pull/82

The commit is here:
https://github.com/guanqun/mongo/commit/10b8eabc7fb9ed3288486cec24d7c6a26417cf64

Demangle C++ symbols so that the output is human readable.

The original backtrace looks like this:
./perftest(_ZN5mongo12QueryPlanSetC1EPKcSt8auto_ptrINS_17FieldRangeSetPairEES5_RKNS_7BSONObjES8_bPKNS_11BSONElementEbS8_S8_bb+0x214) [0x8222fc4]

With the patch, the backtrace looks like:

./perftest(mongo::QueryPlanSet::QueryPlanSet(char const*, std::auto_ptr<mongo::FieldRangeSetPair>, std::auto_ptr<mongo::FieldRangeSetPair>, mongo::BSONObj const&, mongo::BSONObj const&, bool, mongo::BSONElement const*, bool, mongo::BSONObj const&, mongo::BSONObj const&, bool, bool)+0x214) [0x8223464]

References:
http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch39.html

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