xournal crashes on "save as pdf" if text input has been used when annotating a pdf

Bug #474468 reported by khul
34
This bug affects 5 people
Affects Status Importance Assigned to Milestone
xournal (Debian)
Fix Released
Unknown
xournal (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: xournal

If I open an existing pdf using xournal and add some text using the keyboard, then xournal dies abruptly when I try to save the modified pdf. A "pdf" file is created, but it's not readable.

I am using Ubuntu 9.10 on a Fujitsu-Siemens T5010 tablet laptop.

ProblemType: Bug
Architecture: amd64
Date: Wed Nov 4 18:30:44 2009
DistroRelease: Ubuntu 9.10
Package: xournal 0.4.5-1
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-14.48-generic
SourcePackage: xournal
Uname: Linux 2.6.31-14-generic x86_64

Revision history for this message
khul (klas-physto) wrote :
Revision history for this message
khul (klas-physto) wrote :

Running it from the terminal I get:

GLib-ERROR **: /build/buildd/glib2.0-2.22.2/glib/gmem.c:175: failed to allocate 140737488355328 bytes
aborting...

Revision history for this message
khul (klas-physto) wrote :

The crash happens at line 872 in xo-print.c:

g_string_append_len(pdfbuf, fontdata, len);

Examining the value of len with gdb prior to this call shows 140733193391464. But it's difficult to trace why, since len is optimised away earlier in the code. If I compile with '-g' or with '-O0' it works. So I guess I'll use '-O0' for now...

Revision history for this message
khul (klas-physto) wrote :

Compiling without optimisation was not the solution. It worked for annotating a test file, but the same error occured when saving an xournal file to pdf (without loading any pdf).

Now gdb worked fine, and I found that len is declared wrongly. It should be a guint32, not a gsize. Changing this declaration seemed to fix the bug.

Revision history for this message
Justin Dugger (jldugger) wrote :

Thanks for this report; it sounds like this an upstream bug. Would you mind posting a small explanation and patch to <email address hidden>?

Changed in xournal (Ubuntu):
status: New → Confirmed
Revision history for this message
mwaechter (matthias-waechter) wrote :

Don't know if this helps, but I experienced exactly the described behavior today. I am running ubuntu 9.10 amd64 desktop variant on a macbook 3,1.
If possible, I could provide any helpful information. On the other hand, I understood this bug has been assigned to the xournal developers.

Revision history for this message
Leandro (leandromartinez98) wrote :

This bug is still present. Has anyone reported it to the xournal developers?

Revision history for this message
Leandro (leandromartinez98) wrote :

Just to mention, a very simple workaround of this problem is to "Print to file", with pdf output. It works.

Revision history for this message
khul (klas-physto) wrote :

I sent a mail to the sourceforge list Justin mentioned. It was held for moderation since I'm not a member, and I never received any comment. My fixed version (with gsize replaced with guint32) works just fine.

Changed in xournal (Debian):
status: Unknown → New
Revision history for this message
Stefano Rivera (stefanor) wrote :
Changed in xournal (Debian):
status: New → Fix Released
Revision history for this message
Stefano Rivera (stefanor) wrote :

0.4.5-2 is in lucid

Changed in xournal (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
slowtrain (pmuhl830) wrote :

I'm not sure the fix works on my system (not available yet via Synaptic). What seems to happen is that when I open a XOJ file with text in it and then try to export as pdf, xournal dies abruptly and a zero KB output file is created. The problem does not occur when I export directly without first creating an XOJ file or if the XOJ file does not have text in it. Will have to try the save to pdf workaround--thanks!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.