Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-2147

is printStackTrace() signal safe?

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: None
    • Component/s: Stability
    • None
    • ALL
    • Dev Tools 2020-01-13

      my understanding is that malloc shouldn't be used in signals. is that correct?

      (1) ostream is used in printStackTrace(). does ostream call malloc? I imagine so.
      (2) backtrace_symbols() probably calls malloc()?
      (3) printStackTrace() calls free()

      so what to do, as a stack trace might be helpful. one option is just make sure anything "important" is done first, and that stdout is flushed, and then just try it. (1) and (3) could be eliminated but perhaps #2 is hard.

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            dwight@mongodb.com Dwight Merriman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: