IPC-Shareable

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

    - POD: Promoted the signal handling note into its own section under
      DESTRUCTION
    - Fully implement Dragonfly BSD unit test VM infrastructure
    - Fix shmid_ds unpack for Dragonfly BSD
    - Prevent macOS extended attributes from leaking into dist tarballs

1.15    2026-05-26
    - Refactor how we initialize $VERSION. It's no longer in a BEGIN block. That
      broke Dist::Mgr
    - Fixes #60: Fix FETCH deadlock when inner child re-decode acquires SH lock
      against LOCK_EX cascade held by _lock_children
    - Fix OpenBSD 64-bit shmid_ds binary layout (verified via offsetof on 7.4):
      segsz is int (4B not 8B), nattch is short (2B), and struct has nanosecond
      fields between time_t values.  Updated t/80-SharedMem.t synthetic test and
      shm_segments() segsz extraction to match.
    - Added OpenBSD test VM infrastructure
    - t/20-lock_operation.t: probe for adequate semaphore resources before
      running, skip gracefully on low-limit platforms (OpenBSD semmni=10).
      Added periodic _end() cleanup calls so peak semaphore usage stays within
      the default limit on OpenBSD.
    - Added 'testing' flag; allows bulk cleanup of leaked segs/sems from a

t/25-fetch_nested_lock.t  view on Meta::CPAN

IPC::Shareable->testing_set('IPC::Shareable');
use Test::More;

use FindBin;
use lib $FindBin::Bin;
use IPCShareableTest qw(assert_clean_process unique_glue require_free_sem_sets);

require_free_sem_sets();


# Regression: FETCH re-decoding inner child segments under LOCK_EX cascade
# caused a self-deadlock. _lock_children set SEM_WRITERS=1 on the child's
# semaphore, then FETCH called _decode_json_restore which tried LOCK_SH on
# the same semaphore — blocking on a lock the same process holds.
{
    tie my %top, 'IPC::Shareable', {
        key       => unique_glue('TOP_FETCH_DEADLOCK'),
        create    => 1,
        destroy   => 1,
    };

t/IPCShareableTest.pm  view on Meta::CPAN

sub relieve_ipc_pressure {
    IPC::Shareable::clean_up_all if low_sem_resources();
}

# Skip the entire test file when the host does not have at least $needed free
# SysV semaphore sets. Every tie consumes one set, so a file whose peak
# concurrent tie count cannot be satisfied dies mid-run with "Could not create
# semaphore set: No space left on device" (ENOSPC) -- the mass CPAN tester
# FAIL mode on OpenBSD smokers (semmni=10) pre-wedged by stale sets from
# previously crashed runs. Skipping is the honest grade there: the environment
# cannot run the file, and a FAIL cascade (croaking mid-test and leaking yet
# more IPC resources on the way down) helps nobody. No-op when the limit
# cannot be determined. Call it before the first tie, after testing_set().

sub require_free_sem_sets {
    my ($needed) = @_;

    $needed = FREE_SEM_SETS_NEEDED if ! defined $needed;

    my $free = free_sem_sets();



( run in 1.474 second using v1.01-cache-2.11-cpan-9581c071862 )