Thread View: linux.debian.bugs.dist
1 messages
1 total messages
Started by Iliya Abolghasemi
Tue, 27 Oct 2026 14:00
Bug#1150883: luabind: object_rep buffer over-aligned for lua_newuserdata memory, tests segfault with LTO
Author: Iliya Abolghasemi
Date: Tue, 27 Oct 2026 14:00
Date: Tue, 27 Oct 2026 14:00
65 lines
4805 bytes
4805 bytes
On Wed, 14 Oct 2026 11:08:52 +0200 Sebastien Bacher <sebastien.bacher@canonical.com> wrote:
> From 49814f6b47ed99e273edc5198a6ebd7fa19e813a Mon Sep 17 00:00:00 2001
> From: Jan Boon <kaetemi@gmail.com>
> Date: Sat, 19 Feb 2022 17:30:38 +0100
> Subject: [PATCH] Fix bad alignment assumption in `object_rep` broken by
> lua_newuserdata (#50)
>
> * Match alignment of `object_rep` to `lua_newuserdata`. Fixes alignment assumption in placement new
> * Compatibility with lua 5.3
>
> Origin: other, https://github.com/Oberon00/luabind/commit/49814f6b47ed99e273edc5198a6ebd7fa19e813a
> Bug: https://github.com/Oberon00/luabind/issues/42
> Forwarded: not-needed
> Last-Update: 2026-10-14
>
> ---
> luabind/detail/object_rep.hpp | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/luabind/detail/object_rep.hpp b/luabind/detail/object_rep.hpp
> index 07272e64..519f7140 100644
> --- a/luabind/detail/object_rep.hpp
> +++ b/luabind/detail/object_rep.hpp
> @@ -97,8 +97,14 @@ namespace luabind { namespace detail
>
> void operator=(object_rep const&);
>
> +#ifdef LUAI_MAXALIGN
> + struct cD { char c; union { LUAI_MAXALIGN; } u; };
> +#else
> + struct cD { char c; union { lua_Number n; double u; void *s; lua_Integer i; long l; } u; };
> +#endif
> BOOST_STATIC_CONSTANT(std::size_t, instance_buffer_size=32);
> - boost::aligned_storage<instance_buffer_size> m_instance_buffer;
> + BOOST_STATIC_CONSTANT(std::size_t, instance_buffer_align=offsetof(struct cD, u));
> + boost::aligned_storage<instance_buffer_size, instance_buffer_align> m_instance_buffer;
> instance_holder* m_instance;
> class_rep* m_classrep; // the class information about this object's type
> std::size_t m_dependency_cnt; // counts dependencies
Hi Sebastien,
I currently working on next release,
next release also contain your sended patch, and after next release get upload to unstable
this submited bug must be close too.
Thanks for your report.
Regards.
--
Iliya Abolghasemi (gfaerny)
Fingerprint: 4DEF 5756 FDE5 C5EC 9B3D FB3C DC84 0F69 C960 72C3
https://gfaerny.cc
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads