Your message dated Sat, 13 Jul 2013 21:34:16 +0000
with message-id <[email protected]>
and subject line Bug#660380: fixed in luabind 0.9.1+dfsg-6
has caused the Debian Bug report #660380,
regarding libluabind-dev: Invalid casts due to bug in cast graph cache
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
660380: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=660380
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libluabind-dev
Version: 0.9.1+dfsg-4
Severity: important
Tags: patch
Dear Maintainer,
This patch fixes a bug in the cast graph cache in Luabind 0.9.1. The
problem did not manifest itself in earlier versions, but only became
apparent with Luabind commit 8e9bb9c7, which fixed a different cast
cache bug.
When a cast from a Lua value to a C++ object fails due to mismatching
types, e.g. upon function overload resolution, or explicit object_cast,
Luabind stores a bogus entry in the cast graph cache. A second cast to
the same C++ type will then erroneously yield a successful cast despite
the mismatching types. This results in e.g. ambiguous overload errors
for overloaded functions despite non-ambiguity, or segmentation faults
due to access of a C++ object through a pointer with the wrong type.
The bug has first been discovered and fixed by Eduard Mueller:
http://old.nabble.com/inheritance-cast_graph-cache-bug-fix-p29936577.html
The above patch switches the arguments to store a correct cache entry
with offset equal to cache::invalid. The distance value is irrelevant,
as it is discarded in cast_graph::impl::cast(). Presumably the above
patch changes it from -1 to 0 to account for the std::size_t type used
in the signature of cache::put.
The patch below takes a different approach, as already suggested by the
author of the above patch. We swap the offset and distance arguments of
cache::put to match the order of the cache entry pair. Further, we
change the distance type in the cache::put signature from std::size_t
to int, to be consistent with the cache entry type. This inconsistency
stems from the changes in Luabind commit cf37774.
Note that under GNU/Linux, the cast graph cache bug manifests itself
on the x86 platform, but does not seem to affect Luabind on x86_64.
http://article.gmane.org/gmane.comp.lang.lua.luabind/2924
Could you apply the attached patch to the Debian package?
Thanks,
Peter
-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (500, 'testing'), (200, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 3.1.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages libluabind-dev depends on:
ii libboost-dev 1.48.0.3
ii libboost-python-dev 1.48.0.3
ii liblua5.1-0-dev 5.1.4-12
ii libluabind0.9.1 0.9.1+dfsg-4
libluabind-dev recommends no packages.
Versions of packages libluabind-dev suggests:
pn libluabind-doc <none>
pn libluabind-examples <none>
-- no debconf information
From: Peter Colberg <[email protected]>
Date: Sat, 30 Jul 2011 12:33:42 -0400
This patch fixes a bug in the cast graph cache in Luabind 0.9.1. The
problem did not manifest itself in earlier versions, but only became
apparent with Luabind commit 8e9bb9c7, which fixed a different cast
cache bug.
When a cast from a Lua value to a C++ object fails due to mismatching
types, e.g. upon function overload resolution, or explicit object_cast,
Luabind stores a bogus entry in the cast graph cache. A second cast to
the same C++ type will then erroneously yield a successful cast despite
the mismatching types. This results in e.g. ambiguous overload errors
for overloaded functions despite non-ambiguity, or segmentation faults
due to access of a C++ object through a pointer with the wrong type.
The bug has first been discovered and fixed by Eduard Mueller:
http://old.nabble.com/inheritance-cast_graph-cache-bug-fix-p29936577.html
# diff --git a/src/inheritance.cpp b/src/inheritance.cpp
# index 2e2ec90..b8467ad 100644
# --- a/src/inheritance.cpp
# +++ b/src/inheritance.cpp
# @@ -190,7 +190,7 @@ std::pair<void*, int> cast_graph::impl::cast(
# }
# }
#
# - m_cache.put(src, target, dynamic_id, object_offset, cache::invalid, -1);
# + m_cache.put(src, target, dynamic_id, object_offset, 0, cache::invalid);
#
# return std::pair<void*, int>((void*)0, -1);
# }
The above patch switches the arguments to store a correct cache entry
with offset equal to cache::invalid. The distance value is irrelevant,
as it is discarded in cast_graph::impl::cast(). Presumably the above
patch changes it from -1 to 0 to account for the std::size_t type used
in the signature of cache::put.
The patch below takes a different approach, as already suggested by the
author of the above patch. We swap the offset and distance arguments of
cache::put to match the order of the cache entry pair. Further, we
change the distance type in the cache::put signature from std::size_t
to int, to be consistent with the cache entry type. This inconsistency
stems from the changes in Luabind commit cf37774.
Note that under GNU/Linux, the cast graph cache bug manifests itself
on the x86 platform, but does not seem to affect Luabind on x86_64.
--- luabind-0.9.1.orig/src/inheritance.cpp
+++ luabind-0.9.1/src/inheritance.cpp
@@ -64,7 +64,7 @@
void put(
class_id src, class_id target, class_id dynamic_id
, std::ptrdiff_t object_offset
- , std::size_t distance, std::ptrdiff_t offset);
+ , std::ptrdiff_t offset, int distance);
void invalidate();
@@ -90,7 +90,7 @@
void cache::put(
class_id src, class_id target, class_id dynamic_id
- , std::ptrdiff_t object_offset, std::size_t distance, std::ptrdiff_t offset)
+ , std::ptrdiff_t object_offset, std::ptrdiff_t offset, int distance)
{
m_cache.insert(std::make_pair(
key_type(src, target, dynamic_id, object_offset)
@@ -175,7 +175,7 @@
{
m_cache.put(
src, target, dynamic_id, object_offset
- , qe.distance, (char*)qe.p - (char*)p
+ , (char*)qe.p - (char*)p, qe.distance
);
return std::make_pair(qe.p, qe.distance);
--- End Message ---
--- Begin Message ---
Source: luabind
Source-Version: 0.9.1+dfsg-6
We believe that the bug you reported is fixed in the latest version of
luabind, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Roberto C. Sanchez <[email protected]> (supplier of updated luabind package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Sat, 13 Jul 2013 13:46:43 -0400
Source: luabind
Binary: libluabind0.9.1 libluabind-dbg libluabind-dev libluabind-doc
libluabind-examples
Architecture: source all amd64
Version: 0.9.1+dfsg-6
Distribution: unstable
Urgency: low
Maintainer: Roberto C. Sanchez <[email protected]>
Changed-By: Roberto C. Sanchez <[email protected]>
Description:
libluabind-dbg - luabind c++ binding for lua: unstripped binaries
libluabind-dev - luabind c++ binding for lua: static library and headers
libluabind-doc - luabind c++ binding for lua: documentation files
libluabind-examples - luabind c++ binding for lua: example files
libluabind0.9.1 - luabind c++ binding for lua: runtime library
Closes: 660375 660380 660384 705182
Changes:
luabind (0.9.1+dfsg-6) unstable; urgency=low
.
* Add Vcs-Git and Vcs-Browser fields in debian/control
* Remove Arthur Loiret as maintainer (he has retired from the project)
and move /me from uploaders to maintainer
* Build with hardening options
* Fix architecture independent and architecture dependent build targets
* Update to Standards-Version 3.9.4 (no changes)
* Support building with clang, cherry pick patch from upstream commit
3044a90 (Closes: #660375) (LP: #1055374)
* Add patch to fix bug in cast graph cache, thanks to Peter Colberg
(Closes: #660380)
* Adjust build dependencies to prefer building against Boost 1.53
(Closes: #705182)
* Add patch to support Lua 5.2, thanks to Peter Colberg (Closes: 660384)
* Adjust build dependencies to build against Lua 5.2 instead of 5.1
* Drop unnecessary dependency on libboost-python-dev (LP: #568444)
Checksums-Sha1:
fa1dddc0ad30b591090fcec4120bdcb48f7d04e5 2213 luabind_0.9.1+dfsg-6.dsc
57809314490e14c65ae90c6e8467e270639d5b56 13906
luabind_0.9.1+dfsg-6.debian.tar.gz
00c2158857604e5ad3be8f1ac54ea47134fd32bb 92198
libluabind-doc_0.9.1+dfsg-6_all.deb
94772b46c4d75fb8fd1e0415c67502889d8811cf 16462
libluabind-examples_0.9.1+dfsg-6_all.deb
1d77c329a00bf921c32975a019c7df662c85256c 50270
libluabind0.9.1_0.9.1+dfsg-6_amd64.deb
041aa33f36f6a72c1675688a654279c8e671d0aa 1075698
libluabind-dbg_0.9.1+dfsg-6_amd64.deb
d954af1b1088386d80150355cb5b96009c630998 125406
libluabind-dev_0.9.1+dfsg-6_amd64.deb
Checksums-Sha256:
d2aff5daf72de0c3cee6dafba988f0287e40124dd2022ec7514bff156c2d6fe8 2213
luabind_0.9.1+dfsg-6.dsc
5295381ae012f75bf33d91df71e113893377b253307ff910d56ae2d709eabafe 13906
luabind_0.9.1+dfsg-6.debian.tar.gz
57ea2b51636378166835eec6dfdae5dcb57468891a2a8c23caffc0dcf837c7cf 92198
libluabind-doc_0.9.1+dfsg-6_all.deb
31fe3a4f82ea012783f7a3e4cbdf6ea57c8c53661e3f5b053bb627b4ade86f02 16462
libluabind-examples_0.9.1+dfsg-6_all.deb
1baafd5a3b6a875684f8b932df3957298cbf010331e16e1d178f926183033d63 50270
libluabind0.9.1_0.9.1+dfsg-6_amd64.deb
b7ea5e7fe0267277ad9fd6624560a7a901cdc6b51de20adc0774c38b839e4b95 1075698
libluabind-dbg_0.9.1+dfsg-6_amd64.deb
f819d5f724bccce0ac6fb2411d904047f5810d75a8a11e8c0b40d714f22c8842 125406
libluabind-dev_0.9.1+dfsg-6_amd64.deb
Files:
a83f169100119e92129d54af357a610a 2213 libs optional luabind_0.9.1+dfsg-6.dsc
550ebb6f69bd3e46ec5d276479b4fa22 13906 libs optional
luabind_0.9.1+dfsg-6.debian.tar.gz
81fa208046f6437f655afdee80d3cd30 92198 doc optional
libluabind-doc_0.9.1+dfsg-6_all.deb
9ffadc295d584961acddd1a4c6b0dba5 16462 libdevel optional
libluabind-examples_0.9.1+dfsg-6_all.deb
c0de4fbcd17b7af792e29573d42ae4e3 50270 libs optional
libluabind0.9.1_0.9.1+dfsg-6_amd64.deb
47416cf6b842225567daf31592f1063c 1075698 debug extra
libluabind-dbg_0.9.1+dfsg-6_amd64.deb
78ae6da978fb78e9d6b928d4787075c2 125406 libdevel optional
libluabind-dev_0.9.1+dfsg-6_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iQIcBAEBCAAGBQJR4cAsAAoJECzXeF7dp7IPHxYP/0P5E8EGSb+vL1zGYkFyO5xt
zYW1FevgZfx7XoZQxUlddnsHumzUsKWLnWCLl7ml4H5RPdGpMwebxQECwz3mVYkR
7LTCeJlRAwrWXIW49IyV0heUPg5+Iwy7zihHJeTzBG4foQxKWkPe4Jb18rb9lJFL
bS4KMQod7q4I2uMw0DxCUoxCoachqkHFRPDbFc0TMJn3xirodtQNhUeqC/GoNTLs
1CXb/kXlDpQ02JKJ3c1Mc8XL7OogjX5+S2fL7jEuWTxdmo9TUIML8iyj+4g+tLod
WFHd7/Z5W3IV4fux+xhr7yK3yxOTw0SVBShiXWfoWGeQ5/6Mkc5xcNTH7xUuXqHb
kp7XXMJ+Btmt+jfrd61zbeGHyAIFq0QQ3uAZ9pGdxXxDve4M6ou2m59yGs59+EXa
j43d6QwGiEcG/DLr6JgE75P0jOrP1L+JE0vcBF2tzBPo9Nmb06hFWceG74+TmmN/
Ufp85p6bsP/jmX+mVWLjuWr9gRipA/reiVERltH87tfZ1cU+bIPqDo9pPTynYyMz
sCcWnd0w9EhsWu5eEBMYZxX3Q3FizIxwVODRKULmVC5NbnO1MJSuAeL9jSmAt3cM
KabjLrwqHzuYFvAElNxZBsGAzHQjHU2Jp0vv6b43T5UTTVqfWJ0aUgwZmduK3zaW
wM4RLBwx6nk8oH2ILQAI
=hT8P
-----END PGP SIGNATURE-----
--- End Message ---