=================== BUG #4825: LATEST MODIFICATIONS ==================
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=4825&group_id=99
Changes by: Adam Fedor <fedor@gnu.org>
Date: Fri 08/22/2003 at 21:25 (US/Mountain)
What | Removed | Added
----------------------------------------------------------------------
-----
Resolution | None | Fixed
Assigned to | None | fedor
Status | Open | Closed
------------------ Additional Follow-up Comments
----------------------------
Added something like the proposed patch
=================== BUG #4825: FULL BUG SNAPSHOT ===================
Submitted by: ehz Project: GNUstep
Submitted on: Mon 08/18/2003 at 09:09
Category: Gui/AppKit Severity: 5 - Major
Bug Group: Bug Resolution: Fixed
Assigned to: fedor Status: Closed
Summary: gnustep_sndd is hanging the debian build daemons
Original Submission: When trying to autobuild packages wich depend
on gnustep-gui0_0.8.8 for debian, gnustep_sndd hangs the debian build
daemons.
Report from Ryan Murray :
gnustep-gui0's sound server is hanging the build daemons
again, however :(
When building gnustep-gui package or when building
packages wich depend on gnustep-gui0 ?
Which depend on gnustep-gui0. This can be caused by the
sound daemon not
properly backgrounding itself...
What's the status on this? Recent gnustep needing uploads
hung the buildds again. I'll be excluding these packages
from the buildds if it isn't fixed the next time it
happens...
Report from James Troup :
gnustep_sndd doesn't properly daemonize (fails to close
fds, I guess?)... Someone should beat "how to program a
daemon" into gnustep upstream; this isn't the first (or
second, or third :p) time we've had this problem with
gnustep daemons.
--
James
Mattias Klose has written a patch wich fix the problem.
See the attached file.
Follow-up Comments
*******************
-------------------------------------------------------
Date: Fri 08/22/2003 at 21:25 By: fedor
Added something like the proposed patch
-------------------------------------------------------
Date: Mon 08/18/2003 at 09:35 By: ehz
The patch again (to be viewed online) :
--- gsnd/gsnd.m~ 2002-07-30 23:19:05.000000000 +0200
+++ gsnd/gsnd.m 2003-08-14 07:36:43.000000000 +0200
@@ -24,6 +24,7 @@
#include "portaudio/pa_common/portaudio.h"
#include <math.h>
#include <unistd.h>
+#include <fcntl.h>
#ifdef __MINGW__
#include "process.h"
@@ -969,6 +970,8 @@
int main(int argc, char** argv, char **env)
{
+ int is_daemon = 1, c;
+
CREATE_AUTORELEASE_POOL(pool);
#ifdef GS_PASS_ARGUMENTS
@@ -1007,6 +1010,42 @@
}
#endif
+ /*
+ * Ensure we don't have any open file descriptors which may refer
+ * to sockets bound to ports we may try to use.
+ *
+ * Use '/dev/null' for stdin and stdout. Assume stderr is ok.
+ */
+ for (c = 0; c < FD_SETSIZE; c++)
+ {
+ if (is_daemon /*|| (c != 2)*/)
+ {
+ (void)close(c);
+ }
+ }
+ if (open("/dev/null", O_RDONLY) != 0)
+ {
+ NSLog(@"gsnd - failed to open stdin from /dev/null (%s)",
+ strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+ if (open("/dev/null", O_WRONLY) != 1)
+ {
+ NSLog(@"gsnd - failed to open stdout from /dev/null (%s)",
+ strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+ if (is_daemon && open("/dev/null", O_WRONLY) != 2)
+ {
+ NSLog(@"gsnd - failed to open stderr from /dev/null (%s)",
+ strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+ if (0)
+ {
+ NSLog(@"gsnd - Closed descriptors");
+ }
+
gsnd = [[SoundServer alloc] init];
if (gsnd == nil) {
@@ -1262,4 +1301,3 @@
NSLog([NSString stringWithCString: s]);
return -1;
}
-
CC list is empty
File Attachments
****************
-------------------------------------------------------
Date: Mon 08/18/2003 at 09:09 Name: patch Size: 1KB By: ehz
patch
http://savannah.gnu.org/bugs/
download.php?group_id=99&bug_id=4825&bug_file_id=606
For detailed info, follow this link:
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=4825&group_id=99
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/