From owner-freebsd-current@FreeBSD.ORG Sun Nov 23 15:11:41 2003 Return-Path: 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 2072216A4CE for ; Sun, 23 Nov 2003 15:11:41 -0800 (PST) Received: from solo.cs.vu.nl (solo.cs.vu.nl [130.37.24.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 35F4043FAF for ; Sun, 23 Nov 2003 15:11:40 -0800 (PST) (envelope-from ronald-freebsd3@klop.yi.org) Received: from henk.thuis.klop.ws (dyn01.dialup.cs.vu.nl [130.37.192.33]) by solo.cs.vu.nl with esmtp (Smail #87) id m1AO3OE-0009IlC; Mon, 24 Nov 2003 00:11 +0100 Date: Mon, 24 Nov 2003 00:11:35 +0100 To: FreeBSD Current From: Ronald Klop Content-Type: multipart/mixed; boundary=----------kRUvObaPkXInc1EH4xKhmp MIME-Version: 1.0 Message-ID: User-Agent: Opera7.21/FreeBSD M2 build 497 Subject: repeatable panic with truss X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Nov 2003 23:11:41 -0000 ------------kRUvObaPkXInc1EH4xKhmp Content-Type: text/plain; format=flowed; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hello, While running the next commands on the attached program I get a panic everytime. gcc rfk-smtpd.c truss ./a.out cat --panic-- Running 5.1-CURRENT from today. I did a 'make world' in a clean /usr/obj dir. System P-II 400Mhz UP, 256 MB, IDE, no acpi enabled. I hope somebody can repeat this and maybe it helps getting FreeBSD more and more stable. (Or maybe it's a known issue.) Ronald. PS: I don't have a debugger enabled kernel, so can't give any more output for now. But I'm willing to make one if it's needed. -- Ronald Klop Amsterdam, The Netherlands ------------kRUvObaPkXInc1EH4xKhmp Content-Disposition: attachment; filename=rfk-smtpd.c Content-Type: application/octet-stream; name=rfk-smtpd.c Content-Transfer-Encoding: 8bit #include #include #include #include #include #include #define TRUE (1) #define FALSE (0) #define BUF_SIZE 80 void showUsage() { fprintf(stderr, "Usage: rfk-smtpd []*\n"); } int process(char *buf, char *tmp) { if (strncmp(buf, "rcpt", 4) == 0) { strcpy(tmp, "553 Recipient is unknown.\r\n"); return FALSE; } return TRUE; } int doIt(char* prog) { FILE *smtpd; char buf[BUF_SIZE + 1]; fd_set fds; int go = TRUE; int error = FALSE; smtpd = popen(prog, "r+"); if (smtpd == NULL) { fprintf(stderr, "Cannot create process '%s'\n", prog); return FALSE; } while(go) { FD_ZERO(&fds); FD_SET(fileno(stdin), &fds); FD_SET(fileno(smtpd), &fds); int res = select(FD_SETSIZE, &fds, NULL, NULL, NULL); if (res == -1) { fprintf(stderr, "Select: error.\n"); error = TRUE; go = FALSE; } if (res == 0) { fprintf(stderr, "Select: timeout.\n"); } while(!error && res--) { size_t nr; if (FD_ISSET(fileno(stdin), &fds)) { nr = read(fileno(stdin), buf, BUF_SIZE); if (nr <= 0) { error = TRUE; go = FALSE; } else { char tmp[BUF_SIZE + 1]; int ok; buf[nr] = '\0'; ok = process(buf, tmp); if (ok) { fprintf(smtpd, "%s", buf); fflush(smtpd); } else { fprintf(stdout, "%s", tmp); fflush(stdout); } } } if (FD_ISSET(fileno(smtpd), &fds)) { nr = read(fileno(smtpd), buf, BUF_SIZE); if (nr <= 0) { error = TRUE; go = FALSE; } else { buf[nr] = '\0'; fprintf(stdout, "%s", buf); fflush(stdout); } } } } pclose(smtpd); return !error; } int main(int argc, char **argv) { char prog[1024]; int error; int i, ind; if (argc < 2) { showUsage(); return 1; } ind = 0; strcpy(&prog[ind], argv[1]); ind = strlen(argv[1]); for(i = 2; i < argc; i++) { prog[ind++] = ' '; strcpy(&prog[ind], argv[i]); ind += strlen(argv[i]); } error = !doIt(prog); return error; } ------------kRUvObaPkXInc1EH4xKhmp--