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
1b2adad8
Commit
1b2adad8
authored
Aug 22, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't try to detach from a thread that is exiting, to avoid triggering
a kernel race condition.
parent
3f24b916
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
20 deletions
+10
-20
ptrace.c
server/ptrace.c
+9
-18
thread.c
server/thread.c
+1
-1
thread.h
server/thread.h
+0
-1
No files found.
server/ptrace.c
View file @
1b2adad8
...
@@ -197,23 +197,6 @@ int send_thread_signal( struct thread *thread, int sig )
...
@@ -197,23 +197,6 @@ int send_thread_signal( struct thread *thread, int sig )
return
(
ret
!=
-
1
);
return
(
ret
!=
-
1
);
}
}
/* detach from a Unix thread and kill it */
void
detach_thread
(
struct
thread
*
thread
,
int
sig
)
{
if
(
thread
->
unix_pid
==
-
1
)
return
;
if
(
thread
->
attached
)
{
/* make sure it is stopped */
suspend_for_ptrace
(
thread
);
if
(
sig
)
send_thread_signal
(
thread
,
sig
);
if
(
thread
->
unix_pid
==
-
1
)
return
;
if
(
debug_level
)
fprintf
(
stderr
,
"%04x: *detached*
\n
"
,
thread
->
id
);
ptrace
(
PTRACE_DETACH
,
get_ptrace_pid
(
thread
),
(
caddr_t
)
1
,
sig
);
thread
->
attached
=
0
;
}
else
if
(
sig
)
send_thread_signal
(
thread
,
sig
);
}
/* attach to a Unix process with ptrace */
/* attach to a Unix process with ptrace */
int
attach_process
(
struct
process
*
process
)
int
attach_process
(
struct
process
*
process
)
{
{
...
@@ -242,7 +225,15 @@ void detach_process( struct process *process )
...
@@ -242,7 +225,15 @@ void detach_process( struct process *process )
LIST_FOR_EACH_ENTRY
(
thread
,
&
process
->
thread_list
,
struct
thread
,
proc_entry
)
LIST_FOR_EACH_ENTRY
(
thread
,
&
process
->
thread_list
,
struct
thread
,
proc_entry
)
{
{
if
(
thread
->
attached
)
detach_thread
(
thread
,
0
);
if
(
thread
->
attached
)
{
/* make sure it is stopped */
suspend_for_ptrace
(
thread
);
if
(
thread
->
unix_pid
==
-
1
)
return
;
if
(
debug_level
)
fprintf
(
stderr
,
"%04x: *detached*
\n
"
,
thread
->
id
);
ptrace
(
PTRACE_DETACH
,
get_ptrace_pid
(
thread
),
(
caddr_t
)
1
,
0
);
thread
->
attached
=
0
;
}
}
}
}
}
...
...
server/thread.c
View file @
1b2adad8
...
@@ -766,7 +766,7 @@ void kill_thread( struct thread *thread, int violent_death )
...
@@ -766,7 +766,7 @@ void kill_thread( struct thread *thread, int violent_death )
abandon_mutexes
(
thread
);
abandon_mutexes
(
thread
);
remove_process_thread
(
thread
->
process
,
thread
);
remove_process_thread
(
thread
->
process
,
thread
);
wake_up
(
&
thread
->
obj
,
0
);
wake_up
(
&
thread
->
obj
,
0
);
detach_thread
(
thread
,
violent_death
?
SIGTERM
:
0
);
if
(
violent_death
)
send_thread_signal
(
thread
,
SIGTERM
);
cleanup_thread
(
thread
);
cleanup_thread
(
thread
);
release_object
(
thread
);
release_object
(
thread
);
}
}
...
...
server/thread.h
View file @
1b2adad8
...
@@ -122,7 +122,6 @@ extern struct token *thread_get_impersonation_token( struct thread *thread );
...
@@ -122,7 +122,6 @@ extern struct token *thread_get_impersonation_token( struct thread *thread );
extern
void
sigchld_callback
(
void
);
extern
void
sigchld_callback
(
void
);
extern
int
get_ptrace_pid
(
struct
thread
*
thread
);
extern
int
get_ptrace_pid
(
struct
thread
*
thread
);
extern
void
detach_thread
(
struct
thread
*
thread
,
int
sig
);
extern
int
attach_process
(
struct
process
*
process
);
extern
int
attach_process
(
struct
process
*
process
);
extern
void
detach_process
(
struct
process
*
process
);
extern
void
detach_process
(
struct
process
*
process
);
extern
int
suspend_for_ptrace
(
struct
thread
*
thread
);
extern
int
suspend_for_ptrace
(
struct
thread
*
thread
);
...
...
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