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     r...@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
_______________________________________________
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to