KSE signals broken by 1:1 commit.
Jake Burkholder
jake at locore.ca
Sun Apr 6 21:53:01 PDT 2003
Apparently, On Sun, Apr 06, 2003 at 08:22:24PM -0700,
Julian Elischer said words to the effect of;
> I'm going to apply to core since jeff is absent, to have permission for
> us to fix it and possibly break 1:1 (*). I specifically asked him to
> ensure
> that this didn't happen if he committed his changes and told him it
> looked as if it would.
>
> (*) I don't WANT to break 1:1 but we can't test it at the moment as it
> core-dumps so we have no way to see if we are breaking it :-(
Are any of you running an up to date kernel from after the lazy switch
changes? If you create a process with multiple threads you will get a
kernel panic in cpu_throw when the first one exits because thread_exit
and thr_exit both clear td_proc and cpu_throw uses td_proc now. A program
like this provokes it:
#include <pthread.h>
void *foo(void *);
int
main(void)
{
pthread_t thread;
void *ret;
if (pthread_create(&thread, NULL, foo, NULL) != 0)
err(1, NULL);
if (pthread_join(thread, &ret) != 0)
err(1, NULL);
return (0);
}
void *
foo(void *v)
{
printf("foo\n");
return (NULL);
}
This patch will allow you to run libthr apps to ensure that you don't
break them:
Index: kern/kern_thr.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/kern_thr.c,v
retrieving revision 1.3
diff -u -r1.3 kern_thr.c
--- kern/kern_thr.c 2 Apr 2003 23:53:29 -0000 1.3
+++ kern/kern_thr.c 6 Apr 2003 23:46:49 -0000
@@ -101,7 +101,9 @@
PROC_UNLOCK(p);
td->td_kse = NULL;
td->td_state = TDS_INACTIVE;
+#ifdef nolonger
td->td_proc = NULL;
+#endif
td->td_ksegrp = NULL;
td->td_last_kse = NULL;
thread_stash(td);
Index: kern/kern_thread.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/kern_thread.c,v
retrieving revision 1.112
diff -u -r1.112 kern_thread.c
--- kern/kern_thread.c 2 Apr 2003 23:53:29 -0000 1.112
+++ kern/kern_thread.c 6 Apr 2003 23:38:59 -0000
@@ -1242,7 +1242,9 @@
PROC_UNLOCK(p);
td->td_kse = NULL;
td->td_state = TDS_INACTIVE;
+#ifdef nolonger
td->td_proc = NULL;
+#endif
td->td_ksegrp = NULL;
td->td_last_kse = NULL;
PCPU_SET(deadthread, td);
I think this issue can wait 3 days until jeff gets back.
Jake
More information about the freebsd-threads
mailing list