[Bug 24101] Recursive CreateProcess() fails

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Sep 21 03:10:47 CDT 2010


http://bugs.winehq.org/show_bug.cgi?id=24101

--- Comment #33 from Guillaume ORTEGA <guillaume.ortega at OpenPlug.com> 2010-09-21 03:10:47 CDT ---
Hi,

I finally found and fix the problem :

in dlls/kernel32/process.c function create_process:

    if (socketpair( PF_UNIX, SOCK_STREAM, 0, socketfd ) == -1)
    {
        RtlReleasePebLock();
        HeapFree( GetProcessHeap(), 0, winedebug );
        HeapFree( GetProcessHeap(), 0, startup_info );
        SetLastError( ERROR_TOO_MANY_OPEN_FILES );
        return FALSE;
    }
    wine_server_send_fd( socketfd[1] );
    close( socketfd[1] );

On MacOSX the function wine_server_send_fd is not blocking, so when
close(socketfd[1] ); is executed sometimes the server hasn't received the fd.

So I just move the instruction close( socketfd[1] ); after the server request :

    SERVER_START_REQ( new_process )
    {
        req->inherit_all    = inherit;
        req->create_flags   = flags;
        req->socket_fd      = socketfd[1];
        req->exe_file       = wine_server_obj_handle( hFile );
        req->process_access = PROCESS_ALL_ACCESS;
        req->process_attr   = (psa && (psa->nLength >= sizeof(*psa)) &&
psa->bInheritHandle) ? OBJ_INHERIT : 0;
        req->thread_access  = THREAD_ALL_ACCESS;
        req->thread_attr    = (tsa && (tsa->nLength >= sizeof(*tsa)) &&
tsa->bInheritHandle) ? OBJ_INHERIT : 0;
        req->info_size      = startup_info_size;

        wine_server_add_data( req, startup_info, startup_info_size );
        wine_server_add_data( req, env, (env_end - env) * sizeof(WCHAR) );
        if ((ret = !wine_server_call_err( req )))
        {
            info->dwProcessId = (DWORD)reply->pid;
            info->dwThreadId  = (DWORD)reply->tid;
            info->hProcess    = wine_server_ptr_handle( reply->phandle );
            info->hThread     = wine_server_ptr_handle( reply->thandle );
        }
        process_info = wine_server_ptr_handle( reply->info );
    }
    SERVER_END_REQ;
    close( socketfd[1] );


And it works.

Best Regards,

Guillaume ORTEGA.

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list