Skip to content

gitwidget: track living git processes

Michal Humpula requested to merge sessions_tests into master

When playing with session storage, I was trying to figure out, why the session_manager_test and sessions_action_test segfaults even on master.

Seems that even for tests the session reload will trigger default plugins reload including the project plugin and its GitWidget. The project plugin will trigger GitWidget::getStatus and the QProcess and lambda referencing GitWidget is created.

When the GitWidget is destroyed while there is still any git QProcess arround, the exit signal will be delivered to lambda with invalid closure.

Function calls looks something like this:

  • ~GitWidget
  • ~QWidget
  • QWidget::deleteChildren
  • ~QProcess
  • emit QProcess::finished
  • call finished lambda referencing already destroyed GitWidget

See attached trace trace.txt

Options I have come up with:

  1. remove the tests (unprofessional)
  2. disable plugin loading during test (easy, but it creates different path in production and test)
  3. track created QProcesses and destroy them before the referenced GitWidget is destroyed

Since this race can in theory happen in regular kate application, I have voted for third option.

Merge request reports