From owner-freebsd-ports Sat Aug 1 08:11:36 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA19048 for freebsd-ports-outgoing; Sat, 1 Aug 1998 08:11:36 -0700 (PDT) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: from naur.cs.wvu.edu (naur.csee.wvu.edu [157.182.194.28]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA19043 for ; Sat, 1 Aug 1998 08:11:35 -0700 (PDT) (envelope-from dfrasnel@csee.wvu.edu) Received: (from dfrasnel@localhost) by naur.cs.wvu.edu (8.9.0/8.9.0) id LAA28771; Sat, 1 Aug 1998 11:09:55 -0400 (EDT) From: Daniel Frasnelli Message-Id: <199808011509.LAA28771@naur.cs.wvu.edu> Subject: Re: KnightCap dumps core while searching hash table To: gljohns@bellsouth.net (Glenn Johnson) Date: Sat, 1 Aug 1998 11:09:54 -0400 (EDT) Cc: freebsd-ports@FreeBSD.ORG In-Reply-To: <199808010401.XAA14122@gforce.bellsouth.net> from Glenn Johnson at "Jul 31, 98 11:01:02 pm" X-Mailer: ELM [version 2.4ME+ PL15 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Greetings, I ran a bit of debugging on KnightCap this morning, and discovered what causes the segfault (and the coredump most likely). Here are the applicable lines from the ktrace/kdump: 409 KnightCap GIO fd 3 wrote 125 bytes "B: -0.21 d=5 n=3581 c=14% q=16% ext=11% trunc=7% mo=83.33% 6.06% 2.27% 0.76% 6.82% hash=11% bad=0% mtd=6 t=0.6 d7d5 nps=7592 " 409 KnightCap RET write 125/0x7d 409 KnightCap CALL open(0x159a0,0x601,0x1b6) 409 KnightCap NAMI "/export/pasiphae/status.txt" 409 KnightCap RET open -1 errno 2 No such file or directory 409 KnightCap PSIG SIGSEGV SIG_DFL As you can see, the lack of a file (/export/pasiphae/status.txt) caused the generation of a segmentation violation. Here are the applicable files and line numbers in the source code: log.c:71: sfile = fopen("/export/pasiphae/status.txt","w"); util.c:742: f = fopen("/export/pasiphae/position.txt", "w"); util.c:769: bullet = fopen("/export/pasiphae/bullet.txt", "a"); util.c:770: blitz = fopen("/export/pasiphae/blitz.txt", "a"); util.c:771: standard = fopen("/export/pasiphae/standard.txt", "a" Technically, these files are only supposed to exist if USE_APPLET is defined (From log.c): #if USE_APPLET sfile = fopen("/export/pasiphae/status.txt","w"); #else sfile = fopen("status.txt","w"); #endif USE_APPLET is defined on line 30 of knightcap.h: 30:#define USE_APPLET 1 This needs to be set to zero, and the package recompiled. I just did so, and it works fine now. If anyone wants to create a patchset or add a delta to one of the current patches, feel free; I'm interested in seeing what USE_APPLET does in the rest of the code before disabling it (in the port). Best regards, Daniel To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message