簡體   English   中英

boost:interprocess中的異常,共享內存對象刪除

[英]exception in boost:interprocess, shared memory object deletion

我將一小段代碼移到示例應用程序的主要功能,以避免影響其他任何應用程序部分:

    namespace bi = boost:interprocess;

    bi::shared_memory_object::remove("shm");
    bi::named_mutex::remove("mtx");
    bi::named_condition::remove("cnd");

僅第一行在內部boost進程間代碼中引發了異常:在windows_intermodule_singleton.hpp中,118(v 1.60.0)粗體行是發生這種情況的地方。 Win64,VC v19,Windows 10

     ...
     caster.addr = m;
     BOOST_ASSERT((caster.addr_uint64 & boost::uint64_t(3)) == 0);
     max_count = boost::uint32_t(caster.addr_uint64 >> 32);
     **initial_count = boost::uint32_t(caster.addr_uint64);**
     initial_count = initial_count/4;
     //Make sure top two bits are zero
     BOOST_ASSERT((max_count & boost::uint32_t(0xC0000000)) == 0);
     //Set quasi-top bit
     max_count |= boost::uint32_t(0x40000000);
     ...

知道為什么會這樣嗎? 這可以與x64內存模型相關嗎?

這不是一個例外,我不注意,使用所有/ RTC編譯器設置進行編譯,並且該位置看起來像潛在的數據丟失(?)8字節至4。windbg報告:_RTC_Check_8_to_4

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM