Message99926
On Tue, Feb 23, 2010 at 8:46 AM, Ronald Oussoren <report@bugs.python.org> wrote:
> ..
> I get test failures, but no crashes, when I do run the additional tests.
The crash that I see is apparently due to underallocated memory:
alt_grouplist = PyMem_Malloc(n);
should be
alt_grouplist = PyMem_Malloc(n * sizeof(gid_t));
..
> I'm not too thrilled about your approach of growing the grouplist argument of
> getgroups until the results fit, the comment in the coreutils sources refers to two > very old unix flavors and IMHO it is not worthwhile to try to support those.
>
You are probably right on this point, but the main issue with using
getgroups(0, ..) is the race condition that it introduces. If another
thread adds a group between n = getgroups(0, ..) and getgroups(n, ..)
calls, the second call will fail.
Makes sense regardless of the approach. |
|
Date |
User |
Action |
Args |
2010-02-23 15:24:08 | Alexander.Belopolsky | set | recipients:
+ Alexander.Belopolsky, loewis, ronaldoussoren, orsenthil, r.david.murray, michael.foord, l0nwlf |
2010-02-23 15:24:07 | Alexander.Belopolsky | link | issue7900 messages |
2010-02-23 15:24:06 | Alexander.Belopolsky | create | |
|