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 668747 - FileChooser's get_uris uses excessive fsyncs and blocks the main loop
FileChooser's get_uris uses excessive fsyncs and blocks the main loop
Status: RESOLVED DUPLICATE of bug 616997
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.24.x
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2012-01-26 14:53 UTC by Jean-François Fortin Tam
Modified: 2012-01-31 15:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jean-François Fortin Tam 2012-01-26 14:53:32 UTC
In pitivi, we have a file chooser dialog where you select multiple files, press OK and then pitivi does filechooser.get_uris() to get the list of files it has to process.

However, as soon as you start, the filechooser blocks the main thread.

Pitivi's processing of those files (gst's discoverer) is async and is not the one blocking the UI.

We spent three hours digging to find out why gst discoverer's signals could not be received in a reasonable time frame: for 56 URIs for example, it takes about 6 seconds until the main loop is accessible again, then everything unblocks, the signals get received and the UI updates itself.

Here's what happens in gdb:

Thread 1 (Thread 0xb7fe66c0 (LWP 20359))

  • #0 __kernel_vsyscall
  • #1 fsync
    from /lib/libpthread.so.0
  • #2 g_file_set_contents
    from /lib/libglib-2.0.so.0
  • #3 g_bookmark_file_to_file
    from /lib/libglib-2.0.so.0
  • #4 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #5 g_cclosure_marshal_VOID__VOID
    from /lib/libgobject-2.0.so.0
  • #6 ??
    from /lib/libgobject-2.0.so.0
  • #7 g_closure_invoke
    from /lib/libgobject-2.0.so.0
  • #8 ??
    from /lib/libgobject-2.0.so.0
  • #9 g_signal_emit_valist
    from /lib/libgobject-2.0.so.0
  • #10 g_signal_emit
    from /lib/libgobject-2.0.so.0
  • #11 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #12 gtk_recent_manager_add_full
    from /usr/lib/libgtk-x11-2.0.so.0
  • #13 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #14 g_simple_async_result_complete
    from /lib/libgio-2.0.so.0
  • #15 ??
    from /lib/libgio-2.0.so.0
  • #16 ??
    from /lib/libglib-2.0.so.0
  • #17 g_main_context_dispatch
    from /lib/libglib-2.0.so.0
  • #18 ??
    from /lib/libglib-2.0.so.0
  • #19 g_main_loop_run
    from /lib/libglib-2.0.so.0
  • #20 ??
    from /usr/lib/python2.7/site-packages/glib/_glib.so
  • #21 PyEval_EvalFrameEx
    from /usr/lib/libpython2.7.so.1.0
  • #22 PyEval_EvalFrameEx
    from /usr/lib/libpython2.7.so.1.0
  • #23 PyEval_EvalFrameEx
    from /usr/lib/libpython2.7.so.1.0
  • #24 PyEval_EvalFrameEx
    from /usr/lib/libpython2.7.so.1.0
  • #25 PyEval_EvalCodeEx
    from /usr/lib/libpython2.7.so.1.0
  • #26 PyEval_EvalCode
    from /usr/lib/libpython2.7.so.1.0
  • #27 ??
    from /usr/lib/libpython2.7.so.1.0
  • #28 PyRun_FileExFlags
    from /usr/lib/libpython2.7.so.1.0
  • #29 PyRun_SimpleFileExFlags
    from /usr/lib/libpython2.7.so.1.0
  • #30 PyRun_AnyFileExFlags
    from /usr/lib/libpython2.7.so.1.0
  • #31 Py_Main
    from /usr/lib/libpython2.7.so.1.0
  • #32 main

Comment 1 Federico Mena Quintero 2012-01-27 20:45:39 UTC
The fix for this made it into 3.x; see commit ce5a29bc38.  It was previously filed as bug #616997.

You may want to backport this to 2.24 and push the fix :)

*** This bug has been marked as a duplicate of bug 616997 ***
Comment 2 Jean-François Fortin Tam 2012-01-31 15:29:18 UTC
Good to know it's fixed in 3.x. Given that eventually pitivi will switch to gtk3 and that this bug is an annoyance rather than a critical problem, I guess I'll just wait :)