[ 2.0.31-PRE10 EXIT.C BUG ]

Dan Hollis (goemon@sasami.anime.net)
Mon, 13 Oct 1997 21:53:56 -0700 (PDT)


There seems to be some bad bug in 2.0.31-pre10. There is some condition
in exit.c close_files() that corrupts filedescriptors, causing OOPSes,
quite often with threaded programs.

Ingo Molnar made a patch to reveal this bug, but as yet nobody has
submitted a fix. The patch to detect it is below:

--- exit.c.old Tue Sep 23 00:10:59 1997
+++ exit.c Mon Oct 13 21:48:09 1997
@@ -390,10 +390,18 @@
}
}

+#include <linux/kernel_stat.h>
+#define NOSCHEDULE_ON() int __curr_ctx = kstat.context_swtch;
+#define NOSCHEDULE_OFF() if (__curr_ctx != kstat.context_swtch) \
+ printk("Hey! illegal scheduling at: %d:%s.\n", \
+ __LINE__,__FILE__);
+
static inline void close_files(struct files_struct * files)
{
int i, j;

+ NOSCHEDULE_ON();
+
j = 0;
for (;;) {
unsigned long set = files->open_fds.fds_bits[j];
@@ -408,6 +416,8 @@
set >>= 1;
}
}
+
+ NOSCHEDULE_OFF();
}

static inline void __exit_files(struct task_struct *tsk)

-Dan