Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-5292

taskmgr is not threadsafe

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • Applications
    • None
    • Operating System: ReactOS
      Platform: x86 Hardware

    Description

      Taskmgr uses an update thread that deletes structures containing task information from the heap when the task is no longer present.
      At the same time the gui thread could access these structures on a response to clicking an item. There is no synchronisation mechanism.

      Thread 1 (update thread)
      in procpage.c:452 (UpdateProcesses())

      (void)ListView_GetItem(hProcessPageListCtrl, &item);
      pData = (LPPROCESS_PAGE_LIST_ITEM)item.lParam;
      if (!ProcessRunning(pData->ProcessId))

      { (void)ListView_DeleteItem(hProcessPageListCtrl, i); HeapFree(GetProcessHeap(), 0, pData); }

      called from procpage.c:414 (ProcessPageRefreshThread())

      Thread 0 (gui thread)
      in procpage.c:244 (ProcessPageOnNotify())

      case LVN_GETDISPINFO:

      if (!(pnmdi->item.mask & LVIF_TEXT))
      break;

      pData = (LPPROCESS_PAGE_LIST_ITEM)pnmdi->item.lParam;
      Index = PerfDataGetProcessIndex(pData->ProcessId);
      ColumnIndex = pnmdi->item.iSubItem;

      PerfDataGetText(Index, ColumnIndex, pnmdi->item.pszText, pnmdi->item.cchTextMax);

      Attachments

        Issue Links

          Activity

            People

              bug zilla Bug Zilla
              ThePhysicist Timo Kreuzer
              Votes:
              4 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: