Date: Mon, 16 Dec 2002 13:08:04 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: Alfred Perlstein <bright@mu.org> 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 Message-ID: <200212162108.gBGL845M081107@apollo.backplane.com> References: <200212161924.gBGJOhSb048310@repoman.freebsd.org> <20021216205849.GV23663@elvis.mu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
:> 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 <dillon@backplane.com> To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200212162108.gBGL845M081107>