id summary reporter owner description type status milestone component version severity resolution keywords cc 10432 32-bit offset_ptr crashes on 64-bit platform Andrey Semashev Ion Gaztañaga "There seem to be problems with handling offset_ptrs with 32-bit offsets on a 64-bit platform. The attached code sample tries to create a file mapping with managed_external_buffer using 32-bit offset_ptrs. The program crashes sometimes when trying to initialize the mapping (see the attached valgrind log for one of such crashes). The offset_ptr is declared as follows: {{{ typedef boost::interprocess::offset_ptr< void, std::ptrdiff_t, std::int32_t > void_pointer; }}} My theory is that there are incorrect offset conversions somewhere in Boost.Interprocess which sometimes result in incorrect pointers and a subsequent crash. This may not happen on every run of the program because the mapping address of the file region can change between runs. One of the problems with 32-bit offset_ptrs is that its implementation performs implicit casts of the offset to std::size_t (see calls to offset_ptr_to_raw_pointer and offset_ptr_to_offset), which makes incorrect result if the offset type is unsigned and smaller than std::size_t. I didn't find any restrictions on the offset type in the docs or the code, and by default the offset type is unsigned. IMO, the code should be corrected to perform sign extension of the offset or restrict the offset type to be signed integers. This should be documented as well. However, even if my program uses a signed offset type, it still crashes, so there have to be other issues elsewhere. I tested this on Kubuntu 14.04 x86_64. " Bugs new To Be Determined interprocess Boost 1.56.0 Problem offset_ptr