Increase DFLDSIZ on amd64?

Konstantin Belousov kostikbel at gmail.com
Fri Apr 20 18:55:52 UTC 2012


On Fri, Apr 20, 2012 at 08:47:45PM +0200, Robert Millan wrote:
> Hi Peter,
> 
> El 19 d???abril de 2012 0:23, Peter Wemm <peter at wemm.org> ha escrit:
> > Hmm.  In login,conf, we have:
> > :datasize=unlimited:
> > .. which causes the datasize limit to be pushed to 32G by default at
> > login/cron/sshd/etc.
> 
> Well, Debian has a similar facility, but I don't think this solves the
> problem, as it only covers processes that descend from a login shell.
> What about daemons?
> 
> > Also, malloc doesn't use this pool on amd64 - it comes straight out of
> > mmap MAP_ANON page blocks.  The only that should be hitting it ever
> > would be things that call the old sbrk(3) interface directly.  Malloc
> > shouldn't be hitting it.
> 
> I hit trouble with the dynamic linker:
> 
> # cat test.c
> char buf[1024*1024*1024];
> int
> main ()
> {
> }
> # gcc test.c -o test
> # ./test
> Abort trap: 6
> 
> Not sure about other things but IMHO it's a valid reason to increase
> the default to match with the one set by userland.

Just for record, this is not an issue with dynamic linker.
Kernel image activator returns error if data segment size is larger
then RLIMIT_DATA value, see imgact_elf.c:901.

Then, since the address space of the program which called execve(2)
is already destroyed when segment mapping is performed, kernel has no
other choice and kills the process.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20120420/df6d5d25/attachment.pgp


More information about the freebsd-arch mailing list