[Bug report] Zotero keeps crashing to desktop when in PDF reader after ~100 annotations

edited November 21, 2022
Context :

Windows 11
Zotero 6.0.18
WebDAV : koofr


Bug description and observations :

I'm working on a 300 pages / 26Mb PDF made of images (no text). At first, no problems.
When I reached a third of the document and made ~100 annotations (in the form of notes and area highlights), it began to regularly crash to desktop, without any error message.

When I restart Zotero, it will take a good 5 minutes to open the PDF, and will very regularly crash to desktop to the point Zotero is not usable anymore with this PDF.

Zotero RAM usage is very high (up to 2 Gb).


What I tried :

At first, I thought it came from a problem with Koofr WebDAV. But working offline does not solve the problem.

I can transmit more details or log, if told where they are stored. "Help > Error log" shows no error message. jsconsole crashes when Zotero crashes so I can't read the logs there neither.

Thanks for your help.
  • After another crash, I was able to get this from the error log :

    [JavaScript Error: "Translators not yet loaded"]

    [JavaScript Error: "Translators not yet loaded"]

    [JavaScript Error: "Translators not yet loaded"]

    [JavaScript Error: "XML Parsing Error: no root element found
    Location: https://**********@live.fr:****@app.koofr.net/dav/Koofr/zotero/
    Line Number 1, Column 1:" {file: "https://**********@live.fr:****@app.koofr.net/dav/Koofr/zotero/" line: 1}]

    [JavaScript Error: "TypeError: can't access dead object" {file: "chrome://zotero/content/xpcom/reader.js" line: 1259}]

    version => 6.0.18, platform => Win32, oscpu => Windows NT 10.0; WOW64, locale => fr-FR, appName => Zotero, appVersion => 6.0.18, extensions => Zotero LibreOffice Integration (6.0.3.SA.6.0.18, extension), Zotero Word for Windows Integration (6.0.2.SA.6.0.18, extension), Better BibTex for Zotero (6.7.40, extension)
  • Does it help if you disable Better BibTex extension?
  • Isn't this just a RAM crash on the Windows (i.e. 32-bit) app? That's what it sounds like to me
  • edited November 23, 2022
    @martynas_b : Thanks, unfortunately disabling Better BibTex didn't help.

    @adamsmith : But why such high RAM usage in the first place ? Should I download a 64 bit version ?

    I made another attempt today :

    1. Start Zotero.
    2. Open the incriminated PDF.
    3. It loads for a good 4mn. CPU usage is ~22%. Ram usage stays at 600Mb to 900Mb.
    4. RAM usage rises to 2.3 Gb.

    I got a popup saying (first time this happens) :

    > A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.

    > Script: resource://zotero/pdf-reader/annotator.js:2207

    5. Crash back to desktop.

    ---

    Please find below a sample of messages I have in the error console :

    [JavaScript Warning: "unreachable code after return statement" {file: "resource://zotero/loader.jsm -> resource://zotero/bluebird/util.js" line: 205 column: 4 source: " eval(obj);
    "}]

    [JavaScript Warning: "unreachable code after return statement" {file: "chrome://zotero/content/zoteroPane.js" line: 5962}]

    [JavaScript Warning: "Unknown property ‘tab-size’. Declaration dropped." {file: "resource://zotero/note-editor/editor.css" line: 1}]

    [JavaScript Warning: "Error in parsing value for ‘-webkit-text-size-adjust’. Declaration dropped." {file: "resource://zotero/note-editor/editor.css" line: 1}]

    [JavaScript Warning: "Unknown pseudo-class or pseudo-element ‘-webkit-search-decoration’. Ruleset ignored due to bad selector." {file: "resource://zotero/note-editor/editor.css" line: 1}]

    [JavaScript Warning: "Unknown pseudo-class or pseudo-element ‘selection’. Ruleset ignored due to bad selector." {file: "resource://zotero/note-editor/editor.css" line: 1}]

    [JavaScript Warning: "Removed unsafe attribute. Element: svg. Attribute: xmlns." {file: "chrome://zotero/content/components/icons.js" line: 215}]

    [JavaScript Error: "XML Parsing Error: no root element found
    Location: https://USERNAME@live.fr:aoh9nvj8n5yx5yqf@app.koofr.net/dav/Koofr/zotero/
    Line Number 1, Column 1:" {file: "https://USERNAME@live.fr:****@app.koofr.net/dav/Koofr/zotero/" line: 1}]
  • Sorry that wasn't clear -- there is no 64-bit version for Windows, which means it's more likely to run into memory issues than the Mac & Linux 64-bit versions.

    You're rendering a fairly massive file (are you sure it's only 26MB by the way? I'd expect 300 pages of images to be more like 260MB) and then adding more complexity, so I think that's about to be expected in terms of RAM.
  • @adamsmith : My bad, the PDF file is not 26Mb, it's 80Mb.

    Still unsure why 50 highlights on a 80Mb pdf should lead to constant crash and 2.3Gb RAM use though ? How can I help to investigate this bug ?

  • edited November 25, 2022
    Update : I'm not able to extract the annotations anymore. It creates an empty "Untitled note".

    Is there anything I can do to help the investigation ?

    Thank you.
  • @JorgePLK Could you export the PDF file with annotations (File → Save As), upload to Dropbox, Google Drive, etc. and send us a link to support@zotero.org. If the export fails or you don't want to do that, please send us at least the file.

    Also, how many, approximately, highlight and image annotations there are?
  • I tested the PDF file and it seems Zotero memory usage can spike over 2GB when intensively scrolling this PDF file, and then settles down to around 1GB once scrolling is finished. The PDF file has high resolution images that are slow to render. All this should be improved on Zotero 7.

    @JorgePLK Are you using HiDPI display? Because it could potentially increase memory usage in PDF reader as well.

  • edited November 30, 2022
    @martynas_b : Thanks. I'm not sure how to check HiDPI, I have two monitors (laptop and another one), both 1920x1080.

    Ok so in Zotero 6 high RAM usage is to be expected, even for 80Mb PDF ? Does this also explain the 5mn loading time and constant crash (to the point I can't work anymore with this highlighted PDF) ?

    Were you able to confirm that Zotero 7 solve these issues (especially high loading time and then constant crash) ?

    Thank you for your investigation, and looking forward to testing Zotero 7.
  • I saw you created another discussion about image annotations. If you did something that triggers all image annotation re-rendering (newly synced annotations or deleted cached images) that might be the problem why it takes so long to load the file or Zotero runs out of memory. Because rendering that many image annotations for the first time can be very intensive.
  • edited December 1, 2022
    @martynas_b :

    >might be the problem why it takes so long to load the file or Zotero runs out of memory

    I am really interested to know more about it ! I don't know what is "image annotation re-rendering" or how could I possibly have activated this ? How could I check this ?

    Only extension I have is Better BibTex for Zotero. Better BibTex regularly exports a .bib and .json file to an iCloud synced folder. I have enabled data syncing via my Zotero account, and Data syncing via WebDav (Koofr). My Zotero storage folder is also synced to my Android phone via Syncthing (only Desktop -> Android, and not Desktop <-> Android).

    (P.S. : About the (other discussion)[https://forums.zotero.org/discussion/comment/423341#Comment_423341], is such thing possible or planned ?)
  • @martynas_b : Really interested to know more about it (cf. previous post). Thank you !
  • @JorgePLK Image annotation rendering happens automatically when you modify or create image annotations. The images are cached in Zotero data directory. And no, there is no way to configure image resolution (it can't be too low because it would look bad on HiDPI screens or when printed).
  • edited December 8, 2022
    @martynas_b : So, just to make sure I understand what you say : there is nothing I can do in Zotero 6 to solve this problem, right ?

    A 80Mb PDF with 50 area highlights is expected to load in 5 minutes, use more than 2Gb of RAM, and very regularly crash. Is that correct ?
  • This should get better in Zotero 7. We'll also try to optimize mass image annotation rendering.
Sign In or Register to comment.