Subject: | Cleaning up semaphores |
Recently I discovered FAILs in my smokes and the reason was that the
system refused to allocate semaphores or message queues or some such IPC
stuff. So I knew I had to watch out for leaks in tests and this is my story:
Show quoted text
>sand@k75:~/.cpan/build/Apache-Session-1.84-unVxoy% ipcs
Show quoted text------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
------ Semaphore Arrays --------
key semid owner perms nsems
------ Message Queues --------
key msqid owner perms used-bytes messages
>sand@k75:~/.cpan/build/Apache-Session-1.84-unVxoy% make test
PERL_DL_NONLAZY=1
/home/src/perl/repoperls/installed-perls/perl/pcwzNIg/perl-5.8.0@32213/bin/perl
"-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib',
'blib/arch')" t/*.t
t/99base64.........ok
t/99dbfile.........ok
t/99dbfilestore....ok
t/99file...........ok
t/99filelock.......ok
t/99filestore......ok
t/99flex...........v-string in use/require non-portable at t/99flex.t
line 11.
t/99flex...........ok
t/99md5gen.........ok
t/99moduniqgen.....ok
t/99mysql..........skipped
all skipped: Not running RDBM tests without
APACHE_SESSION_MAINTAINER=1
t/99mysqllock......skipped
all skipped: Not running RDBM tests without
APACHE_SESSION_MAINTAINER=1
t/99mysqlstore.....skipped
all skipped: Not running RDBM tests without
APACHE_SESSION_MAINTAINER=1
t/99nulllock.......ok
t/99oracle.........skipped
all skipped: Not running RDBM tests without
APACHE_SESSION_MAINTAINER=1
t/99postgres.......skipped
all skipped: Not running RDBM tests without
APACHE_SESSION_MAINTAINER=1
t/99semaphore......ok
t/99storable.......ok
t/99uue............ok
All tests successful, 5 tests skipped.
Files=18, Tests=130, 13 wallclock secs ( 2.80 cusr + 0.35 csys = 3.15 CPU)
>sand@k75:~/.cpan/build/Apache-Session-1.84-unVxoy% ipcs
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
------ Semaphore Arrays --------
key semid owner perms nsems
0x00000000 58425354 sand 700 32
------ Message Queues --------
key msqid owner perms used-bytes messages
A failing test with a similar perl is here:
http://www.nntp.perl.org/group/perl.cpan.testers/2007/11/msg734592.html
Thanks,