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 758827 - Evolution crashed in prevent_from_deleting_last_element_in_body()
Evolution crashed in prevent_from_deleting_last_element_in_body()
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Composer
3.18.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Tomas Popela
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2015-11-30 09:56 UTC by Tomas Popela
Modified: 2015-12-01 10:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tomas Popela 2015-11-30 09:56:12 UTC
Moving from https://bugzilla.redhat.com/show_bug.cgi?id=1285404:

Description of problem:
Entered text with smileys. They got auto-replaced, and then I deleted them (with backspace) and wanted to continue writing.

Truncated backtrace:
Thread no. 1 (10 frames)
 #0 prevent_from_deleting_last_element_in_body at e-html-editor-view.c:3922
 #1 key_press_event_process_backspace_key at e-html-editor-view.c:5506
 #2 html_editor_view_key_press_event at e-html-editor-view.c:5688
 #3 _gtk_marshal_BOOLEAN__BOXED at gtkmarshalers.c:86
 #8 gtk_widget_event_internal at gtkwidget.c:7692
 #9 gtk_window_propagate_key_event at gtkwindow.c:7772
 #10 gtk_window_key_press_event at gtkwindow.c:7805
 #11 msg_composer_key_press_event at e-msg-composer.c:2717
 #12 _gtk_marshal_BOOLEAN__BOXEDv at gtkmarshalers.c:131
 #13 _g_closure_invoke_va at gclosure.c:864
Comment 1 Tomas Popela 2015-11-30 12:16:51 UTC
Fixed with following commit:

    Bug 758827 - Evolution crashed in prevent_from_deleting_last_element_in_body()
    
    Check if the variable exists before using it.


commit 1d59ac9e2880a08c85502c9d003da2986f6359d3 in the master branch for Evolution 3.19.3+

commit 8ceac3eb4c20ceb9e439af211e5cd8576e32a3a0 in the gnome-3-18 branch for Evolution 3.18.3+
Comment 2 Milan Crha 2015-11-30 16:17:04 UTC
Might not it rather be:
   if (!content || !*content)
      ret_val = TRUE;

? I do not know when exactly the 'content' can be NULL, but it feels like either it's an empty string or a NULL, when it is the last element in the body.
Comment 3 Tomas Popela 2015-12-01 06:19:20 UTC
(In reply to Milan Crha from comment #2)
> ? I do not know when exactly the 'content' can be NULL, but it feels like
> either it's an empty string or a NULL, when it is the last element in the
> body.

Yes, you are right.
Comment 4 Tomas Popela 2015-12-01 10:16:40 UTC
Fixed with following commit:

    Bug 758827 - Evolution crashed in prevent_from_deleting_last_element_in_body()
    
    Follow-up fix as we need to prevent from deleting the last element in body when
    there is none or empty text content.


commit fbb5561e26961975d694bd43d8b3a0204a2009f3 in the master branch for Evolution 3.19.3+

commit 4cfe98b57397d1fc46d0f1d2a34a6394a8dc9fda in the gnome-3-18 branch for Evolution 3.18.3+