Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - error code 9 (EBADF) from posix_spawn: (3 Items)
   
error code 9 (EBADF) from posix_spawn  
During the first boot after cfp, the system is under incredibly heavy load due to lots of services performing setup at 
the same time. During this period the launcher starts the cascades and webkit zygotes using posix_spawn. I've found 
about 50% of the time the webkit spawn fails with

Jul 18 20:14:51    3    41   100 launcher: warning spawn_delegate:Could not spawn /bin/webkit-launcher launch delegate, 
err=9(Bad file descriptor)

EBADF isn't a valid return code from posix_spawn according to the main page! (ENOENT is, but that's different...) What 
could cause posix_spawn to return this?

Some differences I can think of between the webkit zygote and the cascades zygote, which hasn't reported this problem, 
are:

webkit is last alphabetically so it is started later; since this error is intermittent, timing could be significant

/bin/webkit-launcher is a symlink to /usr/bin/weblauncher, so spawn is not trying to open the binary directly - could 
EBADF be generated during a failure while trying to follow the symlink? (Note that by the time boot is finished and I 
ssh in, both source and target of the symlink are in place and working fine.)
RE: error code 9 (EBADF) from posix_spawn  
It could be that some file descriptors that were open in the parent process can't be duplicated into the child process.
(e.g. they were closed by the parent shortly after calling posix_spawn() )

Try spawnp() with fd_count 3 (fds 0, 1, 2) instead.


-----Original Message-----
EBADF isn't a valid return code from posix_spawn according to the main page! (ENOENT is, but that's different...) What 
could cause posix_spawn to return this?
Re: RE: error code 9 (EBADF) from posix_spawn  
Joe, did this fix your problem?  I am having a similar problem with spawn but it occurs less frequently than your 
problem.  I made the suggested change but its difficult to test if this really fixes the problem.