Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
42cc2bdf
Commit
42cc2bdf
authored
Jun 07, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setup signal handling and exceptions only after REQ_INIT_PROCESS_DONE
has been sent, to avoid deadlocking the debugger.
parent
9926d334
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
26 deletions
+14
-26
signal_i386.c
dlls/ntdll/signal_i386.c
+0
-2
client.c
scheduler/client.c
+9
-10
process.c
scheduler/process.c
+5
-14
No files found.
dlls/ntdll/signal_i386.c
View file @
42cc2bdf
...
...
@@ -734,8 +734,6 @@ BOOL SIGNAL_Init(void)
}
#endif
/* HAVE_SIGALTSTACK */
/* ignore SIGPIPE so that WINSOCK can get a EPIPE error instead */
signal
(
SIGPIPE
,
SIG_IGN
);
/* automatic child reaping to avoid zombies */
signal
(
SIGCHLD
,
SIG_IGN
);
...
...
scheduler/client.c
View file @
42cc2bdf
...
...
@@ -11,6 +11,7 @@
#include <errno.h>
#include <fcntl.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
...
...
@@ -411,16 +412,19 @@ static int server_connect( const char *oldcwd, const char *serverdir )
fatal_error
(
"'%s/%s' is not owned by you
\n
"
,
serverdir
,
SOCKETNAME
);
/* try to connect to it */
if
((
s
=
socket
(
AF_UNIX
,
SOCK_STREAM
,
0
))
==
-
1
)
fatal_perror
(
"socket"
);
addr
.
sun_family
=
AF_UNIX
;
strcpy
(
addr
.
sun_path
,
SOCKETNAME
);
slen
=
sizeof
(
addr
)
-
sizeof
(
addr
.
sun_path
)
+
strlen
(
addr
.
sun_path
)
+
1
;
#ifdef HAVE_SOCKADDR_SUN_LEN
addr
.
sun_len
=
slen
;
#endif
if
((
s
=
socket
(
AF_UNIX
,
SOCK_STREAM
,
0
))
==
-
1
)
fatal_perror
(
"socket"
);
if
(
connect
(
s
,
(
struct
sockaddr
*
)
&
addr
,
slen
)
==
-
1
)
{
usleep
(
50000
);
/* in case the server was starting right now */
close
(
s
);
/* wait a bit and retry with a new socket */
usleep
(
50000
);
if
((
s
=
socket
(
AF_UNIX
,
SOCK_STREAM
,
0
))
==
-
1
)
fatal_perror
(
"socket"
);
if
(
connect
(
s
,
(
struct
sockaddr
*
)
&
addr
,
slen
)
==
-
1
)
fatal_error
(
"'%s/%s' exists,
\n
"
" but I cannot connect to it; maybe the server has crashed?
\n
"
...
...
@@ -440,18 +444,10 @@ static int server_connect( const char *oldcwd, const char *serverdir )
int
CLIENT_InitServer
(
void
)
{
int
fd
,
size
;
const
char
*
env_fd
;
char
hostname
[
64
];
char
*
oldcwd
,
*
serverdir
;
const
char
*
configdir
;
/* first check if we inherited the socket fd */
if
((
env_fd
=
getenv
(
"__WINE_FD"
))
&&
isdigit
(
env_fd
[
0
]))
{
fd
=
atoi
(
env_fd
);
if
(
fcntl
(
fd
,
F_SETFD
,
1
)
!=
-
1
)
return
fd
;
/* set close on exec flag */
}
/* retrieve the current directory */
for
(
size
=
512
;
;
size
*=
2
)
{
...
...
@@ -497,6 +493,9 @@ int CLIENT_InitThread(void)
TEB
*
teb
=
NtCurrentTeb
();
int
fd
;
/* ignore SIGPIPE so that we get a EPIPE error instead */
signal
(
SIGPIPE
,
SIG_IGN
);
if
(
wait_reply_fd
(
&
fd
)
||
(
fd
==
-
1
))
server_protocol_error
(
"no fd passed on first request
\n
"
);
if
((
teb
->
buffer_size
=
lseek
(
fd
,
0
,
SEEK_END
))
==
-
1
)
server_perror
(
"lseek"
);
...
...
scheduler/process.c
View file @
42cc2bdf
...
...
@@ -207,9 +207,6 @@ BOOL PROCESS_Init(void)
initial_envdb
.
hStdout
=
initial_startup
.
hStdOutput
=
req
->
hstdout
;
initial_envdb
.
hStderr
=
initial_startup
.
hStdError
=
req
->
hstderr
;
/* Initialize signal handling */
if
(
!
SIGNAL_Init
())
return
FALSE
;
/* Remember TEB selector of initial process for emergency use */
SYSLEVEL_EmergencyTeb
=
NtCurrentTeb
()
->
teb_sel
;
...
...
@@ -318,8 +315,6 @@ static inline char *build_command_line( char **argv )
*/
static
void
start_process
(
void
)
{
__TRY
{
struct
init_process_done_request
*
req
=
get_req_buffer
();
int
debugged
,
console_app
;
HMODULE16
hModule16
;
...
...
@@ -347,6 +342,11 @@ static void start_process(void)
server_call
(
REQ_INIT_PROCESS_DONE
);
debugged
=
req
->
debugged
;
/* Install signal handlers; this cannot be done before, since we cannot
* send exceptions to the debugger before the create process event that
* is sent by REQ_INIT_PROCESS_DONE */
if
(
!
SIGNAL_Init
())
goto
error
;
/* Load KERNEL (necessary for TASK_Create) */
if
(
!
LoadLibraryA
(
"KERNEL32"
))
goto
error
;
...
...
@@ -379,13 +379,6 @@ static void start_process(void)
error:
ExitProcess
(
GetLastError
()
);
}
__EXCEPT
(
UnhandledExceptionFilter
)
{
TerminateThread
(
GetCurrentThread
(),
GetExceptionCode
()
);
}
__ENDTRY
}
...
...
@@ -410,8 +403,6 @@ static void PROCESS_Start( HMODULE main_module, LPCSTR filename )
PE_HEADER
(
main_module
)
->
OptionalHeader
.
SizeOfStackReserve
,
TRUE
))
ExitProcess
(
GetLastError
()
);
SIGNAL_Init
();
/* reinitialize signal stack */
/* switch to the new stack */
SYSDEPS_SwitchToThreadStack
(
start_process
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment