From owner-freebsd-current Thu Jan 30 8:29:24 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B2A6837B401 for ; Thu, 30 Jan 2003 08:29:12 -0800 (PST) Received: from smtp.albany.edu (mail1.csc.albany.edu [169.226.1.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A00E43E4A for ; Thu, 30 Jan 2003 08:29:11 -0800 (PST) (envelope-from cd5697@albany.edu) Received: from xlnx-x.net (H162-79.EMPIRE-COMMONS.RESNET.ALBANY.EDU [169.226.162.79]) by smtp.albany.edu (8.12.5/8.12.5) with ESMTP id h0UGTAL7018582 for ; Thu, 30 Jan 2003 11:29:10 -0500 (EST) Received: from craig by xlnx-x.net with local (Exim 3.36 #1 (Debian)) id 18eHq6-0002Mo-00 for ; Thu, 30 Jan 2003 11:46:58 -0500 Date: Thu, 30 Jan 2003 11:46:58 -0500 To: freebsd-current@freebsd.org Subject: Recent current dies hard with simple program Message-ID: <20030130164658.GA9063@xlnx-x.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="RnlQjJ0d97Da+TV1" Content-Disposition: inline User-Agent: Mutt/1.5.3i From: Craig Dooley X-Scanned-By: MIMEDefang 2.28 (www . roaringpenguin . com / mimedefang) Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Last cvsup/world/kernel is from around midnight last night, but noticed the problem yesterday. For a csi class I have to sort and uniq a file in c, and as a test case, I wrote a simple hex dump that respects newlines. No matter what I give it as input, it will hard crash the system. No DDB, no panic, just hard locked. When trying to run it under GDB, break on main, as soon as I type run, it dies again. Im writing it on the same machine with much more significant programs running absolutely perfectly. I'm attaching the source to see if it's a common problem with anyone else. FreeBSD broken.xlnx-x.net 5.0-CURRENT FreeBSD 5.0-CURRENT #8: Thu Jan 30 01:01:45 EST 2003 craig@broken.xlnx-x.net:/usr/obj/usr/src/sys/BROKEN i386 -Craig Dooley --RnlQjJ0d97Da+TV1 Content-Type: text/x-csrc; charset=us-ascii Content-Disposition: attachment; filename="myhd.c" #include #include #include #include #include #include unsigned char *read_file(char *filename, int *length); int main(int argc, char **argv) { unsigned char *buffer; unsigned char *curr; unsigned char *end; int length; if(argc != 2) { printf("Usage: %s \n", argv[0]); exit(1); } buffer = read_file(argv[1], &length); curr = buffer; end = buffer + length; while(curr < end) { if(*curr == '\n') { printf("\n"); } else { printf("%x", *curr); } curr++; } return(0); } unsigned char *read_file(char *filename, int *length) { struct stat stat; int fd; int size; int nread = 0; unsigned char *buffer; /* Open the file */ if((fd = open(filename, O_RDONLY))== -1) { printf("Failure opening %s for reading\n", filename); exit(1); } /* Find the size */ if((fstat(fd, &stat)) == -1) { printf("Failure in fstat\n"); exit(1); } /* Allocate the buffer */ if((buffer = malloc(stat.st_size + 1)) == NULL) { printf("Failure to malloc %d bytes\n", (int) stat.st_size); exit(1); } /* Read it in */ while(nread != stat.st_size) { size = read(fd, buffer+nread, stat.st_size - nread); nread += size; } /* Terminate with a newline */ *(buffer + stat.st_size) = '\n'; /* Clean up and return */ close(fd); *length = (stat.st_size + 1); return(buffer); } --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="dmesg.boot" Copyright (c) 1992-2003 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 5.0-CURRENT #8: Thu Jan 30 01:01:45 EST 2003 craig@broken.xlnx-x.net:/usr/obj/usr/src/sys/BROKEN Preloaded elf kernel "/boot/kernel/kernel" at 0xc058d000. Preloaded elf module "/boot/kernel/bktr.ko" at 0xc058d0a8. Preloaded elf module "/boot/kernel/bktr_mem.ko" at 0xc058d154. Preloaded elf module "/boot/kernel/acpi.ko" at 0xc058d204. Timecounter "i8254" frequency 1193182 Hz Timecounter "TSC" frequency 1000042764 Hz CPU: AMD Athlon(tm) Processor (1000.04-MHz 686-class CPU) Origin = "AuthenticAMD" Id = 0x642 Stepping = 2 Features=0x183f9ff AMD Features=0xc0440000 real memory = 805240832 (767 MB) avail memory = 776249344 (740 MB) bktr_mem: memory holder loaded Initializing GEOMetry subsystem Pentium Pro MTRR support enabled npx0: on motherboard npx0: INT 16 interface acpi0: on motherboard ACPI-0625: *** Info: GPE Block0 defined as GPE0 to GPE15 Using $PIR table, 9 entries at 0xc00fde50 acpi0: power button is handled as a fixed feature programming model. Timecounter "ACPI-fast" frequency 3579545 Hz acpi_timer0: <24-bit timer at 3.579545MHz> port 0x4008-0x400b on acpi0 acpi_cpu0: port 0x530-0x537 on acpi0 acpi_button0: on acpi0 acpi_button1: on acpi0 pcib0: port 0x6000-0x607f,0x5000-0x500f,0x4080-0x40ff,0x4000-0x407f,0xcf8-0xcff on acpi0 pci0: on pcib0 agp0: mem 0xd8000000-0xdbffffff at device 0.0 on pci0 pcib1: at device 1.0 on pci0 pci1: on pcib1 pci1: at device 0.0 (no driver attached) isab0: at device 7.0 on pci0 isa0: on isab0 atapci0: port 0xd000-0xd00f at device 7.1 on pci0 atapci0: Correcting VIA config for southbridge data corruption bug ata0: at 0x1f0 irq 14 on atapci0 ata1: at 0x170 irq 15 on atapci0 uhci0: port 0xd400-0xd41f irq 5 at device 7.2 on pci0 usb0: on uhci0 usb0: USB revision 1.0 uhub0: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 2 ports with 2 removable, self powered uhub0: port error, restarting port 1 uhub0: port error, giving up port 1 ums0: Microsoft Microsoft IntelliMouse\M-. Explorer, rev 1.10/1.07, addr 2, iclass 3/1 ums0: 5 buttons and Z dir. uhub0: port error, restarting port 2 uhub0: port error, giving up port 2 uhub1: Texas Instruments UT-USB41 hub, class 9/0, rev 1.10/1.10, addr 3 uhub1: 4 ports with 4 removable, self powered uhci1: port 0xd800-0xd81f irq 5 at device 7.3 on pci0 usb1: on uhci1 usb1: USB revision 1.0 uhub2: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub2: 2 ports with 2 removable, self powered uhub2: port error, restarting port 1 uhub2: port error, giving up port 1 uhub2: port error, restarting port 2 uhub2: port error, giving up port 2 bktr0: mem 0xdf021000-0xdf021fff irq 5 at device 8.0 on pci0 bktr0: Hauppauge Model 44371 B123 bktr0: Detected a MSP3435G-B6 at 0x80 bktr0: Hauppauge WinCast/TV, Philips FR1236 NTSC FM tuner, msp3400c stereo, remote control. pci0: at device 8.1 (no driver attached) ahc0: port 0xdc00-0xdcff mem 0xdf020000-0xdf020fff irq 11 at device 9.0 on pci0 aic7890/91: Ultra2 Wide Channel A, SCSI Id=7, 32/253 SCBs pcm0: port 0xe000-0xe01f irq 10 at device 13.0 on pci0 fxp0: port 0xe800-0xe83f mem 0xdf000000-0xdf01ffff,0xdf022000-0xdf022fff irq 10 at device 15.0 on pci0 fxp0: Ethernet address 00:02:b3:46:6e:5d inphy0: on miibus0 inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto sio0 port 0x3f8-0x3ff irq 4 on acpi0 sio0: type 16550A sio1 port 0x2f8-0x2ff irq 3 on acpi0 sio1: type 16550A atkbdc0: port 0x64,0x60 irq 1 on acpi0 atkbd0: flags 0x1 irq 1 on atkbdc0 kbd0 at atkbd0 orm0: