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

Windows unhandled exception filter should report thread and fault address

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.1.1
    • Affects Version/s: None
    • Component/s: Internal Code, Logging
    • Labels:
    • Environment:
      Windows
    • Fully Compatible

      The Windows version of mongod sets up an "unhandled exception filter" which is called when an exception occurs that is not trapped by any of our regular try/catch code. The main reason it exists and the main way that it gets to execute is on "access violations", the Windows term for a segfault. Attempts to read from address 0 or 0 plus a structure offset will pass through this exception filter on their way to a quick exit. All the code does is record the fact that it happened.

      But the existing code garbles its output ("unhandled Windows ex" is output followed by a timestamp and "access violation" with no newline so it looks really bad) and, worse, it doesn't tell us which thread had the access violation or what the faulting address was, so we have absolutely nothing to go on in debugging it.

      The code should instead display a readable output line, make sure that it goes to the log file so we get it when mongod.exe is running as a service, and it should tell us which thread faulted and what the faulting address was. This would at least give us a starting point in finding out how a crash happened.

      I am posting this because of an access violation that happened in buildbot for the 32-bit Windows version that was not reproducible when tested on my machine and which passed the test on the next buildbot run. So all we know is that the 32-bit Windows version can crash but nothing about how it can happen.

            Assignee:
            tad Tad Marshall
            Reporter:
            tad Tad Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: