Opened 12 years ago

Closed 12 years ago

#5363 closed Bugs (worksforme)

Regex library crash

Reported by: philippeb8@… Owned by: John Maddock
Milestone: To Be Determined Component: regex
Version: Boost 1.34.0 Severity: Problem
Keywords: Cc:

Description

On Cygwin if we link to the gcc version of the regex library, regex_match will cause a crash. The following code: #include <iostream> #include <vector> #include <string> #include <boost/regex.hpp>

using namespace std;

int main(int argc, char argv) {

boost::regex re; boost::cmatch matches;

boost::regex_match("abc", matches, re.assign("(a)bc"));

return 0;

}

Compiled with: g++ regex.cpp -lboost_regex-gcc-mt

Will crash with the following backtrace: #0 0x6961deb0 in cygboost_regex-gcc-mt-1_33_1!_ZNK5boost9re_detail31cpp_regex_traits_implementationIcE20lookup_classname_impEPKcS4_ ()

from /usr/bin/cygboost_regex-gcc-mt-1_33_1.dll

#1 0x69607bc8 in cygboost_regex-gcc-mt-1_33_1!_ZN5boost9re_detail12perl_matcherIPKcSaINS_9sub_matchIS3_EEENS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE14construct_initERKNS_11basic_regexIcSA_EENS_15regex_constants12_match_flagsE ()

from /usr/bin/cygboost_regex-gcc-mt-1_33_1.dll

#2 0x0040781a in perl_matcher (this=0x22c110, first=0x40b11a "abc",

end=0x40b11d "", what=@0x22ccd4, e=@0x22cd00, f=boost::regex_constants::match_default, l_base=0x40b11a "abc") at /usr/include/boost/regex/v4/perl_matcher.hpp:371

#3 0x00401d5b in boost::regex_match<char const*, std::allocator<boost::sub_match<char const*> >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > (first=0x40b11a "abc", last=0x40b11d "", m=@0x22ccd4, e=@0x22cd00,

flags=boost::regex_constants::match_default) at /usr/include/boost/regex/v4/regex_match.hpp:49

#4 0x00401df2 in boost::regex_match<char, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > > (

str=0x40b11a "abc", m=@0x22ccd4, e=@0x22cd00, flags=boost::regex_constants::match_default) at /usr/include/boost/regex/v4/regex_match.hpp:73

#5 0x0040127b in main () at regex.cpp:13

This is on Cygwin and the version of the library is: 1.33.1-4.

Change History (1)

comment:1 by John Maddock, 12 years ago

Resolution: worksforme
Status: newclosed

I tried this with the latest Cygwin packages (Boost-1.43) and it works just fine for me.

Note: See TracTickets for help on using tickets.