This is the mail archive of the libc-hacker@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: tomorrow (Wednesday) is the day


> 
> Unless I hear about critical problems I'll make the 2.1 release in the
> later afternoon, Pacific time.  So speak up now but not about
> improvements or so, only bug fixes.
> 
> Right after the release is made I'll check in quite a lot of NSS
> changes (for the DNS module).  These are also bugs but since we
> haven't got any concreate compain in more than two years I'll consider
> it not critical.  I'll also check in the ld.so version map changes and
> the SPARC people can send me the optimized string functions.

This is my latest patch for Linuxthreads. I finally tracked down
the timing problem between gdb and Linuxthreads. The problem is
a thread may get SIGTRAP before gdb is ready to handle it. This
patch should be in 2.1. I will make gdb 4.17.0.10 today.

Thanks.


H.J.
--
Wed Feb  3 07:20:41 1999  H.J. Lu  <hjl@gnu.org>

	* manager.c (__pthread_manager): Do block __pthread_sig_debug.
	Don't restart the thread which sent REQ_DEBUG.
	(pthread_start_thread): Check if __pthread_sig_debug > 0
	before debugging.

	* pthread.c (__pthread_initialize_manager): Suspend ourself
	after sending __pthread_sig_debug to gdb instead of
	__pthread_sig_cancel.

Index: manager.c
===================================================================
RCS file: /home/work/cvs/gnu/glibc/linuxthreads/manager.c,v
retrieving revision 1.1.1.14
diff -u -p -r1.1.1.14 manager.c
--- manager.c	1999/01/30 23:57:11	1.1.1.14
+++ manager.c	1999/02/03 14:42:47
@@ -104,8 +104,6 @@ int __pthread_manager(void *arg)
   /* Block all signals except __pthread_sig_cancel and SIGTRAP */
   sigfillset(&mask);
   sigdelset(&mask, __pthread_sig_cancel); /* for thread termination */
-  if (__pthread_sig_debug > 0)
-    sigdelset(&mask, __pthread_sig_debug); /* for debugging purposes */
   sigdelset(&mask, SIGTRAP);            /* for debugging purposes */
   sigprocmask(SIG_SETMASK, &mask, NULL);
   /* Raise our priority to match that of main thread */
@@ -162,10 +160,10 @@ int __pthread_manager(void *arg)
         sem_post(request.req_args.post);
         break;
       case REQ_DEBUG:
-        /* Make gdb aware of new thread */
+        /* Make gdb aware of new thread and gdb will restart the
+	   new thread when it is ready to handle the new thread. */
 	if (__pthread_threads_debug && __pthread_sig_debug > 0)
 	  raise(__pthread_sig_debug);
-        restart(request.req_thread);
         break;
       }
     }
@@ -195,7 +193,7 @@ static int pthread_start_thread(void *ar
 			 THREAD_GETMEM(self, p_start_args.schedpolicy),
                          &self->p_start_args.schedparam);
   /* Make gdb aware of new thread */
-  if (__pthread_threads_debug) {
+  if (__pthread_threads_debug && __pthread_sig_debug > 0) {
     request.req_thread = self;
     request.req_kind = REQ_DEBUG;
     __libc_write(__pthread_manager_request,
Index: pthread.c
===================================================================
RCS file: /home/work/cvs/gnu/glibc/linuxthreads/pthread.c,v
retrieving revision 1.1.1.11
diff -u -p -r1.1.1.11 pthread.c
--- pthread.c	1999/01/30 23:57:11	1.1.1.11
+++ pthread.c	1999/02/03 14:43:03
@@ -309,7 +309,12 @@ int __pthread_initialize_manager(void)
   __pthread_manager_thread.p_pid = pid;
   /* Make gdb aware of new thread manager */
   if (__pthread_threads_debug && __pthread_sig_debug > 0)
-    raise(__pthread_sig_cancel);
+    {
+      raise(__pthread_sig_debug);
+      /* We suspend ourself and gdb will wake us up when it is
+	 ready to handle us. */
+      suspend(thread_self());
+    }
   /* Synchronize debugging of the thread manager */
   request.req_kind = REQ_DEBUG;
   __libc_write(__pthread_manager_request, (char *) &request, sizeof(request));


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]