[SERVER-8159] Write backtrace error to "log()" for backtrace_symbols Created: 13/Jan/13  Updated: 02/Apr/13  Resolved: 02/Apr/13

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

Type: Bug Priority: Major - P3
Reporter: Azat Khuzhin Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: open_pull_request
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MONGO_HAVE_EXECINFO_BACKTRACE


Issue Links:
Related
is related to SERVER-6778 printStackTrace does not work when ru... Closed
Operating System: ALL
Participants:

 Description   

Write erros to "log()" instead of ostream, as for windows version of "printStackTrace()"



 Comments   
Comment by Eliot Horowitz (Inactive) [ 02/Apr/13 ]

SERVER-8825

Comment by Azat Khuzhin [ 14/Jan/13 ]

Yes.

Comment by Tad Marshall [ 14/Jan/13 ]

So your concern is just the error message when the call to backtrace_symbols() fails, not the backtrace itself?

Comment by Azat Khuzhin [ 14/Jan/13 ]

Tad, thanks for explanation.
I just want to write in the same style.

I don't know about SERVER-6778 before.

Comment by Azat Khuzhin [ 14/Jan/13 ]

Pull request https://github.com/mongodb/mongo/pull/356

Comment by Tad Marshall [ 13/Jan/13 ]

I think the concern had been that writing to the log stream might fail and so writing to stdout might be more reliable, but since we use dup2() to redirect stdout to the log stream I don't think there is any difference in reliability.

We had to send the output directly to the log stream in Windows because stdout does not work when running as a Windows service, even when redirected with dup2().

Sending the text directly to the log stream has the advantage of capturing timestamps and thread names, which is helpful in debugging.

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