Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Aug 2015 10:37:00 +0200
From:      Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= <trasz@FreeBSD.org>
To:        Larry Rosenman <ler@lerctr.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: racct crash/Linux Emulation
Message-ID:  <20150824083700.GA1253@brick.home>
In-Reply-To: <20150824012857.GA6409@borg.lerctr.org>
References:  <20150824012857.GA6409@borg.lerctr.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 0823T2028, Larry Rosenman wrote:
> got the below panio, on a linux (world community grid) process exit.
> 
> 
> borg.lerctr.org dumped core - see /var/crash/vmcore.5
> 
> Sun Aug 23 20:14:24 CDT 2015
> 
> FreeBSD borg.lerctr.org 11.0-CURRENT FreeBSD 11.0-CURRENT #46 r287028: Sat Aug 22 18:34:59 CDT 2015     root@borg.lerctr.org:/usr/obj/usr/src/sys/VT-LER  amd64
> 
> panic: racct_sub: freeing 1 of resource 11, which is more than allocated 0 for wcgrid_fahv_vina_pr (pid 1140)

Could you try the patch below?

Index: sys/compat/linux/linux_fork.c
===================================================================
--- sys/compat/linux/linux_fork.c	(revision 287034)
+++ sys/compat/linux/linux_fork.c	(working copy)
@@ -285,10 +285,20 @@ linux_clone_thread(struct thread *td, struct linux
 
 	p = td->td_proc;
 
+#ifdef RACCT
+	if (racct_enable) {
+		PROC_LOCK(p);
+		error = racct_add(p, RACCT_NTHR, 1);
+		PROC_UNLOCK(p);
+		if (error != 0)
+			return (EPROCLIM);
+	}
+#endif
+
 	/* Initialize our td */
 	error = kern_thr_alloc(p, 0, &newtd);
 	if (error)
-		return (error);
+		goto fail;
 														
 	cpu_set_upcall(newtd, td);
 
@@ -369,6 +379,16 @@ linux_clone_thread(struct thread *td, struct linux
 	td->td_retval[0] = newtd->td_tid;
 
 	return (0);
+
+fail:
+#ifdef RACCT
+	if (racct_enable) {
+		PROC_LOCK(p);
+		racct_sub(p, RACCT_NTHR, 1);
+		PROC_UNLOCK(p);
+	}
+#endif
+	return (error);
 }
 
 int



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150824083700.GA1253>