Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
1b2adad8
Commit
1b2adad8
authored
19 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
Don't try to detach from a thread that is exiting, to avoid triggering
a kernel race condition.
parent
3f24b916
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
server/ptrace.c
+9
-18
9 additions, 18 deletions
server/ptrace.c
server/thread.c
+1
-1
1 addition, 1 deletion
server/thread.c
server/thread.h
+0
-1
0 additions, 1 deletion
server/thread.h
with
10 additions
and
20 deletions
server/ptrace.c
+
9
−
18
View file @
1b2adad8
...
...
@@ -197,23 +197,6 @@ int send_thread_signal( struct thread *thread, int sig )
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 */
int
attach_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
)
{
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
;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
server/thread.c
+
1
−
1
View file @
1b2adad8
...
...
@@ -766,7 +766,7 @@ void kill_thread( struct thread *thread, int violent_death )
abandon_mutexes
(
thread
);
remove_process_thread
(
thread
->
process
,
thread
);
wake_up
(
&
thread
->
obj
,
0
);
detach_thread
(
thread
,
violent_death
?
SIGTERM
:
0
);
if
(
violent_death
)
send_thread_signal
(
thread
,
SIGTERM
);
cleanup_thread
(
thread
);
release_object
(
thread
);
}
...
...
This diff is collapsed.
Click to expand it.
server/thread.h
+
0
−
1
View file @
1b2adad8
...
...
@@ -122,7 +122,6 @@ extern struct token *thread_get_impersonation_token( struct thread *thread );
extern
void
sigchld_callback
(
void
);
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
void
detach_process
(
struct
process
*
process
);
extern
int
suspend_for_ptrace
(
struct
thread
*
thread
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment