[Rock-dev] Important note about boost::circular_buffer

Sylvain Joyeux sylvain.joyeux at dfki.de
Wed Sep 14 13:30:47 CEST 2011


Translated Summary: if you compile two shared libraries, one in Debug 
and the other one in Release, and both use a boost::circular_buffer<T> 
(with T being the same on both libraries), then a program that uses both 
libraries will crash. In practice for us, this was happening with 
StreamAligner<T> that I recently moved to use circular_buffer to avoid 
memory allocation and copying.

Summary: boost::circular_buffer changes its ABI depending on whether it 
is compiled with NDEBUG defined or not

Temporary Fix: include base/circular_buffer.h instead than 
boost/circular_buffer.hpp to include boost::circular_buffer. The class 
is still called boost::circular_buffer<T>.

Long-term fix: Boost maintainer should fix this issue.
-- 
Sylvain Joyeux (Dr.Ing.)
Space & Security Robotics

!!! Achtung, neue Telefonnummer!!!

Standort Bremen:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany

Phone: +49 (0)421 178-454136
Fax:   +49 (0)421 218-454150
E-Mail: robotik at dfki.de

Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.:    DE 148646973
Steuernummer:  19/673/0060/3
-----------------------------------------------------------------------


More information about the Rock-dev mailing list