Boost C++ Libraries: Ticket #6054: Reading Shared Memory from x86 to x64 and vice versa on OSX https://svn.boost.org/trac10/ticket/6054 <p> If I create a SM from 64 bit application and open it on 32 bit application it fails. </p> <p> <em>for 64 bit </em></p> <blockquote> <p> shared_memory_object( create_only, "test" , read_write) ; </p> </blockquote> <p> <em> for 32 bit </em></p> <blockquote> <p> shared_memory_object (open_only, "test", read_write); </p> </blockquote> <p> file created by 64bit application is at path as below: </p> <p> /private/tmp/boost_interprocess/AD21A54E000000000000000000000000/test where as file searched by 32 bit application is at path </p> <p> /private/tmp/boost_interprocess/AD21A54E00000000/test Thus 32 bit applications cannot read the file. </p> <p> I am using boost 1.47.0 on Mac OS X. Is it a bug? Do I have to do some settings use some Macros in order to fix it? Has any one encountered this problem before? </p> <p> This Bug is present in tmp_dir_helpers.hpp file. </p> <p> </p> <pre class="wiki"> inline void get_bootstamp(std::string &amp;s, bool add = false) { ... std::size_t char_counter = 0; long fields[2] = { result.tv_sec, result.tv_usec }; for(std::size_t field = 0; field != 2; ++field){ for(std::size_t i = 0; i != sizeof(long); ++i){ const char *ptr = (const char *)&amp;fields[field]; bootstamp_str[char_counter++] = Characters[(ptr[i]&amp;0xF0)&gt;&gt;4]; bootstamp_str[char_counter++] = Characters[(ptr[i]&amp;0x0F)]; } ... } </pre><p> Where as it should have been some thing like this.. </p> <p> </p> <pre class="wiki"> '''long long''' fields[2] = { result.tv_sec, result.tv_usec }; for(std::size_t field = 0; field != 2; ++field){ for(std::size_t i = 0; i != sizeof('''long long'''); ++i) </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6054 Trac 1.4.3 Ion Gaztañaga Fri, 23 Dec 2011 13:09:18 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6054#comment:1 https://svn.boost.org/trac10/ticket/6054#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixed in trunk. Time uses 32 bit integers on both 32 bit and 64 bit versions to avoid problems. </p> Ticket bykedar@… Thu, 08 May 2014 08:33:31 GMT attachment set https://svn.boost.org/trac10/ticket/6054 https://svn.boost.org/trac10/ticket/6054 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">challenge8.bin</span> </li> </ul> <p> bin file </p> Ticket