BiglySoftware / BiglyBT

Feature-filled Bittorrent client based on the Azureus open source project
https://www.biglybt.com
GNU General Public License v2.0
1.57k stars 153 forks source link

Mac Crashing: Deleting causing endless hang #1420

Closed reekes closed 4 years ago

reekes commented 4 years ago

Since the latest update, I'm having endless crashes. I get the SBOD. The only way out is to force-quit BiglyBT. Also noticed I don't get the check files after re-launching. It just immediately starts downloading, as if nothing went wrong.

Steps

Select a torrent to delete Click the X button

I may or may not crash. When it works, it's normal. When it doesn't, I get a hang that requires a force quit.

Doesn't seem to matter if the torrent is empty of all files (never downloaded anything), or if it was a completed download.

It's happening so often I can't delete torrents because it will crash, and I'm compromising data.

Java 1.8.0_202 (64 bit) Oracle Corporation /Applications/BiglyBT/.install4j/jre.bundle/Contents/Home/jre SWT v4928r15, cocoa, zoom=100, dpi=72 Mac OS X v10.14.6, x86_64 (64 bit) B2.2.0.2/4 az3

reekes commented 4 years ago

I found this in the debug log. I can't say this error was associated with my crashes. I looked, and didn't see anything that I recognize as part of the crashes I'm having.

[17:43:05] [alert] Alert:3:Problem moving files to removed download directory [17:43:05] [stderr] DEBUG::Fri Dec 20 17:43:05 PST 2019::com.biglybt.core.download.impl.DownloadManagerImpl::destroy::6565: [17:43:05] [stderr] com.biglybt.core.download.DownloadManagerException: rename operation failed at com.biglybt.core.download.impl.DownloadManagerImpl.moveDataFilesSupport0(DownloadManagerImpl.java:5000) at com.biglybt.core.download.impl.DownloadManagerImpl.moveDataFilesSupport(DownloadManagerImpl.java:4789) at com.biglybt.core.download.impl.DownloadManagerImpl$18.run(DownloadManagerImpl.java:4753) at com.biglybt.core.impl.CoreImpl.createOperation(CoreImpl.java:3081) at com.biglybt.core.util.FileUtil.runAsTask(FileUtil.java:2562) at com.biglybt.core.util.FileUtil.runAsTask(FileUtil.java:2552) at com.biglybt.core.download.impl.DownloadManagerImpl.moveDataFiles(DownloadManagerImpl.java:4685) at com.biglybt.core.download.impl.DownloadManagerImpl.moveDataFiles(DownloadManagerImpl.java:4645) at com.biglybt.core.download.impl.DownloadManagerImpl.destroy(DownloadManagerImpl.java:6560) at com.biglybt.core.global.impl.GlobalManagerImpl.removeDownloadManager(GlobalManagerImpl.java:1590) at com.biglybt.ui.swt.views.utils.ManagerUtils$6.runSupport(ManagerUtils.java:1958) at com.biglybt.core.util.AsyncDispatcher$1.run(AsyncDispatcher.java:161) at com.biglybt.core.util.AEThread2$threadWrapper.run(AEThread2.java:317)

parg commented 4 years ago

Please take a look at https://github.com/BiglySoftware/BiglyBT/wiki/Diagnostics

reekes commented 4 years ago

I tried deleting a few fully downloaded torrents. They worked. Then I selected a couple torrents at once, and tried to delete them. That hung. I selected three fully downloaded torrents, and choose to remove from library (not actually delete the files). I selected the option to remove all at once. That's what hung this time, but it's hung before for other reasons.

I re-launched and tried to duplicate this, but it worked. My second attempt to select multiple torrents and delete worked. So the crash is more random.

While it was hung, I tried using the web page but it's a black screen. Looking at the log files, it seems like a deadlock in Java. I've attached my two log files.

Archivezip.zip

parg commented 4 years ago

The 'black page' is a sign of success :) Thanks for the debug, I'll take a look

parg commented 4 years ago

So the UI thread is waiting on a lock that is held by another thread that is in the middle of moving files to trash via some OSX specific code:

AsyncDispatcher: ManagerUtils.java:1934: Runnable, 596ms CPU, B/W: 248/8262
    com.apple.eio.FileManager._moveToTrash(Native Method)

So either the 'move to trash' is taking a very long time for some reason and giving the appearance of a crashed BiglyBT or there is some internal issue with the OSX 'move to trash' code that has caused it to hang - hard to say which by looking at the log ;(

I assume you've waited a while to see if the 'crash' resolves itself?

parg commented 4 years ago

btw, you can disable the 'move to trash' feature via Tools->Options->Files: File Deletion

but I'd like to know if there is an issue - I could look into moving the operation onto a separate thread if there is to at least mitigate things...

parg commented 4 years ago

2203_B06 might improve things, please test if you get a chance. I moved the recycle action onto a separate thread but it still waits for 30 secs for it to complete so if you are still encountering the issue you might get a pause

reekes commented 4 years ago

I assume you've waited a while to see if the 'crash' resolves itself?

Yes - 30 or more with no change. But this is a new issue with the latest update. Something has changed that's causing this. I've done this action countless number of times in the past.

At the same time I can move or delete files while the app has hung trying to do the same.

2203_B06 might improve things, please test if you get a chance

I don't know what that means.

reekes commented 4 years ago

I removed a few torrents that had fully downloaded. One by one. Did about 6. Then I tried 3 at once. All worked. Then i tried 6 at once. That hung.

I waited 120 seconds with no change.

While it was hung, the file system was fully responsive. I could move and delete files at the desktop.

With the Activity Monitor, I can see the app is still performing both network and disk I/O.

After forcing it to quit, and then re-launching...it looks like the 6 torrents were removed.

So it seems there's a deadlock, and it's affecting the UI. It's the UI that "hangs" and becomes non-responsive.

parg commented 4 years ago

2203_B06 = beta version build 6 - see the Help menu

reekes commented 4 years ago

I've been running the beta and haven't seen the problem. Not confident we know the problem and fixed it, since it seemed random. I also haven't deleted as much as I had previously. Still, I would have expected at least one hang by now. So it seems like good news.

reekes commented 4 years ago

I installed the current release, but this bug hasn't been fixed yet? It still hangs when I tried to delete. I'm not interested in the numerous beta updates.

parg commented 4 years ago

Here's the thing, only you manage to cause this problem (nobody else has reported it so that's all I can go on).

I made some changes. You reported that the problem had stopped occurring. Therefore, fairly logically, I assume it has been fixed.

Now you pop up with 'how come the bug hasn't been fixed?' and from the tone of your message you're not interested in helping to diagnose it.

reekes commented 4 years ago

After tested on Dec 30 I reported it seems to be fixed. But the fix hasn't been released. I'm asking when can I stop running all the betas and expect a release with the fix?

reekes commented 4 years ago

And I did help diagnose it. I've provided log files, ran betas, etc. What more can I do?

parg commented 4 years ago

Ah, I appologise, I didn't realise the fix was in the current 2203_Bnn series and incorrectly assumed it had made it into the 'current release' - whoops.

The next release won't be too long in the making but in the meantime you can avoid being prompted to update each beta by simply joining the beta program, updating to the latest one and then leaving it (Help menu option) - ignore the bit about manually reverting to the prior release and just sit there on that beta until the next full release occurs.

Sorry again :(