[Fix-2.2.15] maestro.c and traps.c

From: Willy Tarreau (willy@novworld.Novecom.Fr)
Date: Sun Apr 16 2000 - 15:44:17 EST


Hi Alan,

May be you have tons of emails or simply don't have time to
read the 2 last I sent to you. That doesn't matter, but they
contained a bug fix for the maestro driver, and corrected a
"feature" (it was not really a bug) in i386/kernel/traps.c

I hope you'll have time to include them before Linus blesses
the 2.2.15 and releases the final one.

Just quickly, these two patches apply to 2.2.15pre17/18. I think
there won't be any problem with 2.2.15pre19.

The little bug in the maestro driver which prevents the kernel
from rebooting if the module has not been able to load at
least once due to an IRQ problem. In this case, the driver
doesn't register from the list of reboot_notifiers.

The second one is to avoid the oopser from looping when EIP or
ESP are obviously invalid. This now helps to read messages
on the screen or to dump them on a floppy.

Here they come attached and in ASCII form.

Thanks for your reading,

Willy

-------- maestro.c --------

--- maestro.c-bug Tue Apr 4 17:30:18 2000
+++ maestro.c Tue Apr 4 17:30:50 2000
@@ -3443,6 +3443,7 @@
                                 unregister_sound_dsp(s->dev_audio);
                 }
                 release_region(card->iobase, 256);
+ unregister_reboot_notifier(&maestro_nb);
                 kfree(card);
                 return 0;
         }

--------- traps.c -------

--- linux-2.2.15/arch/i386/kernel/traps.c Tue Feb 16 23:20:05 1999
+++ linux/arch/i386/kernel/traps.c Tue Apr 4 10:17:09 2000
@@ -162,33 +162,41 @@
                         printk("%08lx ", *stack++);
                 }
                 printk("\nCall Trace: ");
- stack = (unsigned long *) esp;
- i = 1;
- module_start = PAGE_OFFSET + (max_mapnr << PAGE_SHIFT);
- module_start = ((module_start + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1));
- module_end = module_start + MODULE_RANGE;
- while (((long) stack & 4095) != 0) {
- addr = *stack++;
- /*
- * If the address is either in the text segment of the
- * kernel, or in the region which contains vmalloc'ed
- * memory, it *may* be the address of a calling
- * routine; if so, print it so that someone tracing
- * down the cause of the crash will be able to figure
- * out the call path that was taken.
- */
- if (((addr >= (unsigned long) &_stext) &&
- (addr <= (unsigned long) &_etext)) ||
- ((addr >= module_start) && (addr <= module_end))) {
- if (i && ((i % 8) == 0))
- printk("\n ");
- printk("[<%08lx>] ", addr);
- i++;
+ if (!esp || (esp & 3))
+ printk("<INVALID ESP!>");
+ else {
+ stack = (unsigned long *) esp;
+ i = 1;
+ module_start = PAGE_OFFSET + (max_mapnr << PAGE_SHIFT);
+ module_start = ((module_start + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1));
+ module_end = module_start + MODULE_RANGE;
+ while (((long) stack & 4095) != 0) {
+ addr = *stack++;
+ /*
+ * If the address is either in the text segment of the
+ * kernel, or in the region which contains vmalloc'ed
+ * memory, it *may* be the address of a calling
+ * routine; if so, print it so that someone tracing
+ * down the cause of the crash will be able to figure
+ * out the call path that was taken.
+ */
+ if (((addr >= (unsigned long) &_stext) &&
+ (addr <= (unsigned long) &_etext)) ||
+ ((addr >= module_start) && (addr <= module_end))) {
+ if (i && ((i % 8) == 0))
+ printk("\n ");
+ printk("[<%08lx>] ", addr);
+ i++;
+ }
                         }
                 }
                 printk("\nCode: ");
- for(i=0;i<20;i++)
+ if (!regs->eip || regs->eip==-1)
+ printk("<INVALID EIP!>");
+ else {
+ for(i=0;i<20;i++)
                         printk("%02x ", ((unsigned char *)regs->eip)[i]);
+ }
         }
         printk("\n");
 }





-
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 23 2000 - 21:00:09 EST