Messages in this thread | | | Date | Sat, 19 Dec 1998 00:55:03 -0500 (EST) | From | George <> | Subject | Program to freeze keyboard in 2.1.131 |
| |
#include <stdio.h> #include <pthread.h>
#define NUM_THREADS 60
pthread_t teds[NUM_THREADS];
void *thread_run(void *data) { int x;
for (;;) printf("%d:%d ", pthread_self(), ++x); }
int main(void) { int i;
for (i = 0; i < NUM_THREADS; i++) pthread_create(&teds[i], NULL, thread_run, NULL);
for (;;) pause();
return 0; }
Compiled with egcs 1.1.1 and 'gcc -O2 -o spam spam.c -lpthread'
Now, just pick your favorite virtual terminal and run this program. It'll spit a bunch of numbers on the screen and shoot your load average up. Now just hold down ALT+D or CTRL+C, or any other key combination that will generate a lot of interrupts really fast. Watch the screen while holding the keys down for a few minutes or so, 10 should be enough in most cases to trigger the race.
Now let go of the keys and try to switch virtual consoles. If you were successful, you won't be able to. In fact, nothing on the keyboard will work of note except CTRL+ALT+DEL and ALT+SysRQ. It is still possible to use GPM to cut & paste commands and use the computer normally if you can find enough letters to paste in. After the keyboard goes south, everything else works just fine, including telnet sessions.
Tested with 2.1.131-ac11 SMP and 'init=/bin/sh' with a 'vmstat 1 > /dev/tty2' running in the background to give me something to attempt to switch to. Tyan Tomcat IV, dual Pentium 233 MMX, RAM and hard drive shouldn't matter in this test. Don't know if UP does it, but SMP does it enough to irritate me if I run a program that causes a lot of output. Previous kernels have done the same thing. AT keyboard and nothing otherwise PS/2 attached motherboard.
No modules loaded at 'init=/bin/sh' time, so here's the stuff compiled in:
CONFIG_EXPERIMENTAL=y CONFIG_M586=y CONFIG_SMP=y CONFIG_MODULES=y CONFIG_KMOD=y CONFIG_NET=y CONFIG_PCI=y CONFIG_PCI_BIOS=y CONFIG_PCI_DIRECT=y CONFIG_PCI_QUIRKS=y CONFIG_PCI_OPTIMIZE=y CONFIG_PCI_OLD_PROC=y CONFIG_SYSVIPC=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_SYSCTL=y CONFIG_BINFMT_ELF=y CONFIG_BLK_DEV_IDE=y CONFIG_BLK_DEV_IDEDISK=y CONFIG_BLK_DEV_IDEPCI=y CONFIG_BLK_DEV_IDEDMA=y CONFIG_IDEDMA_AUTO=y CONFIG_NETLINK=y CONFIG_RTNETLINK=y CONFIG_FIREWALL=y CONFIG_NET_ALIAS=y CONFIG_FILTER=y CONFIG_UNIX=y CONFIG_INET=y CONFIG_IP_ADVANCED_ROUTER=y CONFIG_RTNETLINK=y CONFIG_NETLINK=y CONFIG_IP_MULTIPLE_TABLES=y CONFIG_IP_ROUTE_MULTIPATH=y CONFIG_IP_ROUTE_TOS=y CONFIG_IP_ROUTE_VERBOSE=y CONFIG_IP_ROUTE_NAT=y CONFIG_IP_FIREWALL=y CONFIG_IP_ALWAYS_DEFRAG=y CONFIG_IP_MASQUERADE=y CONFIG_IP_MASQUERADE_ICMP=y CONFIG_IP_ALIAS=y CONFIG_SYN_COOKIES=y CONFIG_IP_NOSR=y CONFIG_SKB_LARGE=y CONFIG_NETDEVICES=y CONFIG_NET_ETHERNET=y CONFIG_NET_EISA=y CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_SERIAL=y CONFIG_RTC=y CONFIG_QUOTA=y CONFIG_EXT2_FS=y CONFIG_JOLIET=y CONFIG_PROC_FS=y CONFIG_SMB_WIN95=y CONFIG_NCPFS_NFS_NS=y CONFIG_NCPFS_OS2_NS=y CONFIG_NCPFS_MOUNT_SUBDIR=y CONFIG_NLS=y CONFIG_VGA_CONSOLE=y CONFIG_VIDEO_SELECT=y CONFIG_MAD16_OLDCARD=y CONFIG_MAGIC_SYSRQ=y
-George
- 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/
| |