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 166049 - character support
character support
Status: VERIFIED FIXED
Product: gnome-utils
Classification: Deprecated
Component: gsearchtool
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-utils Maintainers
gnome-utils Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-02-02 15:06 UTC by Maris
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: 2.7/2.8


Attachments
Screenshot of me trying to reproduce. (44.92 KB, image/png)
2005-02-02 16:46 UTC, Dennis Cranston
  Details
this is how it looks on my pc (387.99 KB, image/png)
2005-02-02 18:17 UTC, Maris
  Details
Screenshot (34.96 KB, image/png)
2005-02-03 04:53 UTC, Dennis Cranston
  Details
Proposed patch. (6.11 KB, patch)
2005-02-04 03:07 UTC, Dennis Cranston
none Details | Review

Description Maris 2005-02-02 15:06:06 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:
  • #0 strchr
    from /lib/tls/libc.so.6
  • #1 build_search_command
  • #2 click_find_cb
  • #3 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #4 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #5 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #6 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #7 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #8 gtk_button_clicked
    from /usr/lib/libgtk-x11-2.0.so.0
  • #9 _gtk_button_paint
    from /usr/lib/libgtk-x11-2.0.so.0
  • #10 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #11 g_cclosure_new_swap
    from /usr/lib/libgobject-2.0.so.0
  • #12 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #13 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #14 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #15 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #16 gtk_button_released
    from /usr/lib/libgtk-x11-2.0.so.0
  • #17 _gtk_button_paint
    from /usr/lib/libgtk-x11-2.0.so.0
  • #18 _gtk_marshal_BOOLEAN__BOXED
    from /usr/lib/libgtk-x11-2.0.so.0
  • #19 g_cclosure_new_swap
    from /usr/lib/libgobject-2.0.so.0
  • #20 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #21 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #22 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #23 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #24 gtk_widget_send_expose
    from /usr/lib/libgtk-x11-2.0.so.0
  • #25 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #26 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #27 _gdk_events_queue
    from /usr/lib/libgdk-x11-2.0.so.0
  • #28 g_main_depth
    from /usr/lib/libglib-2.0.so.0
  • #29 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #30 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #31 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #32 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #33 main


Other information:
Comment 1 Dennis Cranston 2005-02-02 16:37:15 UTC
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.  
Comment 2 Dennis Cranston 2005-02-02 16:46:11 UTC
Created attachment 36875 [details]
Screenshot of me trying to reproduce.

I set "Name contains" to "יטךכחסרנוזēčŭ" and could not
reproduce.
Comment 3 Maris 2005-02-02 18:12:43 UTC
try it with latvian keyboard layout: āķļ
Comment 4 Maris 2005-02-02 18:17:26 UTC
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.
Comment 5 Dennis Cranston 2005-02-02 21:18:43 UTC
Please attach a text file with the characters.  Thanks. 
Comment 6 Dennis Cranston 2005-02-03 04:53:51 UTC
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
Comment 7 Maris 2005-02-03 05:26:11 UTC
I was not building it from sources, but anyway, I can do that today and send you
some additional info.
Comment 8 Maris 2005-02-03 09:45:46 UTC
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.
Comment 9 Dennis Cranston 2005-02-03 21:46:39 UTC
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.
Comment 10 Maris 2005-02-03 22:39:48 UTC
I can give you those GError strings.. tomorrow.
Comment 11 Dennis Cranston 2005-02-04 03:07:45 UTC
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?
Comment 12 Dennis Cranston 2005-02-04 16:17:17 UTC
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.
Comment 13 Dennis Cranston 2005-02-04 16:18:42 UTC
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.
Comment 14 Maris 2005-02-06 08:35:18 UTC
This exeption happens when I use locale set to POSIX!