[gstreamer-bugs] [Bug 597662] Windows-incompatible changes in gstreamer

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Dec 8 10:53:42 PST 2009


https://bugzilla.gnome.org/show_bug.cgi?id=597662
  GStreamer | gstreamer (core) | git

--- Comment #29 from LRN <lrn1986 at gmail.com> 2009-12-08 18:53:39 UTC ---
Can't reproduce.

Apparently, loader->fd_w.fd is left at "(gpointer) -1" (the value it is
initialized with).

The only place where fd_w.fd is altered is the call to
gst_win32_spawn_async_with_named_pipes(). If fd_w.fd is left at 0xffffffff
after that call, it means that do_spawn_with_named_pipes() fails to create a
pipe. But it doesn't, because if it did, it would have returned FALSE.

Rather, i think it means that plugin_loader_free() is called for a pluginloader
that was initialized (which is done at creation time), but that never had a
chance to call gst_plugin_loader_try_helper(), so fd_w.fd remained 0xffffffff.

Which is very confusing, because gst_update_registry() never calls
clear_scan_context() and thus plugin_loader_free (which it does, according to
your backtrace). And even if it did, clear_scan_context() shouldn't try to
destroy pluginloader, unless context->helper is non-NULL, which should only
happen when gst_plugin_loader_try_helper() was called.

The fact that it comes to plugin_loader_free() being called for a pluginloader
without a helper process is clearly a bug. However as far as i can see, calling
fsync() with invalid FD is not an error (sets errno to BADF, but that's all it
does), so here's a fixed version of gst_win32_fsync():

gint
gst_win32_fsync (WinFd *wfd)
{
  if (G_UNLIKELY (!wfd || wfd->fd == (gpointer) -1))
  {
    errno = EBADF;
    return -1;
  }

  FlushFileBuffers (wfd->fd);
  return 0;
}

P.S. Don't forget to fix the prototype in gstwin32io.h

P.P.S. It might be a good idea to further improve this function by checking for
FlushFileBuffers return value: if it's zero, GetLastError() should be called
and errno set appropriately.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.




More information about the Gstreamer-bugs mailing list