Ticket #797 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

Exception bug when adding an axis to an image

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-b1-initial
Component: Display API Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking:

Description

If you add an axis to an image it is possible to get an exception trace in SwingImageDisplay::makeLabel().

Change History

comment:1 Changed 7 years ago by bdezonia

This bug can be hard to duplicate. I tend to have luck adding an axis to the Boats sample image but it only fails occasionally.

Note - my earlier label of SwingImageDisplay is not right. It is SwingDisplayPanel.

I have debugged this far enough to see that there is a race condition between the SwingDisplayPanel::makeLabel() code and code elsewhere that updates the view that owns the Dataset that is changing.

Basically it is possible for the dataset dims and the view's plane position to be out of sync and incompatible. We can add innoculation code here to make sure data is always compatible but that is not the best fix.

Best would be to avoid the race condition altogether. The problem happens when SwingImageDisplay initiates a setZoom() call due to a DatasetRestructuredEvent. The ZoomEvent is handled in SwingDisplayPanel where it calls makeLabel(). The code from SwingImageDisplay is tagged with warnings about timing issues. Might be best to fix the call there.

comment:2 Changed 7 years ago by bdezonia

Removing the panReset() and setZoom() code from SwingImageDisplay fixes this bug but resurrects 605 & 627. Need to find a solution that works for all three!

comment:3 Changed 7 years ago by bdezonia

For reference: #605 & #627

comment:4 follow-up: ↓ 6 Changed 7 years ago by bdezonia

It turns out #695 and #627 were resurrected without regard to panReset() and panZoom(). Will eliminate these calls.

comment:5 Changed 7 years ago by bdezonia

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in 4d1d8f1f6b2cfcf70d0e197055e8e4c98019618f

comment:6 in reply to: ↑ 4 Changed 7 years ago by bdezonia

Replying to bdezonia:

It turns out #695 and #627 were resurrected without regard to panReset() and panZoom(). Will eliminate these calls.

Typo: not #695 but #605.

So it should refer to #605 & #627

Note: See TracTickets for help on using tickets.