1

I'm converting an old (pure C) program to Gtk-3, and though the conversion is done, I have to debug some issues. Debugging is made difficult, as I continuously hit:

Gtk-WARNING **: Failed to fetch network locations: The specified location is not mounted

This causes the debugger to stop in each run (I need --g-fatal-errors).

The error seems to occur when I call gtk_dialog_run on the instance of gtk_file_chooser_dialog. The filename is empty.

I understand that gvfs is charged with doing the work. How can I determine which 'specified location' the error message is referring to? Or any other suggestion where this error comes from would be appreciated.

This is the backtrace to the WARNING location:

Thread 1 (Thread 0x7ffff7f7e280 (LWP 15613)):
#0  _g_log_abort (breakpoint=breakpoint@entry=1) at gmessages.c:549
#1  0x00007ffff5844e02 in g_log_writer_default (log_level=<optimized out>, log_level@entry=G_LOG_LEVEL_WARNING, fields=fields@entry=0x7fffffffc480, n_fields=n_fields@entry=6, user_data=user_data@entry=0x0) at gmessages.c:2613
#2  0x00007ffff58434ec in g_log_structured_array (log_level=G_LOG_LEVEL_WARNING, fields=0x7fffffffc480, n_fields=6) at gmessages.c:1933
#3  0x00007ffff5843807 in g_log_structured (log_domain=log_domain@entry=0x7ffff752aad8 "Gtk", log_level=log_level@entry=G_LOG_LEVEL_WARNING) at gmessages.c:1760
#4  0x00007ffff73e70e5 in network_enumeration_finished (source_object=<optimized out>, res=<optimized out>, user_data=0xb90b40) at gtkplacesview.c:1037
#5  0x00007ffff697adb7 in g_simple_async_result_complete (simple=0x11e9550) at gsimpleasyncresult.c:801
#6  0x00007fffed014c71 in ?? () from /usr/lib64/gio/modules/libgvfsdbus.so
#7  0x00007fffed00fd39 in ?? () from /usr/lib64/gio/modules/libgvfsdbus.so
#8  0x00007fffecdf9201 in ?? () from /usr/lib64/libgvfscommon.so.0
#9  0x00007fffefa3c4ca in ?? () from /usr/lib64/libdbus-1.so.3
#10 0x00007fffefa3f69a in dbus_connection_dispatch () from /usr/lib64/libdbus-1.so.3
#11 0x00007fffecdf7b65 in ?? () from /usr/lib64/libgvfscommon.so.0
#12 0x00007ffff583d14d in g_main_dispatch (context=0x6d46e0) at gmain.c:3234
#13 g_main_context_dispatch (context=context@entry=0x6d46e0) at gmain.c:3887
#14 0x00007ffff583d3f8 in g_main_context_iterate (context=0x6d46e0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3960
#15 0x00007ffff583d712 in g_main_loop_run (loop=0x11e01e0) at gmain.c:4156
#16 0x00007ffff730d8d3 in gtk_dialog_run (dialog=0xf7f350) at gtkdialog.c:1397
#17 0x000000000040c20e in run_filedialog (title=0x441130 "Load a circuit", fn=0x441146 ".", openfile=1) at misc.c:224
jcoppens
  • 5,306
  • 6
  • 27
  • 47

1 Answers1

0

That message comes from the Gio module of the GLib. The exact location depends on the version of the Glib you use.

network_enumeration_finished in your backtrace comes from gtk/gtkplacesview.c:

static void
network_enumeration_finished (GObject      *source_object,
                              GAsyncResult *res,
                              gpointer      user_data)
{
  GtkPlacesViewPrivate *priv;
  GFileEnumerator *enumerator;
  GError *error;

  error = NULL;
  enumerator = g_file_enumerate_children_finish (G_FILE (source_object), res, &error);

  if (error)
    {
      if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) &&
          !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED))
        g_warning ("Failed to fetch network locations: %s", error->message);

      g_clear_error (&error);     
      g_object_unref (GTK_PLACES_VIEW (user_data));
    }
  else
    {
      ...
    }
}

So that's the call to g_file_enumerate_children_finish that fails. That function is located in GLib's source in gio/gfile.c.

Calling g_file_get_uri in your debugger on source_object should give you the URI of the location that failed.

liberforce
  • 11,189
  • 37
  • 48
  • Thanks for the suggestion. In glib 2.52.2, I can't locate `network_enumeration_finished` anywhere - not just in gfile.c. To be sure, I also downloaded and searched 2.54.3 – jcoppens Jan 22 '18 at 17:42
  • Sorry, got confused on the locations, I'm fixing that. – liberforce Jan 23 '18 at 09:45