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 624270 - crash in gtk_entry_completion_default_completion_func
crash in gtk_entry_completion_default_completion_func
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkEntry
2.20.x
Other Linux
: Normal critical
: ---
Assigned To: gtk-bugs
gtk-bugs
: 628710 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-07-13 17:54 UTC by Bill Nottingham
Modified: 2011-10-13 13:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
check return value (1.36 KB, patch)
2010-07-19 18:47 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review

Description Bill Nottingham 2010-07-13 17:54:51 UTC
Originally from: https://bugzilla.redhat.com/show_bug.cgi?id=611571

Thread 1 (Thread 11634)

  • #0 __strncmp_ssse3
    at ../sysdeps/x86_64/strcmp.S line 107
  • #1 gtk_entry_completion_default_completion_func
    at gtkentrycompletion.c line 793
  • #2 gtk_entry_completion_visible_func
    at gtkentrycompletion.c line 822
  • #3 gtk_tree_model_filter_visible
    at gtktreemodelfilter.c line 764
  • #4 gtk_tree_model_filter_row_changed
    at gtktreemodelfilter.c line 1253
  • #5 gtk_tree_model_filter_refilter_helper
    at gtktreemodelfilter.c line 3452
  • #6 gtk_tree_model_foreach_helper
    at gtktreemodel.c line 1583
  • #7 IA__gtk_tree_model_foreach
    at gtktreemodel.c line 1629
  • #8 IA__gtk_entry_completion_complete
    at gtkentrycompletion.c line 1181
  • #9 check_completion_callback
    at gtkentry.c line 9607
  • #10 source_closure_marshal_BOOLEAN__VOID
    at gsourceclosure.c line 84
  • #11 IA__g_closure_invoke
    at gclosure.c line 767
  • #12 source_closure_callback
    at gsourceclosure.c line 126
  • #13 g_main_dispatch
    at gmain.c line 1960
  • #14 IA__g_main_context_dispatch
    at gmain.c line 2513
  • #15 g_main_context_iterate
    at gmain.c line 2591
  • #16 IA__g_main_loop_run
    at gmain.c line 2799
  • #17 IA__gtk_main
    at gtkmain.c line 1219
  • #18 gnc_ui_start_event_loop
    at gnc-gnome-utils.c line 547
  • #19 inner_main
    at gnucash-bin.c line 641
  • #20 invoke_main_func
    at init.c line 367
  • #21 c_body
    at continuations.c line 349
  • #22 scm_c_catch
    at throw.c line 203
  • #23 scm_i_with_continuation_barrier
    at continuations.c line 325
  • #24 scm_c_with_continuation_barrier
    at continuations.c line 367
  • #25 scm_i_with_guile_and_parent
    at threads.c line 733
  • #26 scm_boot_guile
    at init.c line 350
  • #27 main
    at gnucash-bin.c line 780
  • #1 gtk_entry_completion_default_completion_func
    at gtkentrycompletion.c line 793
$1 = (const gchar *) 0x39dfb90 "eur (euro)"
(gdb) print case_normalized_string 
$2 = (gchar *) 0x0
(gdb) list
788	  if (item != NULL)
789	    {
790	      normalized_string = g_utf8_normalize (item, -1, G_NORMALIZE_ALL);
791	      case_normalized_string = g_utf8_casefold (normalized_string, -1);
792	      
793	      if (!strncmp (key, case_normalized_string, strlen (key)))
794		ret = TRUE;
795	      
796	      g_free (item);
797	      g_free (normalized_string);
(gdb) print item
$3 = (gchar *) 0x36af550 "ANG (Niederl\344ndische Antillen-Gulden)"

g_utf8_normalize returns NULL (as the string isn't UTF-8). Should this return value be checked?
Comment 1 Javier Jardón (IRC: jjardon) 2010-07-19 18:47:04 UTC
Created attachment 166176 [details] [review]
check return value
Comment 2 Emmanuele Bassi (:ebassi) 2010-07-19 21:41:58 UTC
Review of attachment 166176 [details] [review]:

::: gtk/gtkentrycompletion.c
@@ +800,3 @@
+        {
+      if (normalized_string != NULL)
+

g_free (normalized_string) could still go outside the if() block: g_free (NULL) is a no-op. minor style issue.

other than that, looks okay to me.
Comment 3 Javier Jardón (IRC: jjardon) 2010-07-19 22:22:13 UTC
Comment on attachment 166176 [details] [review]
check return value

committed with your comments

commit 910ad4872ca4413d958e4303245611acd3a84d0f
Comment 4 Javier Jardón (IRC: jjardon) 2010-07-19 22:22:30 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 5 Geert Janssens 2011-10-10 20:55:41 UTC
*** Bug 628710 has been marked as a duplicate of this bug. ***
Comment 6 eric 2011-10-13 08:07:30 UTC
This is still an issue in gtk 2.24.6.  It seems that the fix didn't found its way to the gtk2 branch.
Comment 7 Javier Jardón (IRC: jjardon) 2011-10-13 13:05:14 UTC
cherry-picked to gtk2-24 branch: commit fb99ca1979574807f67e30509f7d8750a0b529ff