Andreas Schwab
a70ef84746
- i686-strcasecmp-fallback.patch: fix fallback in i686 strcasecmp/strncasecmp - nonascii-case.patch: also test strncasecmp - pldd-wait-ptrace-stop.patch: fix pldd not to leave process stopped after detaching (bnc#819383) OBS-URL: https://build.opensuse.org/request/show/185399 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=302
60 lines
1.5 KiB
Diff
60 lines
1.5 KiB
Diff
2013-07-31 Andreas Schwab <schwab@suse.de>
|
|
|
|
* elf/pldd.c (wait_for_ptrace_stop): New function.
|
|
(main): Call it after attaching.
|
|
|
|
Index: glibc-2.17/elf/pldd.c
|
|
===================================================================
|
|
--- glibc-2.17.orig/elf/pldd.c
|
|
+++ glibc-2.17/elf/pldd.c
|
|
@@ -34,6 +34,7 @@
|
|
#include <unistd.h>
|
|
#include <sys/ptrace.h>
|
|
#include <sys/stat.h>
|
|
+#include <sys/wait.h>
|
|
|
|
#include <ldsodefs.h>
|
|
#include <version.h>
|
|
@@ -85,6 +86,7 @@ static char *exe;
|
|
|
|
/* Local functions. */
|
|
static int get_process_info (int dfd, long int pid);
|
|
+static void wait_for_ptrace_stop (long int pid);
|
|
|
|
|
|
int
|
|
@@ -173,6 +175,8 @@ main (int argc, char *argv[])
|
|
tid);
|
|
}
|
|
|
|
+ wait_for_ptrace_stop (tid);
|
|
+
|
|
struct thread_list *newp = alloca (sizeof (*newp));
|
|
newp->tid = tid;
|
|
newp->next = thread_list;
|
|
@@ -197,6 +201,24 @@ main (int argc, char *argv[])
|
|
}
|
|
|
|
|
|
+/* Wait for PID to enter ptrace-stop state after being attached. */
|
|
+static void
|
|
+wait_for_ptrace_stop (long int pid)
|
|
+{
|
|
+ int status;
|
|
+
|
|
+ /* While waiting for SIGSTOP being delivered to the tracee we have to
|
|
+ reinject any other pending signal. Ignore all other errors. */
|
|
+ while (waitpid (pid, &status, __WALL) == pid && WIFSTOPPED (status))
|
|
+ {
|
|
+ /* The STOP signal should not be delivered to the tracee. */
|
|
+ if (WSTOPSIG (status) == SIGSTOP)
|
|
+ return;
|
|
+ ptrace (PTRACE_CONT, pid, NULL, (void *) (uintptr_t) WSTOPSIG (status));
|
|
+ }
|
|
+}
|
|
+
|
|
+
|
|
/* Handle program arguments. */
|
|
static error_t
|
|
parse_opt (int key, char *arg, struct argp_state *state)
|