Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.7k stars 308 forks source link

RT crashes when opens a folder in file browser and then delete it in Windows explorer #6176

Open syyrmb opened 3 years ago

syyrmb commented 3 years ago

Short description When opening a folder in RawTherapee's file browser, and then delete that folder in Windows 10s' explorer, RawTherapee will freeze up and requires you to force-quit it.

Steps to reproduce

  1. Open RawTherapee and open a folder (double click on it).
  2. Delete that folder in Windows explorer.
  3. Back to RawTherapee and click on its interface.
  4. Freeze (RawTherapee not responding)

Expected behavior RawTherapee should updates its file browser and removes the deleted folder without freezing.

Additional information

Other useful information:

MJacal commented 3 years ago

I can not reproduce this with RawTherapee_dev_5.8-2822-g170df0393_20210320 on Windows 10, RT does not crash, no problems of any kind here.

syyrmb commented 3 years ago

I can not reproduce this with RawTherapee_dev_5.8-2822-g170df0393_20210320 on Windows 10, RT does not crash, no problems of any kind here.

Thanks for testing. That's pretty weird, then (Maybe it's my computer being weird again). I recorded a video demo, hopefully it can be useful (I blurred some parts due to privacy concerns). RT_crash_demo.zip

MJacal commented 3 years ago

Update: I can reproduce it, but only when the test folder, that gets deleted, is empty. In my first attempt I have put a couple of photos into it.

Same behaviour on my Windows 10 laptop with RT 5.8-2461.

heckflosse commented 3 years ago

I will try to reproduce this...

heckflosse commented 3 years ago

I created an empty folder at my C: drive C:\empty, opened the folder in RawTherapee, switched to Windows explorer, deleted the folder, switched to RawTherapee and got no crash. I must miss something...

heckflosse commented 3 years ago

@syyrmb Your video shows a freeze, not a crash. Though in my tests I even get no freeze...

syyrmb commented 3 years ago

@syyrmb Your video shows a freeze, not a crash. Though in my tests I even get no freeze...

Yeah this is not a crash, I'll fix that. If you don't double click on the "empty" folder in RT, then it'll be fine when you delete it.

heckflosse commented 3 years ago

I double clicked in RT on the non existing (after deletion) empty folder and still no freeze or crash

syyrmb commented 3 years ago

I double clicked in RT on the non existing (after deletion) empty folder and still no freeze or crash

Sorry for not being clear, the first step is double clicking on the empty folder, then delete it, and finally going back to RT.

heckflosse commented 3 years ago

Sorry for not being clear, the first step is double clicking on the empty folder, then delete it, and finally going back to RT.

That was quite clear and exactly what I did without a crash or freeze. Really strange...

Thanatomanic commented 3 years ago

I can confirm the freeze...

Edit: for reference (the file is sent to the recycle bin, but the dialog is on my second screen)

https://user-images.githubusercontent.com/6567747/112000949-bfea1180-8b1e-11eb-888d-522e56d00d1e.mp4

syyrmb commented 3 years ago

Sorry for not being clear, the first step is double clicking on the empty folder, then delete it, and finally going back to RT.

That was quite clear and exactly what I did without a crash or freeze. Really strange...

Where did you deleted folder go, to the recycle bin or totally deleted? I found that using shift+delete is fine.

heckflosse commented 3 years ago

@Thanatomanic

I can confirm the freeze...

Can you nail it with a debug build?

heckflosse commented 3 years ago

@syyrmb

Where did you deleted folder go, to the recycle bin or totally deleted? I found that using shift+delete is fine.

Good point. I totally deleted in my test...

Thanatomanic commented 3 years ago

Okay, so far:

  1. Confirmed that removing an empty folder that is also open in RT's file browser, freezes the program
  2. Confirmed that shift-deleting the empty folder has no problem.
  3. Confirmed that removing a non-empty folder does not freeze RT, however...
  4. Dubious behavior: removing a non-empty folder removes the folder reference in the "Folders" list, but the actual file browser portion stays unchanged. I would assume this gets emptied, since the files do not exist anymore. Trying to open an image results in a "Cannot load image" message, and luckily does not freeze the program. However, what does this all mean for the cached data?

Anyway, I'll try @heckflosse 's suggestion for a debug build!

heckflosse commented 3 years ago

@Thanatomanic

Anyway, I'll try @heckflosse 's suggestion for a debug build!

Keep in mind that debugging a frozen program is not straight forward using gdb on msys2. You can not use CTRL-C because then gdb will terminate. You will have to use another msys2 terminal and attach gdb to the process of the frozen RT session. There is an issue somewhere in RT Github, but I didn't find it on the rush...