```OK``` On Fri, Nov 27, 2026, 2:01 PM John David Anglin <[email protected]> wrote:
> I updated the commit comment. > > On Fri, Nov 27, 2026 at 04:12:05PM -0500, John David Anglin wrote: > > Fixes caf.exp test fails on hppa-unknown-linux.gnu. > > > > Okay? > > > > Dave > > --- > > libgfortran: Store aligned offset in shared_memory_get_master > > In shared_memory_get_master, mem->glbl.meta->master was assigned the > unaligned value of mem->glbl.meta->used prior to calling > shared_memory_get_mem_with_alignment rather than the aligned offset > returned in p.offset. > > On targets where __alignof__ (supervisor) is greater than > sizeof (struct global_shared_memory_meta) (such as hppa-linux-gnu, > where pthread_mutex_t requires 16-byte alignment while > global_shared_memory_meta is 8 bytes), the supervisor wrote > SUPERVISOR_MAGIC_NUM at the 16-byte aligned offset while worker images > read from the unaligned offset 8, triggering an assertion failure in > ensure_shmem_initialization. > > 2026-11-27 John David Anglin <[email protected]> > > libgfortran/ChangeLog: > > * caf/shmem/shared_memory.c (shared_memory_get_master): Store > the aligned offset p.offset in mem->glbl.meta->master. > > diff --git a/libgfortran/caf/shmem/shared_memory.c > b/libgfortran/caf/shmem/shared_memory.c > index dc78f66e820..1c8efaf3f3b 100644 > --- a/libgfortran/caf/shmem/shared_memory.c > +++ b/libgfortran/caf/shmem/shared_memory.c > @@ -114,10 +114,9 @@ shared_memory_get_master (shared_memory_act *mem, > size_t size, size_t align) > return (shared_mem_ptr) {mem->glbl.meta->master}; > else > { > - ptrdiff_t loc = mem->glbl.meta->used; > shared_mem_ptr p > = shared_memory_get_mem_with_alignment (mem, size, align); > - mem->glbl.meta->master = loc; > + mem->glbl.meta->master = p.offset; > return p; > } > } >
