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

is printStackTrace() signal safe?

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Trivial - P5 Trivial - P5
    • None
    • None
    • Stability
    • None
    • ALL
    • Dev Tools 2020-01-13

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: