[Boost-bugs] [Boost C++ Libraries] #5363: Regex library crash

Subject: [Boost-bugs] [Boost C++ Libraries] #5363: Regex library crash
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-03-23 20:15:14


#5363: Regex library crash
----------------------------------+-----------------------------------------
 Reporter: philippeb8@… | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: regex
  Version: Boost 1.34.0 | Severity: Problem
 Keywords: |
----------------------------------+-----------------------------------------
 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.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5363>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC