Boost logo

Boost :

Subject: Re: [boost] [Log] Problem with Release mode build
From: Sivaram Kannan (siva.devel_at_[hidden])
Date: 2010-08-27 02:30:48


Single stepping I found the following line from the global macro

       sources::wseverity_logger_mt<> lg; <===================

is not creating the lg object at all. What is the problem in the
release mode?? As a summary of the problem,

* An exe build in debug/release mode is working properly.
* This application is a dll.
* The same dll is working properly in debug mode.

Thanks,
Siva.

On Fri, Aug 27, 2010 at 11:03 AM, Sivaram Kannan <siva.devel_at_[hidden]> wrote:
> Hi,
>
> On further investigation, I have narrowed down the issue to this line.
>
> sources::wseverity_logger_mt<> &lg = ::get_my_log();  <================
>
> This line is not returning the lg object from Global Macro.
>
> BOOST_LOG_DECLARE_GLOBAL_LOGGER_INIT(my_log, sources::wseverity_logger_mt<>)
> {
>        Log_Init();
>        sources::wseverity_logger_mt<> lg;
>        return lg;
> }
>
> This is not working properly only in release mode and working well in
> debug mode. Environment I am using is VC++ 2008. What am I missing??
>
> Thanks,
> Siva.
>
>
>
> On Thu, Aug 26, 2010 at 6:02 PM, Sivaram Kannan <siva.devel_at_[hidden]> wrote:
>> Hi,
>>
>> I have been using boost log with two of my projects, one an VC++ 2008
>> exe and another a VC++  DLL. Boost log was working as expected in the
>> Debug mode. But when I compiled the projects in release mode, the
>> boost log with the exe is not logging anything on the file and the dll
>> is creating an access violation. Following is the call stack which is
>> throwing the error.
>>
>> cnbc.dll!boost::log_mt_nt5::sources::basic_logger<wchar_t,boost::log_mt_nt5::sources::wseverity_logger_mt<int>,boost::log_mt_nt5::sources::multi_thread_model<boost::shared_mutex>
>>>::open_record_unlocked<boost::parameter::aux::tagged_argument<boost::log_mt_nt5::keywords::tag::severity,enum
>> severity const > >(const
>> boost::parameter::aux::tagged_argument<boost::log_mt_nt5::keywords::tag::severity,enum
>> severity const > & args={...})  Line 269 + 0x15 bytes C++
>> cnbc.dll!boost::log_mt_nt5::sources::basic_severity_logger<boost::log_mt_nt5::sources::basic_logger<wchar_t,boost::log_mt_nt5::sources::wseverity_logger_mt<int>,boost::log_mt_nt5::sources::multi_thread_model<boost::shared_mutex>
>>>,int>::open_record_unlocked<boost::parameter::aux::tagged_argument<boost::log_mt_nt5::keywords::tag::severity,enum
>> severity const > >(const
>> boost::parameter::aux::tagged_argument<boost::log_mt_nt5::keywords::tag::severity,enum
>> severity const > & args={...})  Line 226 + 0xc bytes   C++
>> cnbc.dll!boost::log_mt_nt5::sources::basic_composite_logger<wchar_t,boost::log_mt_nt5::sources::wseverity_logger_mt<int>,boost::log_mt_nt5::sources::multi_thread_model<boost::shared_mutex>,boost::mpl::vector1<boost::log_mt_nt5::sources::severity<int>
>>> >::open_record<boost::parameter::aux::tagged_argument<boost::log_mt_nt5::keywords::tag::severity,enum
>> severity const > >(const
>> boost::parameter::aux::tagged_argument<boost::log_mt_nt5::keywords::tag::severity,enum
>> severity const > & args={...})  Line 509 + 0x14 bytes        C++
>>
>> I have compiled the boost in release mode and as shared. Following is
>> the command I used.
>> ,
>> .\bjam.exe --with-log --with-filesystem --with-system --with-date_time
>> --with-thread --with-regex define=BOOST_ALL_DYN_LINK variant=release
>> link=shared stage
>>
>> What am i doing wrong here??
>>
>> Thanks,
>> Siva.
>>
>>
>>
>> .
>>
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk