JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.63k stars 2.59k forks source link

Hangs after editing abstract of existing entry #2489

Closed ziggystar closed 6 years ago

ziggystar commented 7 years ago
## Versions - JabRef version 3.8.1 - on Ubuntu 16.04 - java version "1.8.0_121" (oracle) ## Issue The program hangs with no CPU utilization after editing an abstract (removing a HTML code and replacing it with the word 'and'). I don't know whether this is reproducible, simply editing an abstract didn't do it. But I have a thread dump attached. I think it's some kind of deadlock/race condition, and I hope you can diagnose it from the stack traces. [jabref-thread-dump.zip](https://github.com/JabRef/jabref/files/732157/jabref-thread-dump.zip)
koppor commented 7 years ago

Could you a) try to reproduce? b) provide us the abstract?

Here, I can edit the abstract without issues.

Am 26.01.2017 12:31 schrieb "ziggystar" notifications@github.com:

Versions

  • JabRef version 3.8.1
  • on Ubuntu 16.04
  • java version "1.8.0_121" (oracle)

Issue

The program hangs with no CPU utilization after editing an abstract (removing a HTML code and replacing it with the word 'and'). I don't know whether this is reproducible, but I have a thread dump attached. I think it's some kind of deadlock, and I hope you can diagnose it from the stack-traces. jabref-thread-dump.zip https://github.com/JabRef/jabref/files/732157/jabref-thread-dump.zip

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JabRef/jabref/issues/2489, or mute the thread https://github.com/notifications/unsubscribe-auth/ABTafpvSg7R-QNPnTYOe9kwANXmfrHVRks5rWIQmgaJpZM4Luiqe .

ziggystar commented 7 years ago

I tried for a bit and I can't reproduce it. I don't know exactly what I clicked after editing the abstract.

I looked a bit into the sources and couldn't find an obvious issue with the locking.

Here is the relevant part of the stack; apparently I hit a key that triggered the save database action. That's quite possible.

"AWT-EventQueue-0" #14 prio=6 os_prio=0 tid=0x00007f365c782000 nid=0x4919 waiting on condition [0x00007f36121c0000]
<snip>
    at ca.odell.glazedlists.impl.java15.LockAdapter.lock(J2SE50LockFactory.java:85)
    at net.sf.jabref.gui.maintable.MainTableDataModel$StartStopListFilterAction.update(MainTableDataModel.java:237)
    at net.sf.jabref.gui.maintable.MainTableDataModel$StartStopListFilterAction.start(MainTableDataModel.java:229)
    at net.sf.jabref.gui.maintable.MainTableDataModel.updateSearchState(MainTableDataModel.java:95)
    at net.sf.jabref.gui.search.SearchWorker.updateUIWithSearchResult(SearchWorker.java:88)
    at net.sf.jabref.gui.search.SearchWorker.done(SearchWorker.java:57)

<maybe the fact it's a timer is interesting>
    at javax.swing.Timer.fireActionPerformed(Timer.java:313)
<snip>
    at net.sf.jabref.gui.BasePanel.runCommand(BasePanel.java:1002)
    at net.sf.jabref.gui.entryeditor.EntryEditor$SaveDatabaseAction.actionPerformed(EntryEditor.java:1379)
    at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1663)
    at javax.swing.JComponent.processKeyBinding(JComponent.java:2882)
<snip>
paulsputer commented 7 years ago

Just been debugging #2482 and found similar deadlock. Screenshots attached for AWT-EventQueue-0 and JabRef CachedThreadPool

awt-eventqueue-0

cachedthreadpool

paulsputer commented 7 years ago

This appears to be caused by updates to the UI on multiple threads. @ziggystar if you can look at what the other threads are doing that may be able to track it down. See my screenshots above to identify the deadlock (waiting for / waited by), then work down the list until you get to a call that is the JabRef code, i.e. on with a line number.

lenhard commented 7 years ago

There's a good chance that this is solved on 4.0, because the entry editor has been largely re-written.

@ziggystar @paulsputer Can you please try out the most recent version and see if the issue persists?

ziggystar commented 7 years ago

@lenhard I've already stated that I cannot reproduce this bug, and the stack dump is all I can provide. Apparently it's some kind of race condition.

LinusDietz commented 7 years ago

Then I'll close it for now. Feel free to reopen if the problem occurs again.

ziggystar commented 7 years ago

Quite funny. I downloaded 4.0 and used it for some minutes, then I got another deadlock. I have a thread dump attached. It occurred after I clicked "accept changes" (or similar) of the dialog you get when fetching and updating entry items using a DOI.

thread dump

LinusDietz commented 7 years ago

Thanks, @ziggystar!

ramiromagno commented 6 years ago

Here's another way for jabref to hang with same symptoms..

jabref installation details:

JabRef 4.2-dev Linux 4.14.6-1-arch amd64 Java 1.8.0_144

Steps to reproduce the error:

  1. Launch jabref
  2. Use "Web Search", pick "Medline/PubMed", search with the term "pcr".
  3. Deselect all hit results, and pick "Carow et al." (Carow, K.; Read, C.; Häfner, N.; Runnebaum, I. B.; Corner, A. & Dürst, M. A comparative study of digital PCR and real-time qPCR for the detection and quantification of HPV mRNA in sentinel lymph nodes of cervical cancer patients. BMC research notes, 2017, 10, 532 )
  4. With "Carow et al." entry selected go to the "Quality" menu and choose "Look up full text documents".
  5. Press "OK" on that popup window and voila jabref is frozen.
ramiromagno commented 6 years ago

BTW, this problem was already present in version 4.1.

lenhard commented 6 years ago

@ramiromagno Thanks for the precise workflow. I just tried to reproduce the bug with your exact steps and JabRef did not freeze. Instead the pdf download window appeared and I could link a pdf to the entry. Maybe the freeze came from your network connection or a firewall blocking the download?

ramiromagno commented 6 years ago

@lenhard I can't reproduce this error anymore... Sorry! I am not sure what I've done in jabref since last time that might have made the error disappear.

ziggystar commented 6 years ago

C'mon. You cannot close this issue because someone can't reproduce a race condition. He is not the only one experiencing this. This is a serious bug that makes the application crash.

ziggystar commented 6 years ago

This means tickets for existing bugs must get closed, because no one is working on them? And if someone comes along in the future, maybe someone experiencing this same bug, someone willing to work on it, he shall not find this thread with lots of valuable information?