giuspen / cherrytree

cherrytree
https://www.giuspen.net/cherrytree/
Other
3.29k stars 457 forks source link

Crash when exporting to PDF #2501

Closed VeldtSoft closed 1 month ago

VeldtSoft commented 2 months ago

Version, Operative system State the Version and the Operative System/Desktop. Try the latest available version before reporting an issue. Version: 1.0.4 AppImage, on system: Linux Mint 21.3 Cinnamon 64-bit

Describe the bug I'm not sure if this is a known / fixable issue yet but I haven't been able to find anything or troubleshoot much on my own - when running an export as PDF operation on my entire notebook (single file export, all nodes/tree), the printing process gets to about 600 out of 1300+ and crashes with SIGTRAP error (in gdb, screenshots below). Exporting as plaintext works fine, it seems like it may be something related to images i have in my notebook/nodes as I haven't made any system changes or upgrades to my OS or CT lately and it was working fine about a week ago.

For background, usually I make plaintext exports as primary backups and separate secondary pdf backups to include all the images in a single file that can't be stored as plaintext, and when performing this process I started receiving a program crash every time I attempt to export (just pdf version, no issues with plaintext). If anyone has any known solutions or if it is more likely that I have a corrupted image / attachment in my notebook please advise for troubleshooting steps as I couldn't find any information about this issue anywhere as of yet and don't know if there is a way with cherrytree or sqlite to easily find an attachment if it is corrupted and causing the issue, thanks and much appreciated and if you need more information/screenshots/details please let me know.

To Reproduce If applicable, attach a non-personal document where the issue can be reproduced systematically. Steps to reproduce the behavior:

  1. Go to 'File > Export > Export to PDF'
  2. Click on 'Export (All the tree checked)'
  3. Wait for Export / Printing process (reaches value of 622 out of 1300 or something close to that)
  4. Program crash (gdb returns: AppRun.wrapped received signal SIGTRAP, trace / breakpoint trap\n (memory address) in g_logv function from /tmp/.mount_Cherrydc6myH/usr/bin/../lib/libglib-2.0.so.0)

Screenshots If applicable, add screenshots to help explain your problem. CT_pdf_export_issue_gdb_debug_session CT_debug_info1

gitvectors commented 2 months ago

Troubleshooting approach. I tend to think of workarounds when considering such issues.

If you suspect some corrupted image then you can evolve a workflow to find it.

This is what I might try. Note that personally I do not use sqlite format CT.

Firstly export your sqlite document into a plain test *.ctd document, sans sql.

Install XMLCopyEditor (an XML editor).

Read the *.ctd document in XMLCopyEditor. You can see the format with XML elements.

Now carefully you can comment out large swathes of XML code as discused here. https://stackoverflow.com/questions/2757396/how-do-i-comment-out-a-block-of-tags-in-xml

Firstly check if the *.ctd (sans sql) document crashes as you report. If so then systematically comment out parts of the code and try exporting again.

One strategy which is well documented for code debugging is to break the (XML) code in two equal parts. Test part A and part B separately. Export to PDF. If they both export then your theory is incorrect. But if one part crashes then repeat the splitting plan with the failed part until you narrow it down. Here is a discussion on commenting out parts of XML. https://stackoverflow.com/questions/2757396/how-do-i-comment-out-a-block-of-tags-in-xml

giuspen commented 2 months ago

First thing please try v1.1.2 Second, such crashes typically happen on a particular node content. Can you try and isolate the exact node where it happens and possibly send me the exported (export to cherrytree) node privately?

VeldtSoft commented 1 month ago

Thank you both for response, I will read through the thread and try those troubleshooting methods and provide an update on those steps and will also try to isolate closer to where the export fails. I can send the exported copy privately too, thanks and I will keep updated