From owner-freebsd-current Tue Oct 22 8:18:23 2002 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 7F26E37B401; Tue, 22 Oct 2002 08:18:21 -0700 (PDT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5D98943E42; Tue, 22 Oct 2002 08:18:20 -0700 (PDT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id LAA03972; Tue, 22 Oct 2002 11:18:14 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.6/8.9.1) id g9MFHiT07476; Tue, 22 Oct 2002 11:17:44 -0400 (EDT) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15797.27672.327091.966095@grasshopper.cs.duke.edu> Date: Tue, 22 Oct 2002 11:17:44 -0400 (EDT) To: Ruslan Ermilov Cc: Alexander Kabaev , "David O'Brien" , current@FreeBSD.org Subject: Re: Groff problems (was Re: alpha tinderbox failure) In-Reply-To: <20021022142929.GB48398@sunbay.com> References: <200210210942.g9L9gLpM025724@beast.freebsd.org> <15796.17145.909288.498725@grasshopper.cs.duke.edu> <20021022142929.GB48398@sunbay.com> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid 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 Ruslan Ermilov writes: > Well, I tried this on beast. It is easily reproduceable. > > It turned out that if you build groff with -DNO_CPU_CFLAGS > (the way it is built during the bootstrap-tools stage of > buildworld), it fails with the `out of memory' error in > contrib/groff/src/libs/libgroff/new.cc. To reproduce, it > is only necessary to build the following dirs, in order, > with -DNO_CPU_CFLAGS: > > gnu/usr.bin/groff/src/libs/libgroff > gnu/usr.bin/groff/src/roff/groff > > And then run groff from the latter as follows: > > groff -V > > More fun. Groff is built with -fno-rtti and -fno-exceptions: FWIW, the "out of memory" is because it is attempting to malloc a huge amount of ram. Apparently mistakenly: (gdb) break /usr/src/contrib/groff/src/libs/libgroff/new.cc:45 Breakpoint 1 at 0x12000c9cc: file /usr/src/contrib/groff/src/libs/libgroff/new.cc, line 45. (gdb) r Starting program: /usr/src/gnu/usr.bin/groff/src/roff/groff/groff Breakpoint 1, operator new(unsigned long) (size=4832141312) at /usr/src/contrib/groff/src/libs/libgroff/new.cc:45 45 if (p == 0) { (gdb) p/x size $1 = 0x12004a000 (gdb) Note that 0x12004a000 looks quite a bit like an address in the data segment. The stack looks like this (its happening before main is entered): (gdb) where #0 operator new(unsigned long) (size=4832141312) at /usr/src/contrib/groff/src/libs/libgroff/new.cc:45 #1 0x12000d528 in operator new[](unsigned long) () #2 0x12000c1ac in search_path (this=0x120035930, envvar=0x0, standard=0x12002b8b1 "/usr/share/groff_font", add_home=1,add_current=0) at /usr/src/contrib/groff/src/libs/libgroff/searchpath.cc:39 #3 0x12000aec4 in __static_initialization_and_destruction_0 ( __initialize_p=1, __priority=65535) at /usr/src/contrib/groff/src/libs/libgroff/fontfile.cc:34 #4 0x12000af30 in _GLOBAL__I__ZN4font3resE () at /usr/src/contrib/groff/src/libs/libgroff/fontfile.cc:34 #5 0x12002a0b8 in __do_global_ctors_aux () #6 0x120000150 in _init () #7 0x120000228 in _start () The code calling new is this bit of c++ code: (gdb) frame 2 #2 0x12000c1ac in search_path (this=0x120035930, envvar=0x0, standard=0x12002b8b1 "/usr/share/groff_font", add_home=1, add_current=0) at /usr/src/contrib/groff/src/libs/libgroff/searchpath.cc:39 39 dirs = new char[((e && *e) ? strlen(e) + 1 : 0) (gdb) l 34 if (add_home) 35 home = getenv("HOME"); 36 char *e = 0; 37 if (envvar) 38 e = getenv(envvar); 39 dirs = new char[((e && *e) ? strlen(e) + 1 : 0) 40 + (add_current ? 1 + 1 : 0) 41 + ((home && *home) ? strlen(home) + 1 : 0) 42 + ((standard && *standard) ? strlen(standard) : 0) 43 + 1]; I have no idea what 'e' is, gdb doesn't like things declared in the middle of a scope, apparently. Drew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message