Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-23183

thread termination hooks on main thread can cause crash

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.6.16
    • Component/s: JLib
    • Labels:
      None

      Description

      If a thread hook is added whilst on the main thread, then there there is no automatic call to callThreadTerminationHooks.
      Instead the hooks are called as part of the module exit scheme.
      However, the hooks vector is a thread local variable, which has wound up by the time atexit handling happens, and so accessing vector elements causes a crash.

      NB: If ExitModuleObjects() is called at end of main() this avoids the issue.

      Fix by spotting hooks added on main thread and track using a separate vector (that is not a thread local).

        Attachments

          Activity

            People

            • Assignee:
              jakesmith Jake Smith
              Reporter:
              jakesmith Jake Smith
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: