[patch][diag][rfc] Bugasaurus REX

From: Mike Galbraith (mikeg@weiden.de)
Date: Thu Apr 27 2000 - 01:00:19 EST


Greetings,

'scuse me a sec..
[Dear God, _please_ don't let that first chunk be an IKD bug.]

Try this patch if you want to see the critter. I'm not going to
provide any details.. I start babbling when I try ;-) I will say
that protecting sem_exit() with task_lock() helps a lot. (If you
run full IKD, you see more symptoms than you can shake a stick at)

If anyone does try this, be warned that fsck becomes quite irate over
disconnected inodes. It's no big deal.. only /var/run pids&socs and
sometimes /etc/ld.so.cache. Nothing serious has happened here in
many many many fsck runs, but YMMV applies.

I have made no progress to date.. but have done many things which
move symptoms around. (trust me, you don't want to hear it)

        -Mike

--- linux-2.3.99-pre6-7.virgin/mm/slab.c.org Thu Apr 27 07:17:39 2000
+++ linux-2.3.99-pre6-7.virgin/mm/slab.c Thu Apr 27 07:23:15 2000
@@ -682,6 +682,9 @@
         size_t left_over;
         size_t align;
 
+#if SLAB_DEBUG_SUPPORT
+ flags |= SLAB_POISON;
+#endif
         /* Sanity checks... */
 #if SLAB_MGMT_CHECKS
         if (!name) {
--- linux-2.3.99-pre6-7.virgin/arch/i386/kernel/semaphore.c.org Thu Apr 27 08:01:04 2000
+++ linux-2.3.99-pre6-7.virgin/arch/i386/kernel/semaphore.c Thu Apr 27 08:07:13 2000
@@ -55,13 +55,23 @@
 
 static spinlock_t semaphore_lock = SPIN_LOCK_UNLOCKED;
 
+static void generate_oops (struct semaphore *sem)
+{
+ atomic_set (&sem->count, 9876);
+ wake_up (&sem->wait);
+}
+
 void __down(struct semaphore * sem)
 {
+ struct timer_list timer;
         struct task_struct *tsk = current;
         DECLARE_WAITQUEUE(wait, tsk);
         tsk->state = TASK_UNINTERRUPTIBLE|TASK_EXCLUSIVE;
         add_wait_queue_exclusive(&sem->wait, &wait);
 
+ init_timer (&timer);
+ timer.data = (unsigned long) sem;
+ timer.function = (void (*)(unsigned long)) generate_oops;
         spin_lock_irq(&semaphore_lock);
         sem->sleepers++;
         for (;;) {
@@ -78,7 +88,12 @@
                 sem->sleepers = 1; /* us - see -1 above */
                 spin_unlock_irq(&semaphore_lock);
 
+ timer.expires = jiffies + HZ*20;
+ add_timer (&timer);
                 schedule();
+ if (atomic_read (&sem->count) == 9876)
+ BUG();
+ del_timer (&timer);
                 tsk->state = TASK_UNINTERRUPTIBLE|TASK_EXCLUSIVE;
                 spin_lock_irq(&semaphore_lock);
         }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 30 2000 - 21:00:12 EST