Page MenuHomePhabricator

MITK workbench freezes due to infinite loop in QmitkSliderLevelWindowWidget::paintEvent
Closed, ResolvedPublic

Description

If the QmitkSliderLevelWindowWidget has to handle a image with a lower level window range that is negative infinite (e.g. on pixel in the image with value negative infinite) it got stuck in a infinite loop in QmitkSliderLevelWindowWidget.cpp line 152ff.

Reason: It is unpossible to ever reach the stopping criteria

i < m_MoveHeight;

The paint event should be rewritten to also handle situations, where the range contain infinite boundaries or NaN values, without crashing ot get stucked,

Revisions and Commits

Event Timeline

@kislinsk / @nolden: The onPaint method is quite a mess and the documentation of the class does not really cover painting/UI features. Do you know what the features are/where. The paint code looks quite large and mingeled for the small tasks to just get ticks and numbers at certain positions. But may be I am missing something or there is stuff going on that in not painting at all ?!?

@kislinsk I have put a test session to reproduce the problem into \E132-Projekte\MITK-Tasks\T24886.
To reproduce the error:

  1. make "L4_delta_0" visible
  2. make "FLAIR" invisible
  3. Baaam!

The current problem is in the loop line 152ff, but the onPaint code may containe further problems.

@kislinsk: I think found a minimal "patch" (more a workarround) to get at least rid of the "freeze". We should discuss it tomorrow.

kislinsk triaged this task as Normal priority.Jun 14 2018, 1:01 PM
kislinsk added a revision: Restricted Differential Revision.Jun 14 2018, 3:38 PM
floca renamed this task from MITK workbench freezes due to infinit loop in QmitkSliderLevelWindowWidget::paintEvent to MITK workbench freezes due to infinite loop in QmitkSliderLevelWindowWidget::paintEvent.Jun 25 2018, 10:03 AM
floca updated the task description. (Show Details)
floca added a revision: Restricted Differential Revision.Jun 25 2018, 10:32 AM
floca claimed this task.

The accute problem is fixed. But the LevelWindow and widget need some treat and refactoring (see also T24962).