Re: 2.1.65: file table overflow

Brian Beaudoin (baddog@darkknight.net)
Mon, 24 Nov 1997 22:36:18 -0500


Linux users,

Apologies for my last post. It was premature. The cause of the problem
appeared to be because of an unofficial patch to allow the console
"beep" to be captured by a separate module.

I have included more details below, however this is starting to appear
to me that it's become off-topic.

The author of the patch, John Gotts (jgotts@engin.umich.edu) has been
contacted, and he doesn't understand why the patch would cause the
problem I experienced. I don't either.

While I am satisfied that this is now a non-issue with the kernel
itself, I am wonder why this patch caused problems. This isn't
pressing, but I've included some additional information and a copy of
the patch in case someone was curious and wanted to check it out.

Brian Beaudoin
baddog@darkknight.net

**********
It concerned me that the "file table overflow" errors started only after
upgrading the kernel. I hadn't even come to within 50% of the max file
limit or the inode limit, although thanks to all of the people who
suggested that.

Instead, it appeared to have been caused by an unofficial patch designed
to allow the console "beep" to be intercepted by a kernel module.

I've also contacted the author of the patch, and he says that the
SoftOSS has a few bugs, but I didn't have that enabled. The problem
does not depend on whether or not the associated module is loaded. I am
stumped.

Here's the patch that broke things, originally against 2.1.43 but seems
to go fine against 2.1.65. The entire package is at:

http://sunsite.unc.edu/pub/Linux/apps/sound/oplbeep-2.1.tar.gz

The patch itself doesn't require a sound card or the kernel module, and
I don't see that it would affect anything badly. It seems odd to me
though, and if you have a burning desire to look into it, I would love
to hear why it wigged things out while I was running X and recompiling
the kernel.

Note, the changes were already in the running kernel before the problem
started. That's partly why I didn't associate it right away. I had
just upgraded the day before.

Usually, I have a lot of things running at once. The first time the
problem occurred, I was using Netscape, IRC, GIMP, and several X-Terms.
The system crashed and I blamed it on the max-files. I rebooted and
compiled again, this time with only X and an X-Term. Crashed again with
"file table overflow".

Unloaded the patch, compiled again without X running, no problem.
Rebooted, compiled again with all my apps loaded, no problem. I've used
the patch a few times over the past two years, never had that problem.
Patch is attached below.

--- linux/kernel/ksyms.c.orig Mon Jan 6 04:44:35 1997
+++ linux/kernel/ksyms.c Mon Jan 6 04:52:15 1997
@@ -83,6 +83,9 @@

extern void hard_reset_now(void);

+extern void (*kd_nosound)(unsigned long ignored);
+extern void (*kd_mksound)(unsigned int count, unsigned int ticks);
+
#ifdef MODVERSIONS
const struct module_symbol __export_Using_Versions
__attribute__((section("__ksymtab"))) = {
@@ -303,6 +306,8 @@
EXPORT_SYMBOL(sys_call_table);
EXPORT_SYMBOL(hard_reset_now);
EXPORT_SYMBOL(_ctype);
+EXPORT_SYMBOL(kd_nosound);
+EXPORT_SYMBOL(kd_mksound);
EXPORT_SYMBOL(secure_tcp_sequence_number);

/* Signal interfaces */
--- linux/drivers/char/vt.c.orig Mon Jan 6 04:45:44 1997
+++ linux/drivers/char/vt.c Mon Jan 6 04:47:08 1997
@@ -148,18 +148,20 @@
* comments - KDMKTONE doesn't put the process to sleep.
*/
static void
-kd_nosound(unsigned long ignored)
+_kd_nosound(unsigned long ignored)
{
/* disable counter 2 */
outb(inb_p(0x61)&0xFC, 0x61);
return;
}

-void
+void (*kd_nosound)(unsigned long ignored) = _kd_nosound;
+
+static void
_kd_mksound(unsigned int hz, unsigned int ticks)
{
static struct timer_list sound_timer = { NULL, NULL, 0, 0,
- kd_nosound };
+ _kd_nosound };

unsigned int count = 0;

--- linux/include/linux/vt_kern.h.orig Mon Jan 6 04:47:45 1997
+++ linux/include/linux/vt_kern.h Mon Jan 6 04:48:29 1997
@@ -30,7 +30,7 @@
struct wait_queue *paste_wait;
} *vt_cons[MAX_NR_CONSOLES];

-void (*kd_mksound)(unsigned int hz, unsigned int ticks);
+extern void (*kd_mksound)(unsigned int hz, unsigned int ticks);
int vc_allocate(unsigned int console);
int vc_cons_allocated(unsigned int console);
int vc_resize(unsigned long lines, unsigned long cols);