startx hanging - startup problem located

martouf . martouf5@gmail.com
Sun May 1 21:15:00 GMT 2005


On 4/30/05, Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> wrote:
> 
> Just as expected. The forked xkbcomp does still hang forever.
> 
> > // any chance at all what I'm seeing has something to do with the
> > EINTR || ECHILD possibility above?
> 
> Even then the xserver should continue. But it appears to be waiting for
> the child which never exits properly.

ok then, any chance the pipe(), fork() and _exit() semantics are involved?
I wrote a small test program along the lines of what Popen() is doing,
and on SunOS 5.8 the output is::

 child :: myPID = 2998 :: 1 parent :: chPID = 2998
parent :: pd[0] = 3    pd[1] = 4
2 3 4 5 6 7 8 9 10

Done..
child put 1442 bytes in fd 3

All done..

while on Linux 2.6.4-52-default and CYGWIN_NT-5.1 1.5.13(0.122/4/2)
the output is:

 child :: myPID = 6295 :: 1 parent :: chPID = 6295
parent :: pd[0] = 3    pd[1] = 4
2 3 4 5 6 7 8 9 10

Done..
child put 0 bytes in fd 3

All done..

a description of the test program:

1. the parent makes a pipe() and fork()s. the child slowly counts to
10 and then uses dup2() to make the  'w'||pd[1] end of the pipe into
stdout and close()s the 'r'||pd[0] end of the pipe.
(SunOS 5.8 creates a bidirectional pipe, while the Linux doc indicates
it creates a unidirectional pipe with pd[0] ready to be read and pd[1]
ready to be written)

2. the child then execl()s a shell which makes more output and
_exit()s if the execl() is unsuccessful.

3. the parent sets SIGCHLD to SIG_IGN and close()s the 'w'||pd[1] end
of the pipe.

4. the parent blocks in waitpid() until the child completes, then
fstat()s the 'r'||pd[0] end of the pipe and reports the number of
bytes written into it.



More information about the Cygwin-xfree mailing list