jabref: NegativeArraySizeException on saving

JabRef version

5.3 (latest release)

Operating system

Windows

Details on version and operating system

No response

Checked with the latest development build

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. System fails to save updated entries (annotation and correcting commata etc.). Closing the program after that a big amount of data (400 of over 900 entries) was deleted, even though the user had not worked on those entires, and the subcategories vanished completely. The same issue occured before and after the updated version. Data could be restored due to externally made backups.
  2. User is saving entries frequently. But even though older entries got deleted.
  3. No particular occurances or steps before the error is reported.
  4. The attempt to export the existing data after that occurance failed as well. Only a small amount was exported for example in rtf. Each try provided different data sets, but never all existing entries.

Appendix

Log File
2 screenshots of the error notification.
JabRef 2021_11_18 ![JabRef 2021_11_19](https://user-images.githubusercontent.com/72263522/142839360-885288ee-3242-4212-b91c-3b5396230fe5.JPG)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21 (11 by maintainers)

Most upvoted comments

I deleted the Schlemmer-Error (finally), but didn’t have a “q” in the mentioned line. Shouldn’t be a bother. I guess. I assume, we will have to wait now and see how it turns out, when my colleague is working on the Bib again. But now I know where to look for a start, if there are any hickups. Thank you very much!

Thank you very much for your report. The exception looks similar to #8231 A quick look in the code seems to show that it has to do with writing the formatted field names. I guess that somehow the field.length is wrong/or negative (probaby). Indentation (the second parameter) is the length of the longest field name in the library - or zero)

https://github.com/JabRef/jabref/blob/5680d154d238e4dc3d9cc76968a490e30dca4798/src/main/java/org/jabref/logic/bibtex/BibEntryWriter.java#L191-L193 Do you use any Custom entry types or entry types with (non standard) fields?

PS: You can send bib files with sensitive data to vorstand[at]jabref.org or developers[at]jabref.org. They will be handled securely by the dev team only.