Hi all,
Has anyone had troubles with using wregex? regex works fine for me. Here is
the stack dump.
001B:78144D3A MSVCR80.dll, memcpy()+90 byte(s)
001B:7817FEF5 MSVCR80.dll, memcpy_s()+72 byte(s)
001B:7C421201 MSVCP80.dll, std::char_traits<char>::_Copy_s()+21 byte(s)
001B:7C4237EF MSVCP80.dll,
std::basic_string ::append()+145 byte(s) 001B:7C434713 MSVCP80.dll,
??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@0@Z()+45
byte(s)
001B:01EDF959 test.exe,
boost::re_detail::w32_regex_traits_char_layer ::do_get()+838 byte(s),
h:\backup\boost_1_33_1\boost\regex\pending\object_cache.hpp, line 118+46
byte(s) 001B:01EC3D6F test.exe, boost::object_cache ::regex_traits 001B:01EBF70F test.exe,
boost::regex_traits_wrapper ::regex_traits_wrapper ()+15 byte(s), h:\backup\boost_1_33_1\boost\regex\v4\regex_traits.hpp, line 162+15 byte(s)
001B:01EBF44A test.exe,
boost::re_detail::regex_data ::regex_data ()+74 byte(s), h:\backup\boost_1_33_1\boost\regex\v4\basic_regex.hpp, line 54+74 byte(s)
001B:01EBE8BF test.exe,
boost::re_detail::basic_regex_implementation ::basic_regex_implementation ()+15 byte(s), h:\backup\boost_1_33_1\boost\regex\v4\basic_regex.hpp, line 85+15 byte(s)
001B:01EB29E5 test.exe,
boost::basic_regex ::do_assign()+101 byte(s),
h:\backup\boost_1_33_1\boost\regex\v4\basic_regex.hpp, line 517+34 byte(s) 001B:0152E48B test.exe,
boost::basic_regex ::assign()+27 byte(s),
d:\usr\local\include\boost\regex\v4\basic_regex.hpp, line 255 001B:0152E2EA test.exe,
boost::basic_regex ::assign()+42 byte(s),
d:\usr\local\include\boost\regex\v4\basic_regex.hpp, line 240 Using boost 1_33_1
Thanks in advance.
Alan
Hi John, I'll try to put togeather a sample today. The same code works for ansi. Thanks in advance, Alan
From: "John Maddock"
Reply-To: boost-users@lists.boost.org To: Subject: Re: [Boost-users] Regex crash Date: Wed, 9 Aug 2006 17:08:32 +0100 Alan Gray wrote:
Hi all,
Has anyone had troubles with using wregex? regex works fine for me. Here is the stack dump.
Dangling pointer maybe? Otherwise please try and produce a test case.
Many thanks, John. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hi John, I cannot reproduce the problem in a sample program (yet). The symptions appear to be stack corruption. In the function template <class charT> w32_regex_traits_char_layer<charT>::w32_regex_traits_char_layer(::boost::re_detail::lcid_type l) : w32_regex_traits_base<charT>(l) { line 187: w32_regex_traits.hpp the line std::string cat_name(w32_regex_traits<charT>::get_catalog_name()); executes ok, looking at the debugger, _Mysize = 0 , _Myres = 15 which is expected. Then stepping into if(cat_name.size()) inside the call, _mysize is now equal to some crazy number. The interesting point is that the debugger steps to the line return (_Mysize); and bypasses the line above being { // return length of sequence In the sample program, the debugger always steps onto the { line, then the return line. So at this point, something has lost the plot. To try to narrow down the problem, I put the call to the wregex as the first lines in the program. In theory, no corruption of any memory should have occured during void __cdecl _initterm ( initialisation. As a test, I am downloading another regular expression class to see what happens. I have run with Compuware Bounds Checker, and every other trick I know, and there just does not seem to be any memory corruption, dangling pointers or anything. It's driving me mad, but I realise without a sample program showing the problem, neither can you. Regards, Alan
From: "John Maddock"
Reply-To: boost-users@lists.boost.org To: Subject: Re: [Boost-users] Regex crash Date: Wed, 9 Aug 2006 17:08:32 +0100 Alan Gray wrote:
Hi all,
Has anyone had troubles with using wregex? regex works fine for me. Here is the stack dump.
Dangling pointer maybe? Otherwise please try and produce a test case.
Many thanks, John. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Alan Gray wrote:
Hi John,
I cannot reproduce the problem in a sample program (yet). The symptions appear to be stack corruption. In the function
template <class charT> w32_regex_traits_char_layer<charT>::w32_regex_traits_char_layer(::boost::re_detail::lcid_type l) : w32_regex_traits_base<charT>(l) {
line 187: w32_regex_traits.hpp
the line
std::string cat_name(w32_regex_traits<charT>::get_catalog_name());
executes ok, looking at the debugger, _Mysize = 0 , _Myres = 15 which is expected. Then stepping into
if(cat_name.size())
inside the call, _mysize is now equal to some crazy number. The interesting point is that the debugger steps to the line
The only thing that springs to mind is a binary compartibitity issue: either linking to the wrong regex lib build, multiple std lib's linked to your app, or some obscure compiler option that's rendered the prebuilt lib's incompatible with your app. As a quick test try adding the regex source directly to your project and building with BOOST_REGEX_NO_LIB defined. (Note this will make your app a lot "fatter" than it needs to be, but it's a useful sanity check). HTH, John.
Hi John, Will give that a go. I also downloaded a prebuild from CERN and will give that a rip also. Our feelings also suggested wrong calling convention, or some clash of binary compatability problem. We kind of thought the test program would suffer the same fate. We have exactly the same compiler / linker flags. :-( The really strange thing is that we are trying all of this with VS2005, but the same code has the same problem in VC6 and a much earlier version of boost, but only in unicode. Config.hpp shows * Copyright (c) 1998-2000 and cregexw.hpp shows * LOCATION: see http://www.boost.org for most recent version. * FILE cregex.cpp * VERSION 3.12 * DESCRIPTION: Declares POSIX API functions * + boost::RegEx high level wrapper. Thanks in advance, Alan
From: "John Maddock"
Reply-To: boost-users@lists.boost.org To: Subject: Re: [Boost-users] Regex crash Date: Thu, 10 Aug 2006 09:56:00 +0100 Alan Gray wrote:
Hi John,
I cannot reproduce the problem in a sample program (yet). The symptions appear to be stack corruption. In the function
template <class charT>
w32_regex_traits_char_layer<charT>::w32_regex_traits_char_layer(::boost::re_detail::lcid_type
l) : w32_regex_traits_base<charT>(l) {
line 187: w32_regex_traits.hpp
the line
std::string cat_name(w32_regex_traits<charT>::get_catalog_name());
executes ok, looking at the debugger, _Mysize = 0 , _Myres = 15 which is expected. Then stepping into
if(cat_name.size())
inside the call, _mysize is now equal to some crazy number. The interesting point is that the debugger steps to the line
The only thing that springs to mind is a binary compartibitity issue: either linking to the wrong regex lib build, multiple std lib's linked to your app, or some obscure compiler option that's rendered the prebuilt lib's incompatible with your app. As a quick test try adding the regex source directly to your project and building with BOOST_REGEX_NO_LIB defined. (Note this will make your app a lot "fatter" than it needs to be, but it's a useful sanity check).
HTH, John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hi John The BOOST_REGEX_NO_LIB option works. So there is some sort of binary compatibi;lity problem or some problem with VS2005 linker. For now I'll live with a fatter program (it works) but I'll revisit this when I have some spare time (hah!). Hey thanks a lot. Regards, Alan
From: "John Maddock"
Reply-To: boost-users@lists.boost.org To: Subject: Re: [Boost-users] Regex crash Date: Thu, 10 Aug 2006 09:56:00 +0100 Alan Gray wrote:
Hi John,
I cannot reproduce the problem in a sample program (yet). The symptions appear to be stack corruption. In the function
template <class charT>
w32_regex_traits_char_layer<charT>::w32_regex_traits_char_layer(::boost::re_detail::lcid_type
l) : w32_regex_traits_base<charT>(l) {
line 187: w32_regex_traits.hpp
the line
std::string cat_name(w32_regex_traits<charT>::get_catalog_name());
executes ok, looking at the debugger, _Mysize = 0 , _Myres = 15 which is expected. Then stepping into
if(cat_name.size())
inside the call, _mysize is now equal to some crazy number. The interesting point is that the debugger steps to the line
The only thing that springs to mind is a binary compartibitity issue: either linking to the wrong regex lib build, multiple std lib's linked to your app, or some obscure compiler option that's rendered the prebuilt lib's incompatible with your app. As a quick test try adding the regex source directly to your project and building with BOOST_REGEX_NO_LIB defined. (Note this will make your app a lot "fatter" than it needs to be, but it's a useful sanity check).
HTH, John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Alan Gray wrote:
Hi John
The BOOST_REGEX_NO_LIB option works. So there is some sort of binary compatibi;lity problem or some problem with VS2005 linker.
For now I'll live with a fatter program (it works) but I'll revisit this when I have some spare time (hah!).
Strange. The obvious quick fix is to build as a static lib from inside your IDE using whatever options your program uses. Then your program won't be so fat - although as the VC linker strips out unused symbols that may not be an issue actually? John.
Hi again, In w32_regex_traits.hpp, on line 681, it appears the static std::string s_name is having something strange happen. I keep pressing F11, and after s_name constructor is called, another f11 steps into a C runtime function atexit. Maybe this is correct, but I thought all static variables are initalised at startup, and before main / wmain is called. R Alan
From: "John Maddock"
Reply-To: boost-users@lists.boost.org To: Subject: Re: [Boost-users] Regex crash Date: Fri, 11 Aug 2006 14:03:16 +0100 Alan Gray wrote:
Hi John
The BOOST_REGEX_NO_LIB option works. So there is some sort of binary compatibi;lity problem or some problem with VS2005 linker.
For now I'll live with a fatter program (it works) but I'll revisit this when I have some spare time (hah!).
Strange. The obvious quick fix is to build as a static lib from inside your IDE using whatever options your program uses. Then your program won't be so fat - although as the VC linker strips out unused symbols that may not be an issue actually?
John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Actually, looking at the argument passed into atexit, it is a function to call s_name's desructor so I guess it is ok. rats, another dead end pipe..... R Alan
From: "John Maddock"
Reply-To: boost-users@lists.boost.org To: Subject: Re: [Boost-users] Regex crash Date: Fri, 11 Aug 2006 14:03:16 +0100 Alan Gray wrote:
Hi John
The BOOST_REGEX_NO_LIB option works. So there is some sort of binary compatibi;lity problem or some problem with VS2005 linker.
For now I'll live with a fatter program (it works) but I'll revisit this when I have some spare time (hah!).
Strange. The obvious quick fix is to build as a static lib from inside your IDE using whatever options your program uses. Then your program won't be so fat - although as the VC linker strips out unused symbols that may not be an issue actually?
John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Alan Gray
-
John Maddock