From owner-cvs-all Mon Dec 16 13: 8: 6 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 02DDC37B401; Mon, 16 Dec 2002 13:08:05 -0800 (PST) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9BB4643EC2; Mon, 16 Dec 2002 13:08:04 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.5/8.12.5) with ESMTP id gBGL84OM081108; Mon, 16 Dec 2002 13:08:04 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.5/8.12.5/Submit) id gBGL845M081107; Mon, 16 Dec 2002 13:08:04 -0800 (PST) (envelope-from dillon) Date: Mon, 16 Dec 2002 13:08:04 -0800 (PST) From: Matthew Dillon Message-Id: <200212162108.gBGL845M081107@apollo.backplane.com> To: Alfred Perlstein Cc: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/vm vm.h src/sys/kern imgact_elf.c src/libexec/rtld-elf map_object.c References: <200212161924.gBGJOhSb048310@repoman.freebsd.org> <20021216205849.GV23663@elvis.mu.org> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG :> Certain applications which map large amounts of read-only data will :> produce much larger cores. A new sysctl has been added, :> debug.elf_legacy_coredump, which will revert to the old behavior. :> :> This commit represents collaborative work by all parties involved. :> The PR contains a program demonstrating the problem. : :Wouldn't it make sense to automagically OR in NOCORE when calling mmap :for readonly, but when madvise is called _then_ turn off NOCORE? : :-- :-Alfred Perlstein [alfred@freebsd.org] Well, that would maintain legacy operation but I don't think it is what we want from the viewpoint of the mmap() API. In general, the idea of having a core file is so you can run gdb on it and there is nothing particularly special about mmap()ing read-only data. The only reason we set NOCORE for the program text is because, of course, the debugger has access to the program text separately. But the debugger does not have access to generally mmap()'d areas of memory unless we dump them. There have been many occassions going as far back as I can remember when I've tried to debug a program and the debugger couldn't access data the program was accessing because it happened to be mapped read-only. There were many occassions when I was debugging Diablo or BestWWWD (back in the BEST days), for example. In fact, now that I think about, most of my larger projects use read-only mmap()'s heavily. Programs use mmap() far more often now, especially read-only mmap()'s to access things like, oh, configuration files, so I think we want the default to include those in core dumps. -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message