Deadlock when there are multiple options on Raspbian

Support for Ubuntu and other Desktop Linux distributions
Post Reply
iball
Posts: 3
Joined: 07 Aug 2017, 17:07

Deadlock when there are multiple options on Raspbian

Post by iball »

Hi,

I am renaming some of my anime and while the majority of shows work fine, but I have so far come across 5 or so shows that give me the problem below.

Image

OS: Ubuntu 16.04

Code: Select all

FileBot 4.7.9 (r4984)
JNA Native: 5.1.0
MediaInfo: 0.7.93
7-Zip-JBinding: 9.20
Chromaprint: 1.4.2
Extended Attributes: OK
Unicode Filesystem: OK
GVFS: PlatformGVFS [/run/user/1000/gvfs]
Script Bundle: 2017-05-15 (r500)
Groovy: 2.4.10
JRE: Java(TM) SE Runtime Environment 1.8.0_131
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 8 Core / 3 GB Max Memory / 26 MB Used Memory
I will add the folder of episodes to the GUI like normal, press Fetch Data and choose AniDB, then after a few seconds a window will ask me to confirm the correct series. After I click the series name, another window will pop up simply saying AniDB and then Filebot just freezes/crashes. I cannot click the "x" button to close the app as well.

Let me know if any other information is needed.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AniDB window freeze

Post by rednoah »

Are there any logs that might indicate some problem? Please check the console output.
:idea: Please read the FAQ and How to Request Help.
iball
Posts: 3
Joined: 07 Aug 2017, 17:07

Re: AniDB window freeze

Post by iball »

I can easily recreate this issue, how can I get the logs? Do you literally mean what does the console when it happens? Because it doesn't say anything (except for how many files were rewritten before I got to this show). Are there any other commands I should add on to get more info?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AniDB window freeze

Post by rednoah »

Just run Terminal and call filebot and see if the console output says anything when the GUI freezes.

Also, the screenshot doesn't look like Ubuntu. Have you tried the latest stock Ubuntu and see if it works with that one?
:idea: Please read the FAQ and How to Request Help.
iball
Posts: 3
Joined: 07 Aug 2017, 17:07

Re: AniDB window freeze

Post by iball »

Nothing from the terminal

Image

I am using the latest official Ubuntu XFCE

One problem is could be is that I am doing this on a remote server using tigervnc. I do want to reiterate that it is working fine for most of the series though. Also, only filebot freezes, the session itself run normally. Wondering if maybe there is a graphical thing I need to turn off or something.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AniDB window freeze

Post by rednoah »

It's probably a graphical thing, either GTK theme or graphics acceleration, but not sure how to get around those on Linux. I can't reproduce any issues on standard Ubuntu running locally.
:idea: Please read the FAQ and How to Request Help.
Djoss
Posts: 22
Joined: 30 Jul 2018, 17:24

Re: AniDB window freeze

Post by Djoss »

I seem to have a way to easily reproduce this issue with the Docker image (https://hub.docker.com/r/jlesage/filebot):

- Try to rename multiple files that have no match (with the TheTVDB for example).
- You then get a window telling that some files failed to be identified.
- Instead of selecting the best match, just close the window.
- You then get a blank window that can't be close.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AniDB window freeze

Post by rednoah »

Looks like an issue in the underlying platform, and with no warnings or errors in the console, I’m wouldn’t know where to start. There’s a few things we can try though, but this is definitely a more tricky kinda issue.

When the windows hangs, try to collect a Java process dump. So we can see what each thread is doing and where exactly the FUI thread is stuck. That’s might give us clues. You can use the JVisualVM tool to collect dumps.

Also, I see it’s not using the GTK theme. Installing full GTK / Gnome could be a possible work around.

Lastly, there might be Java Swing graphics options, like disabling graphics acceleration, or xrender, etc and maybe one of these options will work around the issue if we’re lucky.
:idea: Please read the FAQ and How to Request Help.
Djoss
Posts: 22
Joined: 30 Jul 2018, 17:24

Re: AniDB window freeze

Post by Djoss »

Here is the output of "jstack" : https://pastebin.com/raw/SqLxcvzj
Hope this is what you were looking for.

I tried to play with Swing graphics options, but nothing helped.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AniDB window freeze

Post by rednoah »

Did installing full GTK / Gnome do anything? That should at least give you the system theme when running FileBot.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AniDB window freeze

Post by rednoah »

There does seem to be a threading / concurrency / deadlock issue. It's very strange that it doesn't seem to be an issue on other platforms, but I might be able to fix this in the FileBot code base,

Code: Select all

"pool-2-thread-1" #49 prio=5 os_prio=0 tid=0x0000556d6949c800 nid=0x43e in Object.wait() [0x0000152e1b93f000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00000006cbdfaf58> (a java.awt.EventQueue$1AWTInvocationLock)
	at java.lang.Object.wait(Object.java:502)
	at java.awt.EventQueue.invokeAndWait(EventQueue.java:1343)
	- locked <0x00000006cbdfaf58> (a java.awt.EventQueue$1AWTInvocationLock)
	at java.awt.EventQueue.invokeAndWait(EventQueue.java:1324)
	at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1348)
	at net.filebot.ui.rename.EpisodeListMatcher.selectSearchResult(EpisodeListMatcher.java:283)
	- locked <0x00000006c8c050e8> (a net.filebot.ui.MainFrame)
	- locked <0x00000006c90df160> (a java.util.TreeMap)
	at net.filebot.ui.rename.EpisodeListMatcher.lambda$null$6(EpisodeListMatcher.java:205)
	at net.filebot.ui.rename.EpisodeListMatcher$$Lambda$277/486458577.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Code: Select all

"AWT-EventQueue-0" #19 prio=6 os_prio=0 tid=0x0000556d67ba5000 nid=0x3e3 waiting for monitor entry [0x0000152e22d1d000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at java.awt.Frame.getState(Frame.java:790)
	- waiting to lock <0x00000006c8c050e8> (a net.filebot.ui.MainFrame)
	at sun.awt.im.InputContext.notifyClientWindowChange(InputContext.java:959)
	- locked <0x00000006c925d708> (a sun.awt.im.InputMethodContext)
	at sun.awt.im.InputContext.activateInputMethod(InputContext.java:411)
	- locked <0x00000006c925d708> (a sun.awt.im.InputMethodContext)
	at sun.awt.im.InputContext.focusGained(InputContext.java:338)
	- locked <0x00000006c925d708> (a sun.awt.im.InputMethodContext)
	- locked <0x00000006c8c00e70> (a java.awt.Component$AWTTreeLock)
	at sun.awt.im.InputContext.dispatchEvent(InputContext.java:245)
	at sun.awt.im.InputMethodContext.dispatchEvent(InputMethodContext.java:196)
	at java.awt.Component.dispatchEventImpl(Component.java:4821)
	at java.awt.Container.dispatchEventImpl(Container.java:2296)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1015)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:639)
	at java.awt.Component.dispatchEventImpl(Component.java:4760)
	at java.awt.Container.dispatchEventImpl(Container.java:2296)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
	at java.awt.EventQueue$4.run(EventQueue.java:733)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
	at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
	at java.awt.Dialog.show(Dialog.java:1084)
	at java.awt.Component.show(Component.java:1671)
	at java.awt.Component.setVisible(Component.java:1623)
	at java.awt.Window.setVisible(Window.java:1014)
	at java.awt.Dialog.setVisible(Dialog.java:1005)
	at net.filebot.ui.rename.EpisodeListMatcher.lambda$selectSearchResult$8(EpisodeListMatcher.java:250)
	at net.filebot.ui.rename.EpisodeListMatcher$$Lambda$288/1039690513.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
:idea: Please read the FAQ and How to Request Help.
Djoss
Posts: 22
Joined: 30 Jul 2018, 17:24

Re: AniDB window freeze

Post by Djoss »

rednoah wrote: 27 Aug 2018, 17:33 Did installing full GTK / Gnome do anything? That should at least give you the system theme when running FileBot.
Not sure how the theme selection/detection is done, but it seems to be already using gtk theme (at least the one coming from Alpine Linux). I did try the Nimbus look and feel (-Dswing.systemlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel) and this issue is still reproducible.
Djoss
Posts: 22
Joined: 30 Jul 2018, 17:24

Re: AniDB window freeze

Post by Djoss »

rednoah wrote: 27 Aug 2018, 17:38 There does seem to be a threading / concurrency / deadlock issue. It's very strange that it doesn't seem to be an issue on other platforms, but I might be able to fix this in the FileBot code base,
That's good news :)
cybrnook
Posts: 3
Joined: 27 Aug 2018, 19:44

Re: AniDB window freeze

Post by cybrnook »

Would be very grateful to see this fixed! Very much so....
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AniDB window freeze

Post by rednoah »

Djoss wrote: 27 Aug 2018, 17:46
rednoah wrote: 27 Aug 2018, 17:33 Did installing full GTK / Gnome do anything? That should at least give you the system theme when running FileBot.
Not sure how the theme selection/detection is done, but it seems to be already using gtk theme (at least the one coming from Alpine Linux). I did try the Nimbus look and feel (-Dswing.systemlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel) and this issue is still reproducible.
OK, I see. Because in the screenshots on the OP is see that it's already defaulting to NimbusLookAndFeel but I guess in your case you actually do get the system look but run into the same deadlock issue regardless.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Deadlock when there are multiple options on Raspbian

Post by rednoah »

FileBot r5846 may fix the issue. Please run a few test and see if it resolves the problem.

CHANGES.tar.xz contains the latest jar:
https://get.filebot.net/filebot/HEAD/
:idea: Please read the FAQ and How to Request Help.
Djoss
Posts: 22
Joined: 30 Jul 2018, 17:24

Re: Deadlock when there are multiple options on Raspbian

Post by Djoss »

rednoah wrote: 28 Aug 2018, 12:54 FileBot r5846 may fix the issue. Please run a few test and see if it resolves the problem.

CHANGES.tar.xz contains the latest jar:
https://get.filebot.net/filebot/HEAD/
Looks good. I cannot reproduce the issue with the steps I provided in this post.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Deadlock when there are multiple options on Raspbian

Post by rednoah »

Nice. Will be part of the next release then. But the next release is probably still 2-3 months off since there's no general pressing issue with the current release.
:idea: Please read the FAQ and How to Request Help.
Djoss
Posts: 22
Joined: 30 Jul 2018, 17:24

Re: Deadlock when there are multiple options on Raspbian

Post by Djoss »

rednoah wrote: 28 Aug 2018, 13:35 Nice. Will be part of the next release then. But the next release is probably still 2-3 months off since there's no general pressing issue with the current release.
Would you consider an earlier release considering that the deadlock is easy to hit when using a Docker image? Else I can integrate the jar you provided, so no pressure ;)

And thanks for the quick fix.
cybrnook
Posts: 3
Joined: 27 Aug 2018, 19:44

Re: Deadlock when there are multiple options on Raspbian

Post by cybrnook »

I agree, that in it's current state @DJoss 's docker that I run is useless, since I can't select the category to be able to tag and rename. There are a few other users in the unraid forums having the same issue. We have been assuming it was just user error.

A release with this fix would get the unraid users (and seemingly others) back up and running. (Plus I don't want to waste my shiny new license I bought... :-( )

Any help is absolutely appreciated :) :) :) :)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Deadlock when there are multiple options on Raspbian

Post by rednoah »

Presumably, your docker uses the portable package, and so you just have to call the update-filebot.sh that is part of the portable package to apply the latest CHANGES.tar.xz to your install. If you're using the DEB package, then you can just unroll the CHANGES.tar.xz into /usr/share/filebot and patching things manually that way. Either way, should just be one simple extra line in your docker file.
:idea: Please read the FAQ and How to Request Help.
Djoss
Posts: 22
Joined: 30 Jul 2018, 17:24

Re: Deadlock when there are multiple options on Raspbian

Post by Djoss »

Thanks, I have integrated the jar manually in the image.
cybrnook
Posts: 3
Joined: 27 Aug 2018, 19:44

Re: Deadlock when there are multiple options on Raspbian

Post by cybrnook »

Thanks both of you!
antisgae
Posts: 13
Joined: 29 Aug 2018, 22:48

Re: Deadlock when there are multiple options on Raspbian

Post by antisgae »

Is fixed for me too, it was a very old bug i had in ubuntu for the last year.
Post Reply