[Ace-users] [ace-users] [ACE_Base_Thread_Adapter]: Crash in inherit_log_msg()
jwillemsen at remedy.nl
Thu Jan 17 12:48:12 CST 2008
The version you are using is ancient. When I check the svn head version the
Base_Thread_Adapter does check the pointer before using it. I would
recommend you to upgrade to x.6.2 and see if that works out of the box (I
would expect that). The patch you propose doesn't seem ok, you can use ACE
logging independently of ACE_NLOGGING.
2650 AC Berkel en Rodenrijs
www.theaceorb.nl / www.remedy.nl
*** Integrated compile and test statistics see
*** Commercial service and support for ACE/TAO/CIAO ***
*** See http://www.theaceorb.nl/en/support.html ***
"Steve Gury" <steve.gury at gmail.com> wrote in message
news:<mailman.3405.1200593192.5286.ace-users at mail.cse.wustl.edu>...
> ACE VERSION: 5.5
> HOST MACHINE and OPERATING SYSTEM:
> Windows XP 32 bits SP2, Winsock2
> TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
> COMPILER NAME AND VERSION (AND PATCHLEVEL):
> Windows XP 32 bits SP2, Winsock2, Visual Studio 2005 SP1
> THE $ACE_ROOT/ace/config.h FILE
> #define _WINSOCKAPI_ 1
> #define ACE_HAS_WINSOCK2 1
> #define ACE_SVC_HAS_DLL 1
> #define ACE_HAS_STRDUP_EMULATION
> #define ACE_HAS_WCSDUP_EMULATION
> #define ACE_USE_ONE_SHOT_AT_THREAD_EXIT 1
> #define ACE_NLOGGING 1
> #define ACE_THREADS_DONT_INHERIT_LOG_MSG 1
> #define ACE_HAS_LOG_MSG_NT_EVENT_LOG 1
> #define ACE_THREAD_MANAGER_USES_SAFE_SPAWN 1
> #define ACE_HAS_TSS_EMULATION 1
> #include "ace/config-win32.h"
> THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE:
> CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features
> AREA/CLASS/EXAMPLE AFFECTED:
> ACE_Base_Thread_Adapter::inherit_log_msg() crash
> DOES THE PROBLEM AFFECT:
> On Unix systems, did you run make realclean first?
> OTHER (please specify)?
> Crash during execution
> I've disable ACE Log (as you can see in the config.h) by defining
> ACE_NLOGGING and ACE_THREADS_DONT_INHERIT_LOG_MSG, but when starting
> another thread with ACE, the thread crashs during initialization.
> The crash appears in ACE_Base_Thread_Adapter::inherit_log_msg (void)
> because inherit_log_msg_hook_ is not NULL. This hook has been set
> during ACE_Log_Msg construction, however I've disable ACE_Log_Msg
> usage with ACE_NLOGGING !!! So I think the best solution is to disable
> completely ACE_Log_Msg construction during Object_Manager::init(). I
> haven't found any problems with this approach, maybe somebody can
> confirm this?
> REPEAT BY:
> [What you did to get the error; include test program or session
> transcript if at all possible. ] Sorry, but this is not possible.
> SAMPLE FIX/WORKAROUND:
> In Object_Manager.cpp at init() function, surround ACE_Log_Msg
> initialization with NLOGGING check.
> # if !defined (ACE_NLOGGING)
> // Open the main thread's ACE_Log_Msg.
> if (0 == ACE_LOG_MSG)
> return -1;
> # endif
> It seems to work for me.
More information about the Ace-users