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 637057 - [plugin-scanner] gstpoll fails with select backend
[plugin-scanner] gstpoll fails with select backend
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal blocker
: 0.10.32
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-12-11 21:09 UTC by Thiago Sousa Santos
Modified: 2011-01-04 13:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Log of it hanging (358.47 KB, application/octet-stream)
2010-12-11 21:09 UTC, Thiago Sousa Santos
  Details
pluginloader: Always mark reception as complete after EXIT (1.05 KB, patch)
2011-01-03 19:38 UTC, Edward Hervey
committed Details | Review

Description Thiago Sousa Santos 2010-12-11 21:09:43 UTC
Created attachment 176257 [details]
Log of it hanging

Running gst-inspect hangs on osx when it runs on a separate process.

Doing git bisect leads to this commit: 22fa4470e2497a1b766322497e285ca199709fcc

Trace:
(gdb) thread apply all bt

Thread 3 (process 25075)

  • #0 __workq_kernreturn
  • #1 _pthread_wqthread
  • #2 start_wqthread

Thread 2 (process 25075)

  • #0 kevent
  • #1 _dispatch_mgr_invoke
  • #2 _dispatch_queue_invoke
  • #3 _dispatch_worker_thread2
  • #4 _pthread_wqthread
  • #5 start_wqthread


And I'm also attaching a gst debug log here. If it helps, this setup only has the core package, so it should only find coreelements plugin.
Comment 1 Sebastian Dröge (slomo) 2010-12-12 10:30:02 UTC
I remember seeing a similar bug some time ago but can't find it now. What's 22fa4470e2497a1b766322497e285ca199709fcc for you? I can't find it in core
Comment 2 Edward Hervey 2010-12-12 11:23:25 UTC
That would be the GstPoll refactoring by wim:

commit 22fa4470e2497a1b766322497e285ca199709fcc
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Wed Nov 3 17:56:24 2010 +0100

    poll: Refactor and make more lockfree
    
    Refactor the wakeup of the poll thread.
    Always make a control socket to make things easier.
    Make more methods lockfree.

The osx buildslave is getting the same issue fwiw
Comment 3 Sebastian Dröge (slomo) 2010-12-12 11:53:57 UTC
Ah, my core was too old :) But that's a different bug then, the one I remembered was reported a few months ago.
Comment 4 Wim Taymans 2010-12-13 09:51:51 UTC
You could try to disable always creating the control socket, that was the biggest change. Like this:


diff --git a/gst/gstpoll.c b/gst/gstpoll.c
index af34f66..8dd3286 100644
--- a/gst/gstpoll.c
+++ b/gst/gstpoll.c
@@ -555,6 +555,7 @@ gst_poll_new (gboolean controllable)
   nset->active_fds = g_array_new (FALSE, FALSE, sizeof (struct pollfd));
   nset->control_read_fd.fd = -1;
   nset->control_write_fd.fd = -1;
+#if 0
   {
     gint control_sock[2];
 
@@ -570,6 +571,7 @@ gst_poll_new (gboolean controllable)
     gst_poll_add_fd_unlocked (nset, &nset->control_read_fd);
     gst_poll_fd_ctl_read_unlocked (nset, &nset->control_read_fd, TRUE);
   }
+#endif
 #else
   nset->mode = GST_POLL_MODE_WINDOWS;
   nset->fds = g_array_new (FALSE, FALSE, sizeof (WinsockFd));
Comment 5 Thiago Sousa Santos 2010-12-13 13:08:42 UTC
That makes gst-inspect work again, but causes failures on the check tests:

"Unexpected critical/warning: gstsystemclock: write control failed in wakeup_async, trying again : 9:Bad file descriptor"

I guess we need to add some more ifs on other calls using the control sockets
Comment 6 Leo Singer 2010-12-17 04:00:40 UTC
I find that the hang does not occur if I invoke gst-inspect with:

$ gst-inspect --gst-disable-registry-fork
Comment 7 Edward Hervey 2011-01-03 17:26:11 UTC
gstpoll on macosx uses pselect due to a broken poll implementation.

The timeout seems to be due to the fact that there now is an extra fd to track... which still exists *after* the 'regular' fds have been removed.
Comment 8 Edward Hervey 2011-01-03 18:41:43 UTC
Also fails on linux when you #undef' HAVE_POLL and HAVE_PPOLL in gstpoll (which makes it use pselect).
Comment 9 Edward Hervey 2011-01-03 19:38:50 UTC
Created attachment 177427 [details] [review]
pluginloader: Always mark reception as complete after EXIT

Avoids waiting forever on gst_poll_wait when using the select
backend.

Fixes #637057
Comment 10 Edward Hervey 2011-01-04 13:47:55 UTC
commit 36d44b3e5287af081dbea9840689e96d4f962cf1
Author: Edward Hervey <edward.hervey@collabora.co.uk>
Date:   Mon Jan 3 20:32:23 2011 +0100

    pluginloader: Always mark reception as complete after EXIT
    
    Avoids waiting forever on gst_poll_wait when using the select
    backend.
    
    Fixes #637057