From owner-freebsd-hackers Tue Jun 8 9: 3:11 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp2.vnet.net (smtp2.vnet.net [166.82.1.32]) by hub.freebsd.org (Postfix) with ESMTP id 035F915398 for ; Tue, 8 Jun 1999 09:03:08 -0700 (PDT) (envelope-from rivers@dignus.com) Received: from dignus.com (ponds.vnet.net [166.82.177.48]) by smtp2.vnet.net (8.9.1a/8.9.1) with ESMTP id MAA18589; Tue, 8 Jun 1999 12:03:50 -0400 (EDT) Received: from lakes.dignus.com (lakes.dignus.com [10.0.0.3]) by dignus.com (8.9.2/8.8.5) with ESMTP id MAA18651; Tue, 8 Jun 1999 12:03:03 -0400 (EDT) Received: (from rivers@localhost) by lakes.dignus.com (8.9.2/8.6.9) id MAA07762; Tue, 8 Jun 1999 12:03:03 -0400 (EDT) Date: Tue, 8 Jun 1999 12:03:03 -0400 (EDT) From: Thomas David Rivers Message-Id: <199906081603.MAA07762@lakes.dignus.com> To: joe@pavilion.net, rivers@dignus.com Subject: Re: Wierd behavour from G++28! Cc: hackers@FreeBSD.ORG In-Reply-To: <19990608165022.B64790@pavilion.net> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > On Tue, Jun 08, 1999 at 10:45:39AM -0400, Thomas David Rivers wrote: > > > (gdb) bt > > > #0 0x8052c0f in ostream::flush () at /usr/include/ctype.h:149 > > > #1 0x8052912 in ostream::operator<< () at /usr/include/ctype.h:149 > > > #2 0x804995f in main (argc=1, argv=0xbfbfdb54) at search.c:219 > > > (gdb) l > > > > > > Or - it could be that the stream wasn't properly opened and no-one > > checked for it... > > > > Look at line 219 in search.c, it should be a <<-operator operating > > on a stream of some kind. Then, find where that stream is > > declared/constructed and ensure everything is all right... > > 216 file_vector the_index( index_file_name ); > 217 if ( !the_index ) { > 218 cerr << me << ": could not read index from " > 219 << index_file_name << endl; > 220 ::exit( 2 ); > 221 } > > > (gdb) break 218 > Breakpoint 1 at 0x8049941: file search.c, line 218. > (gdb) run > Starting program: /data/home/joe/src/swish/swish++-2.0/search > > Breakpoint 1, main (argc=1, argv=0xbfbfdb14) at search.c:219 > 219 << index_file_name << endl; > (gdb) print index_file_name > $1 = 0x806bfe2 "the.index" > (gdb) print me > $2 = 0xbfbfdc35 "search" > (gdb) print cerr > $3 = 134671820 > (gdb) print endl > $4 = {} 0x8052d20 > (gdb) s > 0x80528ed in ostream::operator<< () at /usr/include/ctype.h:149 > 149 } > (gdb) s > > Program received signal SIGSEGV, Segmentation fault. > 0x8052c0f in ostream::flush () at /usr/include/ctype.h:149 > 149 } > > Is it because the program's compiled using the wrong includes? > (/usr/include/ctype.h && /usr/local/bin/g++28) I was guessing that the stream may be wrong - but cerr is likely correctly constructed... You may have mixed up the libraries somehow when you linked... but I'll have to defer that to someone who's used gcc2.8... - Dave Rivers - To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message