After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 632087 - Crash when saving a fillable form to the same file
Crash when saving a fillable form to the same file
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: PDF
git master
Other Linux
: High critical
: ---
Assigned To: Evince Maintainers
Evince Maintainers
: 642401 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-10-13 19:04 UTC by Rick Weinberger
Modified: 2012-10-26 13:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fillable pdf formular that can cause a crash in evince-2.32.0 (103.05 KB, application/pdf)
2011-02-19 20:06 UTC, Andreas Becker
  Details
first idea of a patch (1.19 KB, patch)
2011-02-22 16:41 UTC, José Aliste
none Details | Review
Patch fixing the issue (719 bytes, patch)
2011-03-10 13:46 UTC, José Aliste
committed Details | Review

Description Rick Weinberger 2010-10-13 19:04:51 UTC
Evince segmentation faults reliably when I try to open a fillable pdf, modify the pdf, 'save a copy', then select the same source file to replace.  Unfortunately I cannot provide the main fillable pdf I'm trying to use for this purpose.
Comment 1 hugh 2011-01-19 18:01:21 UTC
Could you duplicate the problem with a PDF that you could provide?
Comment 2 José Aliste 2011-01-19 18:05:25 UTC
Yeah, indeed without the pdf or a backtrace, there is little we can do to help you. Please see http://live.gnome.org/GettingTraces for more information on how to get traces. 

You could also send the pdf to me privately if that is acceptable (jaliste at gnome.org)
Comment 3 Andreas Becker 2011-02-19 20:03:56 UTC
I can reproduce this.
When I save the modified pdf file over the original file, evince crashes after writing the file. When I save it to another file name, everything works. I attached a fillable pdf made by LibreOffice.
It seems that there are invalid pointers in the ev_mapping_list_find function, because the crash happens when the line 
       for (list = mapping_list->list; list; list = list->next) {
is executed.

Backtrace:

  • #0 ev_mapping_list_find
    at ev-mapping-list.c line 36
  • #1 ev_view_get_area_from_mapping
    at ev-view.c line 1477
  • #2 ev_view_size_allocate
    at ev-view.c line 3154
  • #3 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
(more unimportant stuff follows ...)
Comment 4 Andreas Becker 2011-02-19 20:06:01 UTC
Created attachment 181355 [details]
fillable pdf formular that can cause a crash in evince-2.32.0
Comment 5 Carlos Garcia Campos 2011-02-20 11:25:20 UTC
It doesn't crash for me
Comment 6 Carlos Garcia Campos 2011-02-20 11:29:14 UTC
*** Bug 642401 has been marked as a duplicate of this bug. ***
Comment 7 José Aliste 2011-02-20 20:47:58 UTC
Evince master does not crash for me, but evince 2.32 does crashes. Carlos, to make Evince to crash, I saved the file leaving the focus from the input box
Comment 8 José Aliste 2011-02-21 10:33:05 UTC
I managed to reproduced this on evince master
Comment 9 José Aliste 2011-02-22 16:41:58 UTC
Created attachment 181602 [details] [review]
first idea of a patch

So with this patch, evince will save the contents of the FormTextWidget and destroy the widget when the TextWidget looses it focus. This sort of patch should also fix #631630.

Some thoughts: 

- we should do this with all form widgets, so maybe it's better to have a base FormWidget class?
Comment 10 José Aliste 2011-03-10 13:46:15 UTC
Created attachment 183057 [details] [review]
Patch fixing the issue

This should fix the issue. Carlos, please review.
Comment 11 Carlos Garcia Campos 2011-03-12 16:29:38 UTC
Review of attachment 183057 [details] [review]:

Please push it, thanks!
Comment 12 José Aliste 2011-03-13 21:40:08 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 13 José Aliste 2011-04-23 11:58:48 UTC
I still manage to reproduce this in Evince 3.0 while in F15 beta :(
Comment 14 José Aliste 2012-10-26 13:22:31 UTC
I can no longer reproduce on Evince 3.4. Reclosing