Comments (4)
Hi,
if I use /MTd the crash happens. But if I call FreeLibrary in reverse order to LoadLibrary the crash does not happen.
The debugger shows me that the crash is always somewere in boost::interprocess.
Christian
from interprocess.
I have got the same issue right now!
Crash appears inside
intermodule_singleton_common.hpp
inside function
static void atexit_work()
{
intermodule_singleton_common<ThreadSafeGlobalMap>::finalize_singleton_logic
(this_module_singleton_ptr, this_module_singleton_initialized, singleton_destructor);
}
this function called twice - cos std::atexit - called twice inside 2 different dlls
so two singletons were created - ...i suppose this sigletons use some shared resources(may be pointers) - as result new and delete called for different memory managers
from interprocess.
Hi,
I think I solved the issue (maybe just for me). The problem isn't the /MTd
switch of the compiler.
I think the problem is related to the singleton implementation inside boost::interprocess::shared_memory_object
. My project structure is as follows:
An EXE file loads a DLL (a driver wrapper) which can load several device driver DLLs in parallel. Two of the driver DLLs are using their own shared_memory_object
's as described in the doc and it work in both cases. Until I call FreeLibrary
for the driver DLLs. In that case always the second FreeLibrary
crashes (but not with /MDd
I didn't understand this seconds fact, sorry).
I solved the issue by creating a boost::interprocess::shared_memory_object
inside the driver wrapper DLL. I just instantiate such an object and in the next line I remove it. If I do this, my DLLs don't crash any more.
I hope this helps the developer of boost::interprocess
.
Kind regards,
Christian
from interprocess.
My mistake was not related to boost or compiler flags nor something else of the above. I used thread synchronisation mechanisms during unloading the DLLs (PROCESS_DETACH in dll_main()). As mentioned in the Microsoft documentation this results in an undefined behaviour of the application! After redesigning my DLLs the shared_memory_objects and the entire software works stable. Maybe this helps someone.
from interprocess.
Related Issues (20)
- namespace conflict on constructing objects in segment manager with named proxy in combination with boost geometry HOT 1
- x86 inline assembly should provide an alternative for Intel syntax
- missing/misused m_is_wide in char_wchar_holder assignment operators
- Condition variable and Mutex blocks after one process crashes and restart HOT 1
- Memory allocation docs reference dead website HOT 1
- Local memory only implementation HOT 2
- boost.interprocess seems to have a bug. HOT 2
- boost::interprocess::named_condition compile error on Visual Studio 2022 HOT 1
- Constructing vector of POD using boost interprocess throws exception only in debug mode HOT 1
- There is a bug in boost/interprocess/detail/os_thread_function.hpp
- Bug in boost::interprocess::ipcdetail::sync_handles::obtain_mutex HOT 2
- Using `message_queue` with `windows_shared_memory`
- `message_queue::timed_receive` block process a long duration than expect when `system time` jumb back HOT 1
- Modular Boost C++ Libraries Request HOT 1
- Alignment problem with boost/interprocess/segment_manager on SPARC 32Bit / Boost 1.84 HOT 7
- Problem with managed_shared_memory on Windows with fast startup HOT 2
- managed_map_file find_or_construct does not return Cache aligned memory HOT 2
- boost::flyweight::intermodule_holder on LINUX is segfaulting
- basic_managed_shared_memory::grow() do not return when using raw pointers HOT 1
- Support stop tokens HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from interprocess.