#1146517 libipc-shareable-perl: FTBFS on ppc64el and ppc64: shm_segments() reads the wrong field of struct shmid_ds

#1146517#5
Date:
2026-09-02 18:56:25 UTC
From:
To:
1.19-1 fails to build on ppc64el and ppc64, and builds everywhere else:

https://buildd.debian.org/status/package.php?p=libipc-shareable-perl

https://buildd.debian.org/status/logs.php?pkg=libipc-shareable-perl&arch=ppc64el

   t/72-shm_segments.t  (Wstat: 6912 Tests: 47 Failed: 27)
   t/74-seg_map.t       (Wstat: 512  Tests: 12 Failed: 2)

lib/IPC/Shareable.pm unpacks struct shmid_ds at a hard-coded offset for
shm_segsz, assuming the asm-generic field order. PowerPC puts the three
time fields first, so on ppc64el/ppc64 the offset lands on shm_atime;
the oversized value makes the following shmread() fail and the segment
never reaches %segments. IPC/Shareable/SharedMem.pm has the same bug in
stat().

Reported upstream as #66, together with an alternative that drops the
offset tables entirely and reads the fields through IPC::SysV's XS
instead. Upstream has not replied yet, so the attached minimal fix is
what I would suggest for Debian; it is the least likely to conflict with
whichever route upstream takes.

Both solutions were built and tested on ppc64el under sbuild. No
upstream reply yet.

Filed separately from #1142815, which is the unrelated t/47-seg_size.t
memory problem (upstream #65).

Kind regards,

     Edmund Lodewijks