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 522446 - nautilus-connect-server crash
nautilus-connect-server crash
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: [obsolete] GIO
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 522320 523077 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-03-14 16:18 UTC by Matthias Clasen
Modified: 2008-03-18 00:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Matthias Clasen 2008-03-14 16:18:04 UTC
I opened the "Connect to server..." window, selected "Public ftp", entered the ftp server name, checked "Add Bookmark" and left the Bookmark name field free.

Then I clicked connect. The result is a bug-buddy window:

The application nautilus-connect-server has crashed.


Side note: should the "Add Bookmark" checkbox control the sensitivity of the "Bookmark name" field ?
Comment 1 Cosimo Cecchi 2008-03-14 18:56:10 UTC
Hi Matthias, as I can't reproduce the crash, could you please attach a stacktrace of it?
Comment 2 Matthias Clasen 2008-03-14 21:34:11 UTC


  • #6 google_breakpad::ExceptionHandler::HandleException
    from /usr/lib/gtk-2.0/modules/libgnomebreakpad.so
  • #7 <signal handler called>
  • #8 strcmp
    from /lib/libc.so.6
  • #9 nautilus_bookmark_compare_with
    at nautilus-bookmark.c line 153
  • #10 IA__g_list_find_custom
    at glist.c line 636
  • #11 nautilus_bookmark_list_contains
    at nautilus-bookmark-list.c line 272
  • #12 response_callback
    at nautilus-connect-server-dialog.c line 316
  • #13 IA__g_cclosure_marshal_VOID__INT
    at gmarshal.c line 216

Comment 3 A. Walton 2008-03-15 00:16:48 UTC
The problem is at nautilus-connect-server-dialog.c:316ish:
	name = gtk_editable_get_chars (GTK_EDITABLE (dialog->details->name_entry), 0, -1);
	bookmark = nautilus_bookmark_new (location, strlen (name) ? name : NULL);
	list = nautilus_bookmark_list_new ();
	if (!nautilus_bookmark_list_contains (list, bookmark)) {
		nautilus_bookmark_list_append (list, bookmark);
	}

I think this is wrong; we should pass something in as the bookmark name, as nautilus_bookmark_compare_with() is (IMO correctly) assuming we have a non-NULL bookmark name.

This gets us to two possible fixes: the simple one is to change that NULL to g_strdup(_("New Server")); or something similar so we're not passing an empty value in. This is bad, however, as it adds a string, and one that should probably be translated. The more ugly fix would be to change nautilus_bookmark_compare_with() to use EEL's null-tolerant eel_strcmp(); simpler but this is a bit hackish and we really should be setting a name if we're making bookmarks.

Thoughts?
Comment 4 Matthias Clasen 2008-03-15 00:22:04 UTC
gtk+ handles the "no name" case just fine. the title was a later addition to the .gtk-bookmarks format. Other uses of this private file better understand the title-less format, too. So I think allowing an empty name would be ok.
Comment 5 A. Walton 2008-03-15 00:42:40 UTC
2008-03-14  A. Walton  <awalton@svn.gnome.org>

	* libnautilus-private/nautilus-bookmark.c
	(nautilus_bookmark_compare_with):
	Fixes crash if the user doesn't set a name for the bookmark (#520270).

Still looks pretty ugly having a bookmark with no name set, but at least it doesn't crash if the user doesn't put in a name.
Comment 6 A. Walton 2008-03-15 00:45:49 UTC
(And of course, I put the wrong bug number into SVN. What a great day!)

Does this look good to close to you Matthias?
Comment 7 Matthias Clasen 2008-03-15 00:52:40 UTC
Sure, if it doesn't crash anymore, close it. I still think it would be nice to toggle the sensitivity of the name field depending on the bookmark checkbox...
Comment 8 A. Walton 2008-03-15 01:38:29 UTC
2008-03-14  A. Walton  <awalton@svn.gnome.org>

	* src/nautilus-connect-server-dialog.c
	(bookmark_checkmark_toggled),
	(nautilus_connect_server_dialog_init):
	Set the bookmark name widget in the connect server dialog insensitive
	if the user doesn't check the add bookmark check button.

All fixed.
Comment 9 A. Walton 2008-03-15 02:06:26 UTC
*** Bug 522320 has been marked as a duplicate of this bug. ***
Comment 10 Cosimo Cecchi 2008-03-18 00:09:31 UTC
*** Bug 523077 has been marked as a duplicate of this bug. ***