[Log4cplus-devel] [log4cplus:bugs] #343 Crash on app exit
Logging Framework for C++
Brought to you by:
wilx
From: Václav H. <wi...@us...> - 2017-07-11 14:29:45
|
Thank you for the additional information, I think I now understand the situation. We have seen this before. The issue is with how are C++11 synchornization primitives implemented in Visual Studio. As a stop gap measure, you can modify the log4cplus source like the following diff, for 1.2.x branch: ```diff diff --git a/include/log4cplus/config/win32.h b/include/log4cplus/config/win32.h index 8e5175cd..aa4b0202 100644 --- a/include/log4cplus/config/win32.h +++ b/include/log4cplus/config/win32.h @@ -162,7 +162,7 @@ # endif # if _MSC_VER >= 1700 # define LOG4CPLUS_HAVE_CXX11_ATOMICS -# define LOG4CPLUS_WITH_CXX11_THREADS +//# define LOG4CPLUS_WITH_CXX11_THREADS # endif #endif ``` This will however not apply on 2.0.x branch because I have removed the non-C++11 implementations of synchornization primitives. I will either have to re-introduce them or...I do not know what else yet. I am keeping this open to remind me about this issue. --- ** [bugs:#343] Crash on app exit** **Status:** open **Group:** v1.2.0 **Labels:** java v1.2.0 **Created:** Fri Jun 23, 2017 03:02 PM UTC by Ralf Sieger **Last Updated:** Tue Jul 11, 2017 12:33 PM UTC **Owner:** Václav Haisman **Attachments:** - [log4cplus_debug_hs_err_pid11184.log](https://sourceforge.net/p/log4cplus/bugs/343/attachment/log4cplus_debug_hs_err_pid11184.log) (23.5 kB; application/octet-stream) - [log4cplus_release_hs_err_pid10836.log](https://sourceforge.net/p/log4cplus/bugs/343/attachment/log4cplus_release_hs_err_pid10836.log) (23.9 kB; application/octet-stream) log4cplus: - 1.2.0 - Visual Studio 2012 - config: release and debug - windows 10, i7 4770 client: - 32 bit Java 7 application - log4cplus as dll - log4cplus.lib and log4cplusD.lib - multibyte chars - see attached logfiles - client DLL compile settings: no MFC, no ATL, multibyte charset, /MDd and /MD We use log4cplus in an custom C++ dll which itself gets dynamically loaded in java program. during the runtime everything works ok. At application exit we see an java hotspot error (see logs). This happens with and without calling log4cplus::Logger::shutdown(); The problem also occurs if nothing but log4cplus::initialize(); and log4cplus::Logger::shutdown(); are called. From the hotspot error it looks like an cleanup issue: ~~~ Stack: [0x46760000,0x467b0000], sp=0x467aee5c, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [ntdll.dll+0xecc94] C [ntdll.dll+0x9683a] C [KERNEL32.DLL+0x1dbb9] C [MSVCR110.dll+0x9fa77] C [MSVCR110.dll+0x4defc] C [MSVCR110.dll+0x4f4cf] C [MSVCR110.dll+0x2431b] C [MSVCR110.dll+0x243dc] C [MSVCR110.dll+0x16629] C [MSVCR110.dll+0x6a312] C [MSVCP110.dll+0x2e2d8] C [MSVCP110.dll+0x2e47e] C [log4cplus.dll+0x229b] log4cplus::thread::SyncGuard<log4cplus::thread::Mutex>::SyncGuard<log4cplus::thread::Mutex>+0x2b C [log4cplus.dll+0x3f1dd] log4cplus::spi::ObjectRegistryBase::clear+0x2d C [log4cplus.dll+0x14225] log4cplus::`anonymous namespace'::DefaultContext::~DefaultContext+0x45 C [log4cplus.dll+0x143a5] log4cplus::`anonymous namespace'::destroy_default_context::~destroy_default_context+0x25 C [log4cplus.dll+0x559cd] log4cplus::`anonymous namespace'::`dynamic atexit destructor for 'destroy_default_context_''+0xd C [log4cplus.dll+0x4e002] _CRT_INIT+0xc1 C [log4cplus.dll+0x4e228] __DllMainCRTStartup+0xcf C [log4cplus.dll+0x4e152] _DllMainCRTStartup+0x1c ~~~ --- Sent from sourceforge.net because log...@li... is subscribed to https://sourceforge.net/p/log4cplus/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/log4cplus/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |