Unfortuantely, POSIX declined to specify setgroups() and initgroups() is
not in any standard, so it's hard to say which behavior is right and
which is wrong. It seems possible to argue any of the following:
1. The bug is in kFreeBSD's implementation of setgroups(), which must
be fixed so that eglibc's initgroups() implementation works as
expected.
2. The bug is in eglibc's implementation of initgroups(), which must be
fixed so that it works properly with kFreeBSD's setgroups().
3. Since both behaviors of setgroups() and initgroups() are seen "in
the wild", programs that depend on the linux kernel behavior are
broken and should be fixed as they become known.
Personally I'm leaning towards 3 here, since these are buggy not only on
debian/kFreeBSD but on real FreeBSD as well.