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

Better behavior for large backtraces printed from signal handler

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.1
    • Affects Version/s: None
    • Component/s: Diagnostics
    • Labels:
      None
    • Fully Compatible
    • Dev Tools 2019-07-29, Dev Tools 2019-08-12, Dev Tools 2019-09-09, Dev Tools 2019-09-23, Dev Tools 2019-10-07, Dev Tools 2019-10-21

      It looks like we have a special stream class which we use to avoid calling malloc in signal handlers here.

      It uses a pre-allocated buffer of 100k bytes. Unfortunately, the JSON blob for a very deep stack trace (on my machine, at least) can be more than 100,000 characters, and get truncated when logged from the signal handler. I'm not sure if stack traces can be so large on "release" builds, but it would be a shame if a customer's node crashed and the printed stacktrace were cut off. I think we should consider doing:

      1) Show the human readable stacktrace first (see here). This way, if the output is truncated, something useful is printed. A partial JSON blob is basically useless for day-to-day debugging purposes.
      2) Increase the size of the buffer used in the signal handler's output stream (see here).

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            ian.boros@mongodb.com Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: