Subject: Re: process hangs in exit while trying to release its memory.
To: None <hibler@cs.utah.edu, jtk@kolvir.arlington.ma.us, port-i386@NetBSD.ORG>
From: Mike Hibler <mike@fast.cs.utah.edu>
List: port-i386
Date: 03/07/1996 16:07:34
> Date: Wed, 6 Mar 1996 23:45:28 -0500 (EST)
> From: John Kohl <jtk@kolvir.arlington.ma.us>
> To: port-i386@netbsd.org, hibler@cs
> Subject: process hangs in exit while trying to release its memory.
> 
> I think I found a neat way to hang a process in exit.  This process
> (dosemu) opens /proc/curproc/mem to rearrange its own memory address
> space (gross, eh?)
> 
> Anyway, when it exits, it sits in thrd_sleep:
> load: 0.16  cmd: dosstatic 232 [thrd_sleep] 8.90u 12.51s 0% 1024k
> 
> A stack trace from ddb is shown below.
> (procfs_validfpregs is really procfs_rwmem; static symbols are not shown)
> The vm_map was locked for write by vm_map_remove(), and now wants to be
> locked for read by vm_map_lookup() inside procfs.
> 
> Presumably one solution is "don't do that";  I'd prefer an answer that
> doesn't make me rewrite some of dosemu's code.
> ...
> 
A quick hack, whose implications I have not really considered, would be
to do a lock_set_recursive on the map lock in procfs_rwmem.  I suspect this
might be a Bad Thing, maybe not for your particular case, but in general.