mastodon-sc / mastodon

Mastodon – a large-scale tracking and track-editing framework for large, multi-view images.
BSD 2-Clause "Simplified" License
66 stars 20 forks source link

Show track downward in TrackScheme Hierarchy View leads to crash #222

Closed stefanhahmann closed 1 year ago

stefanhahmann commented 1 year ago

Reproduction

  1. Start Fiji
  2. Plugins > Mastodon
  3. open Mastodon project > open grapher-bug.mastodon (download: https://cloudstore.zih.tu-dresden.de/index.php/s/XgbnqRDgb9jLXLb)
  4. Window > New TrackScheme Hierarchy
  5. Select a branch
  6. View > Show Track Downward > Program crashes

Expected behaviour:

After step 6. "Show Track Downward", the TrackScheme Hierarchy view should zoom to the sub-tree of the selected branch

File for testing:

https://cloudstore.zih.tu-dresden.de/index.php/s/XgbnqRDgb9jLXLb

StackTrace:

grafik

UI interaction:

GIF 16 12 2022 14-52-26

tpietzsch commented 1 year ago

The exception is from the "Rebuild spatial indices" thread which runs continuously in the background. Do you think this is because something in the foreground (caused by Show Track Downward) eats up all the memory? And hence the location where the OOM finally occurs is rather arbitrary? Or is this more closely related?

maarzt commented 1 year ago

@tpietzsch: Do you think this is because something in the foreground (caused by Show Track Downward) eats up all the memory? And hence the location where the OOM finally occurs is rather arbitrary? Or is this more closely related?

I think you are right. This bug is not related to the spatial index. It just so happened that the spatial index triggered the OutOfBoundsException.

There might be a loop in the graph. The "Show Track Downward" operation does a depth first search to find the roots of the selected sub trees. This depth first search has no detection for loops and it therefor doesn't terminate. I will fix it.

stefanhahmann commented 1 year ago

Resolved with #229