DegateCommunity / Degate

A modern and open-source cross-platform software for chips reverse engineering.
https://www.degate.org
GNU General Public License v3.0
251 stars 31 forks source link

[Attached feature] Crash when handling large images (beta) #24

Closed dev-zzo closed 2 months ago

dev-zzo commented 1 year ago

Describe the bug Degate seems to be unable to handle large images in the latest version with the 'attached' project type.

To Reproduce Steps to reproduce the behavior:

  1. Create a JPEG of 53675x24205 pixels
  2. Create a new 'attached' project
  3. Use that JPEG as one of the layers
  4. Zoom in on the image several times (I counted about 21 click on the + button), at some point the program hangs and crashes

I also tested the half-sized image with the same result.

Expected behavior There should be no crashing.

Desktop (please complete the following information):

DorianBDev commented 1 year ago

Hi! Thanks for this bug report. I think the issue comes from thread count exhaustion since Degate will try to load image chunks around each position, and at each zoom level. With a big image this might lag behind since loading takes time, and thread count might just explode and make Degate hang/crash.

I'll try to address the issue by changing a bit the loading system, but that might take some time. A possible workaround before landing a fix could be to reduce some parameters to lower values in preferences. I'll try to add some status update soon.

DorianBDev commented 1 year ago

@dev-zzo Could you confirm that Degate was initially loading the image (you were able to see it), but after zooming multiple time it freezes and crash?

dev-zzo commented 1 year ago

With the 'attached' project type, that is the observed behaviour indeed.

DorianBDev commented 11 months ago

A small update on the issue: I might have found an algorithm that'll fix the problem. However it might take some time to experiment and find the best variant. I'll also add a visual indicator when a tile is loading, and make sure even under heavy load Degate will not crash/freeze (in worse case loading will just be very slow). I'm really busy for the end of the year, but I hope I'll land a fix (and new beta version) before the new year.

DorianBDev commented 3 months ago

I should have fixed the issue with 77631e1f0abfaee290802388874c46e766620263. I'll do more tests and a bit of cleanup before creating & merging a PR. I regret not having had more time before to tackle the issue (which did not take long to resolve).

DorianBDev commented 2 months ago

A fix landed in the new 2.1.0-beta.2 pre-release. Pre-built binaries are available.