Re: SIGABRT under load (tracked to vm_map_find() returning KERN_NO_SPACE)

From: David G. Lawrence <dg_at_dglawrence.com>
Date: Tue, 8 Mar 2005 13:17:30 -0800
> i.e. __elfN(load_section) is returning EINVAL.
> 
> I instrumented the three places this is possible in
> __elfN(load_section) and found the failure occurs here:
> 
>                 rv = vm_map_find(exec_map,

   Yeah, that's a bug. As Alan pointed out, exec_map is sized to limit the
total number of simultaneous execs to 16 in order to keep kernel memory
usage under control. You're hitting this size limit occasionally and the
code in imgact_elf.c isn't behaving correctly in this case (it should
block when there is no exec_map space).
   Unfortunately, I don't think you can use kmem_alloc_wait() to fix this
because the code relies on the mapping of the object page into the map, so
demand-zero space isn't what you want.
   A fix for this is going to need to vm_map_unlock_and_wait() and retry
in a loop like kmem_alloc_wait() does when there is no space. Patches left
as an exercise to the reader. :-)

-DG

David G. Lawrence
President
Download Technologies, Inc. - http://www.downloadtech.com - (866) 399 8500
TeraSolutions, Inc. - http://www.terasolutions.com - (888) 346 7175
The FreeBSD Project - http://www.freebsd.org
Pave the road of life with opportunities.
Received on Tue Mar 08 2005 - 20:17:33 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:29 UTC