From 655ec332a714d3e5cc6aace798daf832e17e001e Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 14 Jul 2014 06:02:21 +0200 Subject: devproc: fix proccrlmemio bugs dont kill the calling process when demand load fails if fixfault() is called from devproc. this happens when you delete the binary of a running process and try to debug the process accessing uncached pages thru /proc/$pid/mem file. fixes to procctlmemio(): - fix missed unlock as txt2data() can error - make sure the segment isnt freed by taking a reference (under p->seglock) - access the page with segment locked (see comment) - get rid of the segment stealer lock other stuff: - move txt2data() and data2txt() to segment.c - add procpagecount() function - make return type mcounseg() to ulong --- sys/src/9/port/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/src/9/port/proc.c') diff --git a/sys/src/9/port/proc.c b/sys/src/9/port/proc.c index bd152c4c8..58fbc7a8b 100644 --- a/sys/src/9/port/proc.c +++ b/sys/src/9/port/proc.c @@ -1510,7 +1510,7 @@ killbig(char *why) s = p->seg[i]; if(s == nil || !canqlock(s)) continue; - l += (ulong)mcountseg(s); + l += mcountseg(s); qunlock(s); } qunlock(&p->seglock); -- cgit v1.2.3