Patrik Stridvall <[EMAIL PROTECTED]> writes:

> The problem seem to be that wait_process fails,
> but I can't understand why.
> 
> It is most likely because of Alexandre latest
> changes, but I have read them carefully,
> and I can see nothing new that are likely 
> to work differently on Solaris.

My guess is that Solaris threads share the same parent pid. The new
process creation code relies on getppid() to find the process that
holds the startup info for a newly created process.

The fact that we create a thread for a new process is temporary; when
address space separation is in place (Real Soon Now ;-) we will use
fork() to create all new processes and then getppid() will do the
right thing.

> < 080686b8: wait_process() = 0 { pid=0, phandle=-1, tid=0, thandle=-1,
> event=1 }
> 
> Here wait process succeds with bogus results.
> 
> < 080686b8: select( count=2, flags=0, timeout=-1, handles={-1,1} )
> < 080686b8: select() = c0000008 { signaled=-1 }
> 
> Here is a select on the bogus results,
> that fails.

Yes, there is a missing check for wait_process failure here; I'll fix
that.

> < 0806ba18: create_semaphore( initial=00000000, max=00000001, inherit=0,
> name=L"" )
> < 0806ba18: create_semaphore() = 0 { handle=68 }
> < 0806ba18: select( count=1, flags=4, timeout=5000, handles={68} )
> < 0806c258: release_semaphore( handle=68, count=00000001 )
> < 0806c258: release_semaphore() = c0000008 { prev_count=00000000 }
> < 0806c258: select( count=1, flags=4, timeout=5000, handles={68} )
> < 0806c258: select() = c0000008 { signaled=-1 }
> 
> Here a critical section fails for some reason.
> Initially I though this was the main problem,
> but it is probably just a reault of first on
> wait_process.
> 
> Anyway, how could create_semaphore sucecced but
> release semaphore fail, after the process
> creation had failed?

This is most likely because handles are not shared properly, because
the process didn't find its parent through getppid(). You should be
able to fix that by adding a ConvertToGlobalHandle() in the critical
section semaphore creation.

-- 
Alexandre Julliard
[EMAIL PROTECTED]

Reply via email to