id summary reporter owner description type status milestone component version severity resolution keywords cc 2048 exception when I create boost::RegEx in destructor code flow Boris John Maddock "Hello! I use VC++ 2005 (sp1), boost 1_35_0 See ** line. I have an exception at this point. This function (CTradeHourScheduler::IniFileName()) is used many time in my code. No any errors while programm init or while I use boost::RegEx in a programm flow. But, I see an exception when I create boost::RegEx while destructuor of some object is called. ""Unhandled exception at 0x00470301 in TQServerII.exe: 0xC0000005: Access violation reading location 0x00000004."" No memory leek. When I disable this function call I see no memory leek too. Can I use boost::RegEx in destructon? Thank you! Boris. CString CTradeHourScheduler::IniFileName(){ TCHAR cTmpBuff[2000]={0}; GetModuleFileName(NULL,cTmpBuff,2000); CString sAppPath=cTmpBuff; boost::RegEx Sometest; ** Sometest.SetExpression(CT2A(_T(""^(.*)\\\\[^\\\\]+$""))); I have got an exception at this point while it is called from destructor // std::string CString strAppDir; Sometest.Match(CT2A(cTmpBuff)); .... } Debugger call sack is here: TQServerII.exe!std::_Tree const >,unsigned long const *>,std::allocator const >,unsigned long const *> > >::_Iterator<1>,std::less,std::allocator const >,unsigned long const *>,std::allocator const >,unsigned long const *> > >::_Iterator<1> > >,0> >::_Lbound(const unsigned long & _Keyval=1049) Line 1170 + 0x8 bytes C++ TQServerII.exe!std::_Tree const >,unsigned long const *>,std::allocator const >,unsigned long const *> > >::_Iterator<1>,std::less,std::allocator const >,unsigned long const *>,std::allocator const >,unsigned long const *> > >::_Iterator<1> > >,0> >::lower_bound(const unsigned long & _Keyval=1049) Line 987 + 0x10 bytes C++ TQServerII.exe!std::_Tree const >,unsigned long const *>,std::allocator const >,unsigned long const *> > >::_Iterator<1>,std::less,std::allocator const >,unsigned long const *>,std::allocator const >,unsigned long const *> > >::_Iterator<1> > >,0> >::find(const unsigned long & _Keyval=1049) Line 961 + 0x10 bytes C++ TQServerII.exe!boost::object_cache >::do_get(const unsigned long & k=1049, unsigned int max_cache_size=5) Line 92 + 0x12 bytes C++ > TQServerII.exe!boost::object_cache >::get(const unsigned long & k=1049, unsigned int max_cache_size=5) Line 69 + 0x11 bytes C++ TQServerII.exe!boost::re_detail::create_w32_regex_traits(unsigned long l=1049) Line 554 + 0xf bytes C++ TQServerII.exe!boost::w32_regex_traits::w32_regex_traits() Line 573 + 0x16 bytes C++ TQServerII.exe!boost::regex_traits >::regex_traits >() Line 75 + 0xf bytes C++ TQServerII.exe!boost::regex_traits_wrapper > >::regex_traits_wrapper > >() Line 169 + 0xf bytes C++ TQServerII.exe!boost::re_detail::regex_data > >::regex_data > >() Line 61 + 0x4a bytes C++ TQServerII.exe!boost::re_detail::basic_regex_implementation > >::basic_regex_implementation > >() Line 93 + 0xf bytes C++ TQServerII.exe!boost::basic_regex > >::do_assign(const char * p1=0x0012ede0, const char * p2=0x0012edee, unsigned int f=262144) Line 525 + 0x22 bytes C++ TQServerII.exe!boost::basic_regex > >::assign(const char * p1=0x0012ede0, const char * p2=0x0012edee, unsigned int f=262144) Line 263 C++ TQServerII.exe!boost::basic_regex > >::assign(const char * p=0x0012ede0, unsigned int f=262144) Line 248 C++ TQServerII.exe!boost::basic_regex > >::set_expression(const char * p=0x0012ede0, unsigned int f=0) Line 467 C++ TQServerII.exe!boost::RegEx::SetExpression(const char * p=0x0012ede0, bool icase=false) Line 177 + 0x13 bytes C++ *** TQServerII.exe!CTradeHourScheduler::IniFileName() Line 81 + 0x3f bytes C++ TQServerII.exe!CTradeHourScheduler::SaveData() Line 28 + 0xc bytes C++ TQServerII.exe!CTradeHourScheduler::~CTradeHourScheduler() Line 25 C++ TQServerII.exe!CTradeHourScheduler::`scalar deleting destructor'() + 0xf bytes C++ TQServerII.exe!CTQServerIIApp::~CTQServerIIApp() Line 104 + 0x22 bytes C++ TQServerII.exe!`dynamic atexit destructor for 'theApp''() + 0xd bytes C++ msvcr80d.dll!doexit(int code=20, int quick=0, int retcaller=0) Line 553 C msvcr80d.dll!exit(int code=20) Line 398 + 0xd bytes C TQServerII.exe!__tmainCRTStartup() Line 610 C TQServerII.exe!wWinMainCRTStartup() Line 414 C KERNEL32.DLL!7c4e87f5() [Frames below may be incorrect and/or missing, no symbols loaded for KERNEL32.DLL] " Bugs closed To Be Determined regex Boost 1.35.0 Problem invalid exception SetExpression boris_k@…