GNOME Bugzilla – Bug 166049
character support
Last modified: 2009-08-15 18:40:50 UTC
Steps to reproduce: 1. open search tool 2. enter some word to search containing diacritical marks or if you are doing searching in directory which contains files, directoris which names consists with some words with diacritical marks. 3. click find Stack trace:
+ Trace 55206
Other information:
Can you please attach a screenshot of gnome-search-tool prior to clicking the find button? I'd like to see if I can reproduce this, and the stack trace isn't very useful. Thanks.
Created attachment 36875 [details] Screenshot of me trying to reproduce. I set "Name contains" to "יטךכחסרנוזēčŭ" and could not reproduce.
try it with latvian keyboard layout: āķļ
Created attachment 36877 [details] this is how it looks on my pc I can reproduce this bug on my Gentoo box and on my work box with Debian.
Please attach a text file with the characters. Thanks.
Created attachment 36904 [details] Screenshot It took a little while to figure out how to type those characters, but I switched my keyboard layout to Latvian and typed the same characters with diacritical marks as found in your screenshot. Gnome-search-tool (both versions 2.8 and 2.9) did not crash. So, to track down the cause of your crash I will need a better stack trace. I see in your screenshot that you are building gnome-search-tool from the source code. Can you rebuild with debugging symbols enabled and attach a new stack trace? How to build with debugging symbols and create a stack trace are available here: http://bugzilla.gnome.org/getting-traces.cgi
I was not building it from sources, but anyway, I can do that today and send you some additional info.
gchar * build_search_command (void) { GString *command; gchar *file_is_named_utf8; gchar *file_is_named_locale; gchar *file_is_named_escaped; gchar *file_is_named_backslashed; gchar *look_in_folder_utf8; gchar *look_in_folder_locale; setup_case_insensitive_arguments (); file_is_named_utf8 = g_strdup ((gchar *) gtk_entry_get_text (GTK_ENTRY(gnome_entry_gtk_entry (GNOME_ENTRY(interface.file_is_named_entry))))); if (!file_is_named_utf8 || !*file_is_named_utf8) { g_free (file_is_named_utf8); file_is_named_utf8 = g_strdup ("*"); } else { gchar *locale; locale = g_locale_from_utf8 (file_is_named_utf8, -1, NULL, NULL, NULL); gnome_entry_prepend_history (GNOME_ENTRY(interface.file_is_named_entry), TRUE, file_is_named_utf8); if (strstr (locale, "*") == NULL) { gchar *tmp; tmp = file_is_named_utf8; file_is_named_utf8 = g_strconcat ("*", file_is_named_utf8, "*", NULL); g_free (tmp); } -------------------------- after g_locale_from_utf8 call, locale = NULL and strstr fails. btw - I couldn't reproduce, but it is possible that similar error happens when searching is done in the directory which's name contains those chars.
g_locale_form_utf8() should not be returning NULL, but I'll apply a patch to cvs to check the return values of g_locale_*() and display the GErrors strings. String freeze for GNOME 2.10 is Feb. 7th, so I will need to get this finished up quickly.
I can give you those GError strings.. tomorrow.
Created attachment 36960 [details] [review] Proposed patch. If g_locale_from_utf8() fails then gnome-search-tool will not be able to perform a search, but the application should not crash either. This patch should prevent the crash and display an error dialog. Can you test the patch?
Similar patch applied to CVS Head (gnome-utils 2.9.91+). Gnome-search-tool will not crash if g_local_from_utf8() fails as was reported above.
2005-02-03 Dennis Cranston <dennis_cranston@yahoo.com> Prevent crash if the glib character conversion routines fail. Bug #166049. * gsearchtool.c: Added a new function, display_dialog_character_set_conversion_error (). (build_search_command): Call display_dialog_character_set_conversion_error () if g_locale_from_utf8 () fails. (handle_search_command_stdout_io): Do not spawn search if the command is NULL. * gsearchtool-callbacks.c: (click_find_cb): Do not spawn search if the command is NULL.
This exeption happens when I use locale set to POSIX!