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 258738 - ja_JP.UTF-8: Evolution crashes when certain ASCII/non-ASCII combination is used in mail subject
ja_JP.UTF-8: Evolution crashes when certain ASCII/non-ASCII combination is us...
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
pre-1.5 (obsolete)
Other All
: Normal major
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2004-05-19 22:57 UTC by suresh
Modified: 2004-05-20 20:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
camel patch (1.87 KB, patch)
2004-05-19 23:16 UTC, suresh
none Details | Review
camel patch (1.74 KB, patch)
2004-05-20 20:51 UTC, suresh
none Details | Review

Description suresh 2004-05-19 22:57:08 UTC
To reproduce:
1. Invoke evolution on ja_JP.UTF-8.
2. Choose [File] -> [New] -> [Mail Message].
3. Focus on [Subject] text field and input strings below.
Ctrl+Space, Space, Space, Ctrl+Space, 'a'
(I.e. U+3000 x 2, U+0061)

4. Press Send, crash happens.
Comment 1 suresh 2004-05-19 23:16:13 UTC
Created attachment 43735 [details] [review]
camel patch
Comment 2 Jeffrey Stedfast 2004-05-19 23:54:34 UTC
I'd like to see a backtrace of the crash. the patch doesn't seem to
have anything to do with a crash fix.

also, is_lwsp() is the macro that should be used, don't create a new one.
Comment 3 suresh 2004-05-20 00:28:51 UTC
Will supply the crash log within a couple of hrs, I'm rebuilding evo now
Comment 4 Not Zed 2004-05-20 01:33:21 UTC
FWIW I couldn't recreate the crash.

so it sounds like a bug in one of the libraries, e.g. iconv.

looking at the function though, maybe its wrong.  it isn't what goes
into the rfc2047 encoded output though, so it isn't generating tokens
with those characters as separators, so it wont break the encoding (i
think).

still, i'd like to see the bt before any patch goes in thanks
Comment 5 suresh 2004-05-20 18:31:35 UTC
(gdb) where
  • #0 wait4
    from /lib/i686/libc.so.6
  • #1 waitpid
    from /lib/i686/libc.so.6
  • #2 waitpid
    from /lib/i686/libpthread.so.0
  • #3 libgnomeui_module_info_get
    from /usr/lib/libgnomeui-2.so.0
  • #4 segv_redirect
    at main.c line 454
  • #5 pthread_sighandler
    from /lib/i686/libpthread.so.0
  • #6 <signal handler called>
  • #7 strcasecmp
    from /lib/i686/libc.so.6
  • #8 rfc2047_encode_word
    at camel-mime-utils.c line 1204
  • #9 camel_header_encode_string
    at camel-mime-utils.c line 1404
  • #10 camel_mime_message_set_subject
    at camel-mime-message.c line 324
  • #11 e_msg_composer_hdrs_to_message_internal
    at e-msg-composer-hdrs.c line 1000
  • #12 e_msg_composer_hdrs_to_message
    at e-msg-composer-hdrs.c line 1046
  • #13 build_message
    at e-msg-composer.c line 434
  • #14 e_msg_composer_get_message
    at e-msg-composer.c line 4451
  • #15 composer_get_message
    at em-composer-utils.c line 340
  • #16 em_utils_composer_send_cb
    at em-composer-utils.c line 405
  • #17 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #18 g_closure_invoke
    at gclosure.c line 437
  • #19 signal_emit_unlocked_R
    at gsignal.c line 2436
  • #20 g_signal_emit_valist
    at gsignal.c line 2195
  • #21 g_signal_emit
    at gsignal.c line 2239
  • #22 menu_file_send_cb
    at e-msg-composer.c line 1641
  • #23 marshal_VOID__USER_DATA_STRING
    at bonobo-ui-component.c line 221
  • #24 g_closure_invoke
    at gclosure.c line 437
  • #25 bonobo_closure_invoke_va_list
    at bonobo-types.c line 415
  • #26 bonobo_closure_invoke
    at bonobo-types.c line 478
  • #27 impl_Bonobo_UIComponent_execVerb
    at bonobo-ui-component.c line 158
  • #28 _ORBIT_skel_small_Bonobo_UIComponent_execVerb
    at Bonobo-common.c line 1196
  • #29 ORBit_c_stub_invoke
    at poa.c line 2627
  • #30 Bonobo_UIComponent_execVerb
    at Bonobo-stubs.c line 1227
  • #31 real_exec_verb
    at bonobo-ui-engine.c line 1533
  • #32 impl_emit_verb_on
    at bonobo-ui-engine.c line 1591
  • #33 g_cclosure_marshal_VOID__POINTER
    at gmarshal.c line 601
  • #34 g_type_class_meta_marshal
    at gclosure.c line 514
  • #35 g_closure_invoke
    at gclosure.c line 437
  • #36 signal_emit_unlocked_R
    at gsignal.c line 2474
  • #37 g_signal_emit_valist
    at gsignal.c line 2195
  • #38 g_signal_emit
    at gsignal.c line 2239
  • #39 bonobo_ui_engine_emit_verb_on_w
    at bonobo-ui-engine.c line 3040
  • #40 exec_verb_cb
    at bonobo-ui-sync-toolbar.c line 191
  • #41 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #42 g_closure_invoke
    at gclosure.c line 437
  • #43 signal_emit_unlocked_R
    at gsignal.c line 2436
  • #44 g_signal_emit_valist
    at gsignal.c line 2195
  • #45 g_signal_emit
  • #46 bonobo_ui_toolbar_item_activate
    at bonobo-ui-toolbar-item.c line 446
  • #47 button_widget_clicked_cb
    at bonobo-ui-toolbar-button-item.c line 217
  • #48 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #49 g_closure_invoke
    at gclosure.c line 437
  • #50 signal_emit_unlocked_R
    at gsignal.c line 2436
  • #51 g_signal_emit_valist
    at gsignal.c line 2195
  • #52 g_signal_emit
    at gsignal.c line 2239
  • #53 gtk_button_clicked
    from /usr/lib/libgtk-x11-2.0.so.0
  • #54 gtk_button_get_relief
    from /usr/lib/libgtk-x11-2.0.so.0
  • #55 g_cclosure_marshal_VOID__VOID
  • #56 g_type_class_meta_marshal
    at gclosure.c line 514
  • #57 g_closure_invoke
    at gclosure.c line 437
  • #58 signal_emit_unlocked_R
    at gsignal.c line 2366
  • #59 g_signal_emit_valist
    at gsignal.c line 2195
  • #60 g_signal_emit
    at gsignal.c line 2239
  • #61 gtk_button_released
    from /usr/lib/libgtk-x11-2.0.so.0
  • #62 gtk_button_get_relief
    from /usr/lib/libgtk-x11-2.0.so.0
  • #63 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #64 g_type_class_meta_marshal
    at gclosure.c line 514
  • #65 g_closure_invoke
    at gclosure.c line 437
  • #66 signal_emit_unlocked_R
    at gsignal.c line 2474
  • #67 g_signal_emit_valist
    at gsignal.c line 2205
  • #68 g_signal_emit
    at gsignal.c line 2239
  • #69 gtk_widget_send_expose
    from /usr/lib/libgtk-x11-2.0.so.0
  • #70 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #71 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #65 g_closure_invoke
    at gclosure.c line 437
  • #66 signal_emit_unlocked_R
    at gsignal.c line 2474
  • #67 g_signal_emit_valist
    at gsignal.c line 2205
  • #68 g_signal_emit
    at gsignal.c line 2239
  • #69 gtk_widget_send_expose
    from /usr/lib/libgtk-x11-2.0.so.0
  • #70 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #71 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #72 gdk_add_client_message_filter
    from /usr/lib/libgdk-x11-2.0.so.0
  • #73 g_main_dispatch
    at gmain.c line 1887
  • #74 g_main_context_dispatch
    at gmain.c line 2433
  • #75 g_main_context_iterate
    at gmain.c line 2514
  • #76 g_main_loop_run
    at gmain.c line 2718
  • #77 bonobo_main
    at bonobo-main.c line 297
  • #78 main
    at main.c line 604

Comment 6 suresh 2004-05-20 18:41:37 UTC
I think now you can see why fixing the above function prevents the
crash, camel_header_encode_string argument in uTF-8 is

0xe38080 0xe38080 0x61

the first 2 are unicode space equivalents they pass the
g_unichar_isspace test, what happens here is the second e38080 cuases
the encoding to be 2, then 0x61, or 'a' passed to camel_charset_best,
which returns NULL for it is US-ASCII, the same when passed to
rfc2047_encode_word causes a crash.

The way to avoid this is obey the rfc's and treat 0xe38080 as non
spaces, then things work OK.

Jeff, you aked me to use the is_lwsp, was it the referece to
camel_mime_is_lwsp or plain is_lwsp ?


Comment 7 Jeffrey Stedfast 2004-05-20 19:02:18 UTC
plain old is_lwsp(). it's a private macro that uses a
camel_mime_specials[] table.
Comment 8 suresh 2004-05-20 19:57:15 UTC
camel_mime_is_lwsp makes more sense for me than the is_lwsp defined in
camel-url-scanner.c (which deals with urls) or the one defined in
camel-imap4-specials.h (which's downstream imap4 specific)

BTW, I hope you agreed to this being a bug.

Comment 9 Jeffrey Stedfast 2004-05-20 20:27:21 UTC
er, oops. I forgot that the is_lwsp() macro was namespaced to
camel_mime_is_lwsp(). So yes, use camel_mime_is_lwsp().

and yes, it is a bug.
Comment 10 suresh 2004-05-20 20:51:47 UTC
Created attachment 43738 [details] [review]
camel patch
Comment 11 suresh 2004-05-20 20:52:13 UTC
OK to commit ?
Comment 12 Jeffrey Stedfast 2004-05-20 20:55:28 UTC
ok, commitetd to CVS. thanks for the patch.