Re: Subject: [ANN] Lua 5.5.1 (rc1) now available
Roberto Ierusalimschy <[email protected]> Thu, 16 Jul 2026 12:08:22 -0300
| Newsgroups | gmane.comp.lang.lua.general |
|---|---|
| Message-ID | <[email protected]> |
> Le 15/07/2026 =C3=A0 22:53, Luiz Henrique de Figueiredo a =C3=A9crit=C2=
=A0:
> > Lua 5.5.1 (rc1) is now available for testing at
> > https://www.lua.org/work/lua-5.5.1-rc1.tar.gz
> >=20
> > All feedback welcome. Thanks.
> > --lhf
>=20
> Hello,
>=20
> Lua 5.5.1-rc1 passes all LuaX tests but there are some undefined behaviou=
rs
> detected by UBSan.
>=20
> [...]
>=20
> lua-5.5.1/src/lstate.c:352:14: runtime error: member access within
> misaligned address 0x7d51507e0608 for type 'union GCUnion', which require=
s
> 16 byte alignment
> 0x7d51507e0608: note: pointer points here
> =C2=A0be be be be=C2=A0 be be be be be be be be=C2=A0 08 08 01 00 be be b=
e be=C2=A0 be be be be
> be be be be=C2=A0 80 00 7e 50
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^
> [...]
I believe gcc is being overzealous here and possibly breaking the C
standard. The standard says this:
"A pointer to a union object, suitably converted, points to each of
its members [...], and vice versa."
So, if a member is an int, it should be valid to convert a pointer to
int (with its 4-byte alignment) to a pointer to the union, and then
convert it back to a pointer to int.
-- Roberto
--=20
You received this message because you are subscribed to the Google Groups "=
lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/20260=
716150822.GA10255%40arraial.inf.puc-rio.br.