The patch below fixes a panic triggered by threaded Linux applications
when running with RACCT/RCTL enabled. The crash, as reported, looked
like this:
panic: racct_sub: freeing 1 of resource 11, which is more than allocated 0 for
wcgrid_fahv_vina_pr (pid 1140)
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...
Unread portion of the kernel message buffer:
panic: racct_sub: freeing 1 of resource 11, which is more than allocated 0 for
wcgrid_fahv_vina_pr (pid 1140)
cpuid = 3
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe2eb3859920
vpanic() at vpanic+0x189/frame 0xfffffe2eb38599a0
kassert_panic() at kassert_panic+0x132/frame 0xfffffe2eb3859a10
racct_sub() at racct_sub+0x13e/frame 0xfffffe2eb3859a50
exit1() at exit1+0xd4/frame 0xfffffe2eb3859ad0
linux_exit_group() at linux_exit_group+0xd/frame 0xfffffe2eb3859ae0
ia32_syscall() at ia32_syscall+0x28b/frame 0xfffffe2eb3859bf0
Xint0x80_syscall() at Xint0x80_syscall+0x95/frame 0xfffffe2eb3859bf0
- syscall (252, Linux ELF32, linux_exit_group), rip = 0x817a9d7, rsp =
0xffffca3c, rbp = 0xffffca58 ---