bugGNUstep - Bugs: bug #4825, gnustep_sndd is hanging the debian...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #4825: gnustep_sndd is hanging the debian build daemons

Submitted by:  Eric Heintzmann <ehz>
Submitted on:  Mon 18 Aug 2003 03:09:34 PM UTC  
 
Category: Gui/AppKitSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: Adam Fedor <fedor>
Open/Closed: Closed

Sat 23 Aug 2003 03:25:32 AM UTC, comment #2:

Added something like the proposed patch

Adam Fedor <fedor>
Project AdministratorIn charge of this item.
Mon 18 Aug 2003 03:35:10 PM UTC, comment #1:

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;
}
-

Eric Heintzmann <ehz>
Mon 18 Aug 2003 03:09:34 PM UTC, 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.

Eric Heintzmann <ehz>

 

Attached Files
file #609:  patch added by ehz (1KiB - application/octet-stream - patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat 23 Aug 2003 03:25:32 AM UTCfedorStatusNone=>(Error - Not Found)
  Assigned toNone=>NA
  Open/ClosedOpen=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1