Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when merging entries #5169

Closed
ju-w opened this issue Aug 2, 2019 · 4 comments · Fixed by #5395
Closed

Exception when merging entries #5169

ju-w opened this issue Aug 2, 2019 · 4 comments · Fixed by #5395
Labels
bug Confirmed bugs or reports that are very likely to be bugs duplicateFinder
Milestone

Comments

@ju-w
Copy link

ju-w commented Aug 2, 2019

Hello, I am on Fedora 30, running Jabref Snap Edge

Steps to reproduce the behavior:

  1. Select two items
  2. Open Merge entries dialogue.
  3. Click Merge entries.
  4. Watch Exception thrown.
Log File
1:06:21.749 [JavaFX Application Thread] ERROR org.jabref.FallbackExceptionHandler - Uncaught exception occurred in Thread[JavaFX Application Thread,5,main]
java.lang.IndexOutOfBoundsException: Index: 5, Size: 4
  at java.util.ArrayList.rangeCheck(ArrayList.java:657) ~[?:1.8.0_222]
  at java.util.ArrayList.get(ArrayList.java:433) ~[?:1.8.0_222]
  at com.sun.javafx.collections.ObservableListWrapper.get(ObservableListWrapper.java:89) ~[jfxrt.jar:?]
  at javafx.collections.FXCollections$SynchronizedList.get(FXCollections.java:1085) ~[jfxrt.jar:?]
  at javafx.collections.FXCollections$UnmodifiableObservableListImpl.get(FXCollections.java:936) ~[jfxrt.jar:?]
  at org.jabref.gui.util.MappedList.sourceChanged(MappedList.java:67) ~[JabRef-5.0-dev.jar:?]
  at javafx.collections.transformation.TransformationList.lambda$getListener$1(TransformationList.java:106) ~[jfxrt.jar:?]
  at javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88) ~[jfxrt.jar:?]
  at com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164) ~[jfxrt.jar:?]
  at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73) ~[jfxrt.jar:?]
  at javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233) ~[jfxrt.jar:?]
  at org.jabref.gui.util.UiThreadList.lambda$sourceChanged$934(UiThreadList.java:15) ~[JabRef-5.0-dev.jar:?]
  at com.sun.javafx.application.PlatformImpl.lambda$null$117(PlatformImpl.java:295) ~[jfxrt.jar:?]
  at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_222]
  at com.sun.javafx.application.PlatformImpl.lambda$runLater$118(PlatformImpl.java:294) ~[jfxrt.jar:?]
  at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) ~[jfxrt.jar:?]
  at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) ~[jfxrt.jar:?]
  at com.sun.glass.ui.gtk.GtkApplication.lambda$null$450(GtkApplication.java:139) ~[jfxrt.jar:?]
  at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
@Siedlerchr Siedlerchr added the os: snap When JabRef is run as a snap on linux label Aug 10, 2019
@Siedlerchr
Copy link
Member

The new java 5.0 alpha now requires java 11 and openjfx11, so you no longer need to run a snap version.
Please report back if this is fixed

@Siedlerchr Siedlerchr added the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Aug 26, 2019
@LyzardKing
Copy link
Collaborator

@Siedlerchr I can reproduce this issue, but I'm not sure it's simply a snap error.
Is there a debug log we can get of the operation?

@sauliusg
Copy link
Contributor

sauliusg commented Sep 20, 2019

I can reproduce this issue on Ubuntu-16.04 x86_64, running the master db96f88 build from https://github.com/JabRef/jabref.git, just running the script build/image/bin/JabRefMain from the command line (thus I am not using snap, I suppose).

@Siedlerchr Siedlerchr added bug Confirmed bugs or reports that are very likely to be bugs and removed os: snap When JabRef is run as a snap on linux status: waiting-for-feedback The submitter or other users need to provide more information about the issue labels Sep 20, 2019
@Siedlerchr
Copy link
Member

Could also confirm this under windows.

I have 8 entries and merge two of them.
This looks like it's somehow a threading issue, because in merge two entries get removed and one new entry is added. Tried to debug it, but not really found the root cause.

java.lang.IndexOutOfBoundsException: Index: 7, Size: 4
	at java.base/java.util.ArrayList.rangeCheckForAdd(ArrayList.java:787)
	at java.base/java.util.ArrayList.add(ArrayList.java:512)
	at org.jabref/org.jabref.gui.util.MappedList.sourceChanged(MappedList.java:67)
	at javafx.base/javafx.collections.transformation.TransformationList.lambda$getListener$0(TransformationList.java:106)
	at javafx.base/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
	at javafx.base/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164)
	at javafx.base/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
	at org.jabref/org.jabref.gui.util.UiThreadList.lambda$0(UiThreadList.java:15)
	at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
	at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
	at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
	at java.base/java.lang.Thread.run(Thread.java:834)

@tobiasdiez tobiasdiez added this to the v5.0 milestone Sep 27, 2019
tobiasdiez added a commit that referenced this issue Oct 6, 2019
The problem was that `sourceChanged` was invoked asynchronous and thus the information in the change event could be obsolete if another thread changed the underlying list in the meantime. Solution: run `sourceChanged` on the JavaFX thread but synchronously.
Fixes #5169.
@koppor koppor moved this to Done in Prioritization Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs duplicateFinder
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants