[SERVER-42670] eliminate signal-unsafe calls from stacktrace printers Created: 07/Aug/19  Updated: 02/Jan/20  Resolved: 06/Nov/19

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

Type: Improvement Priority: Major - P3
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-2147 is printStackTrace() signal safe? Closed
Related
related to SERVER-44471 Complete TODO listed in SERVER-42670 Closed
Sprint: Dev Tools 2019-08-12, Dev Tools 2019-09-09
Participants:

 Comments   
Comment by Andy Schwerin [ 06/Nov/19 ]

Since we don't run the printers from asynchronous signal handlers, and we rarely find ourselves in synchronous signal handlers at a time when calling malloc is unsafe but logging would otherwise function, we're not going to make this change now. If circumstances change, we can revisit in the future.

Comment by Billy Donahue [ 07/Aug/19 ]

https://mongodbcr.appspot.com/484950019/

Comment by Billy Donahue [ 07/Aug/19 ]

std::ostream in particular is a poor choice here. We can't do any allocations. Most filesystem calls are allowed.
You can open a temp file and write to it to get unbounded storage for buildiing log messages if necessary.

Generated at Thu Feb 08 05:01:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.