From mwisnicki@gmail.com Fri Oct 20 13:28:47 2006 Return-Path: Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B225D16A412 for ; Fri, 20 Oct 2006 13:28:47 +0000 (UTC) (envelope-from mwisnicki@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id C93DB43D4C for ; Fri, 20 Oct 2006 13:28:46 +0000 (GMT) (envelope-from mwisnicki@gmail.com) Received: by ug-out-1314.google.com with SMTP id m2so640937uge for ; Fri, 20 Oct 2006 06:28:45 -0700 (PDT) Received: by 10.67.93.7 with SMTP id v7mr1434867ugl; Fri, 20 Oct 2006 06:28:43 -0700 (PDT) Received: from ghost.pnet.one.pl ( [84.40.242.20]) by mx.google.com with ESMTP id 27sm1378094ugp.2006.10.20.06.28.42; Fri, 20 Oct 2006 06:28:43 -0700 (PDT) Message-Id: <1161350923.16340@ghost.pnet.one.pl> Date: Fri, 20 Oct 2006 15:28:43 +0200 From: "Marcin Wisnicki" Sender: =?UTF-8?B?TWFyY2luIFdpxZtuaWNraQ==?= To: "FreeBSD gnats submit" Subject: [PATCH] gnome-settings-deamon crashes on startup because of a bug in gstreamer X-Send-Pr-Version: gtk-send-pr 0.4.7 X-GNATS-Notify: >Number: 104617 >Category: ports >Synopsis: [PATCH] gnome-settings-daemon crashes on startup because of a bug in gstreamer >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-multimedia >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Oct 20 13:30:18 GMT 2006 >Closed-Date: Sat Oct 21 21:58:49 GMT 2006 >Last-Modified: Sat Oct 21 22:00:35 GMT 2006 >Originator: Marcin Wisnicki >Release: FreeBSD 6.2-PRERELEASE i386 >Organization: >Environment: System: FreeBSD 6.2-PRERELEASE #3: Wed Sep 27 01:35:57 CEST 2006 root@ghost.pnet.one.pl:/home/obj/usr/src/sys/SERWER gnome-control-center-2.16.1 gnome2-2.16.1_2 gstreamer-0.10.10 >Description: gnome-settings daemon fails to start because of the bug in gstreamer. This bug was fixed in cvs, attached patch was extracted from Ubuntu, please put it in multimedia/gstreamer/files and bump portrevision of that port. With that patch I can successfully start gnome. More details details in ubuntu bug report: https://launchpad.net/distros/ubuntu/+source/control-center/+bug/59217 and in gnome bugzilla: http://bugzilla.gnome.org/show_bug.cgi?id=355499 >How-To-Repeat: login or start /usr/local/libexec/gnome-settings-daemon >Fix: --- patch-01_fix_gst_init_race_issue begins here --- diff -Nur gst/gst.c gst/gst.c --- gst/gst.c 2006-09-14 16:02:23.000000000 +0200 +++ gst/gst.c 2006-10-05 21:46:11.000000000 +0200 @@ -683,10 +683,16 @@ { #ifdef HAVE_FORK pid_t pid; + int pfd[2]; /* We fork here, and let the child read and possibly rebuild the registry. * After that, the parent will re-read the freshly generated registry. */ GST_DEBUG ("forking"); + + if (pipe (pfd) == -1) { + return FALSE; + } + pid = fork (); if (pid == -1) { GST_ERROR ("Failed to fork()"); @@ -695,8 +701,11 @@ if (pid == 0) { gboolean res; + gchar res_byte; - /* this is the child */ + /* this is the child. Close the read pipe */ + close (pfd[0]); + GST_DEBUG ("child reading registry cache"); res = scan_and_update_registry (default_registry, registry_file, TRUE); _gst_registry_remove_cache_plugins (default_registry); @@ -708,38 +717,42 @@ /* make valgrind happy (yes, you can call it insane) */ g_free ((char *) registry_file); - _exit ((res) ? EXIT_SUCCESS : EXIT_FAILURE); + /* write a result byte to the pipe */ + res_byte = res ? '1' : '0'; + write (pfd[1], &res_byte, 1); + _exit (0); } else { - /* parent */ - int status; - pid_t ret; + int ret; + gchar res_byte; + + /* parent. Close write pipe */ + close (pfd[1]); + + /* Wait for result from the pipe */ + GST_DEBUG ("Waiting for data from child"); + ret = read (pfd[0], &res_byte, 1); - GST_DEBUG ("parent waiting on child"); - ret = waitpid (pid, &status, 0); - GST_DEBUG ("parent done waiting on child"); if (ret == -1) { - GST_ERROR ("error during waitpid: %s", g_strerror (errno)); + close (pfd[0]); return FALSE; } + close (pfd[0]); - if (!WIFEXITED (status)) { - if (WIFSIGNALED (status)) { - GST_ERROR ("child did not exit normally, terminated by signal %d", - WTERMSIG (status)); - } else { - GST_ERROR ("child did not exit normally, status: %d", status); - } + /* Wait to ensure the child is reaped, but ignore the result */ + GST_DEBUG ("parent waiting on child"); + waitpid (pid, NULL, 0); + GST_DEBUG ("parent done waiting on child"); + + if (ret == 0) { + GST_ERROR ("child did not exit normally, terminated by signal"); return FALSE; } - GST_DEBUG ("child exited normally with return value %d", - WEXITSTATUS (status)); - - if (WEXITSTATUS (status) == EXIT_SUCCESS) { - GST_DEBUG ("parent reading registry cache"); + if (res_byte == '1') { + GST_DEBUG ("Child succeeded. Parent reading registry cache"); gst_registry_xml_read_cache (default_registry, registry_file); } else { - GST_DEBUG ("parent re-scanning registry"); + GST_DEBUG ("Child failed. Parent re-scanning registry, ignoring errors."); scan_and_update_registry (default_registry, registry_file, FALSE); } } --- patch-01_fix_gst_init_race_issue ends here --- >Release-Note: >Audit-Trail: Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-multimedia Responsible-Changed-By: edwin Responsible-Changed-When: Fri Oct 20 21:04:08 UTC 2006 Responsible-Changed-Why: Over to maintainer http://www.freebsd.org/cgi/query-pr.cgi?pr=104617 State-Changed-From-To: open->closed State-Changed-By: mezz State-Changed-When: Sat Oct 21 21:58:34 UTC 2006 State-Changed-Why: Committed, thanks! http://www.freebsd.org/cgi/query-pr.cgi?pr=104617 From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: ports/104617: commit references a PR Date: Sat, 21 Oct 2006 21:58:28 +0000 (UTC) mezz 2006-10-21 21:58:22 UTC FreeBSD ports repository Modified files: multimedia/gstreamer Makefile Added files: multimedia/gstreamer/files patch-01_fix_gst_init_race_issue Log: Fix the ensure_current_registry_forking() fails if zombie already killed by signal handler. Patch was took from Ubuntu. Bump the PORTREVISION. https://launchpad.net/distros/ubuntu/+source/control-center/+bug/59217 http://bugzilla.gnome.org/show_bug.cgi?id=355499 PR: ports/104617 Submitted by: Marcin Wisnicki Approved by: portmgr (marcus) Revision Changes Path 1.55 +2 -0 ports/multimedia/gstreamer/Makefile 1.1 +97 -0 ports/multimedia/gstreamer/files/patch-01_fix_gst_init_race_issue (new) _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org" >Unformatted: