Hello, Mateusz! The check in kern_setgroups's callers is: if (gidsetsize > ngroups_max + 1) return (EINVAL); So, gidsetsize could be (ngroups_max + 1). And under this condition, the assertion MPASS(ngrp <= ngroups_max); in kern_setgroups() will fail. One of them should be fixed. Tiwei Bie