Regression testing on win32 platforms

Hi all, With regards to regression testing of boost libraries on the win32 platform using MSVC versions post introduction of checked iterators, are any of the regression tests compiled with the following defines? _SCL_SECURE_NO_WARNINGS _SECURE_SCL=0 As I've noticed MSVC installs with SP1 that have had patches included from the last month or so are causing this failure. #include <cstddef> #include <iostream> #include <string> #include <boost/regex.hpp> int main() { using namespace boost; std::string s = "(1)(23)(456)(7890)"; regex expr("\\(.*?\\)"); sregex_iterator itr(s.begin(),s.end(),expr); sregex_iterator it_end; std::string token; std::size_t match_count = 0; while (it_end != itr) { ++itr; ++match_count; } std::cout << "Match count: " << match_count << std::endl; return 0; } ************************************************** example.exe!_crt_debugger_hook(int _Reserved=3619112) Line 65 C example.exe!_invalid_parameter(const wchar_t * pszExpression=0x00000000, const wchar_t * pszFunction=0x00000000, const wchar_t * pszFile=0x00000000, unsigned int nLine=0, unsigned int pReserved=0) Line 112 + 0x7 bytes C++ example.exe!_invalid_parameter_noinfo() Line 125 + 0xc bytes C++ example.exe!boost::match_results<std::_String_const_iterator<char,std::char_traits<char>,std::allocator<char> >,std::allocator<boost::sub_match<std::_String_const_iterator<char,std::char_traits<char>,std::allocator<char> > > > >::set_size() + 0x5b bytes C++ example.exe!boost::re_detail::perl_matcher<std::_String_const_iterator<char,std::char_traits<char>,std::allocator<char> >,std::allocator<boost::sub_match<std::_String_const_iterator<char,std::char_traits<char>,std::allocator<char> > > >,boost::regex_traits<char,boost::w32_regex_traits<char> > >::find_imp() + 0xc9 bytes C++ ************************************************** Removing SP1 or applying SP1 with patches up until mid nov '09 slip-streamed seems to work fine, this is just a heads up for people using this particular environment. Initially I was using the BOOST Pro distribution, with static linking (1.39 and 1.40) MT and single modes, I've also done clean builds just in case something was wrong with the distrib, same problem observed in all cases. I've tested the above code on linux with gcc 4.4 and intel v11 runs fine and valgrind checks-out ok (as expected). BTW I've gone here http://www.boost.org/development/testing.html looking for any kind of documentation relating to the types of settings used, is there a more up-to-date location? Kind regards, Arash

With regards to regression testing of boost libraries on the win32 platform using MSVC versions post introduction of checked iterators, are any of the regression tests compiled with the following defines?
That example works OK for me here with: Microsoft Visual Studio 2008 Version 9.0.30729.1 SP Which specific MSVC version are you using? Also note that some of those #defines will change the ABI of the C++ std lib - so the regex lib (or any other lib for that matter), should always be built with the same #defines that will be used in the program. Regards, John.

Thanks for the reply John, John Maddock wrote:
That example works OK for me here with:
Microsoft Visual Studio 2008 Version 9.0.30729.1 SP
Which specific MSVC version are you using?
Here are my details: VS2008 Team, SP1 Command Line: /O2 /Oi /Ot /GL /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "NOMINMAX" /D "_SCL_SECURE_NO_WARNINGS" /D "_SECURE_SCL=0" /D "_UNICODE" /D "UNICODE" /FD /EHsc /MT /Gy /Fo"Release\\" /Fd"Release\vc90.pdb" /W4 /nologo /c /Zi /TP /errorReport:prompt In short a release mode build with _SECURE_SCL=0 should causes it to crash. static-linking or otherwise still causes it to crash.
Also note that some of those #defines will change the ABI of the C++ std lib - so the regex lib (or any other lib for that matter), should always be built with the same #defines that will be used in the program.
You are absolutely correct and that is what I've done (added new defs to bjam build script), and in all cases this crash still occurs. I'd like to clarify that I'm not saying this is a BOOST issue, I'm just wondering if the regression tests have a mode where this particular define is being used - as it seems necessary to have it in when building in release mode if performance is important. Regards, Arash
participants (2)
-
Arash Partow
-
John Maddock