Subject: [Boost-bugs] [Boost C++ Libraries] #2143: regex_search failes (exception: Memory exhausted)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-07-24 11:20:43
#2143: regex_search failes (exception: Memory exhausted)
--------------------------+-------------------------------------------------
Reporter: anonymous | Owner: johnmaddock
Type: Bugs | Status: new
Milestone: Boost 1.36.0 | Component: regex
Version: Boost 1.35.0 | Severity: Problem
Keywords: |
--------------------------+-------------------------------------------------
Sorry for using Japanese.
In this code, boost::regex_search() failes and throws Exception(Memory
exhausted).
I tried both VC++7.1/VC++8.0.
I remember boost 1.33, 1.34, 1.35 gave the same result, but
I don't know why.
I think, using back-reference and relatively long input line tends to
result in this kind of failure.
{{{
#include <iostream>
#include <string>
#include <boost/regex.hpp>
int main()
{
boost::wregex re(L"(.+)ï¼»ï¼ã\\1ãã«åç¹ï¼½");
std::wstring s =
L"ã女ã¯ããã¦å¸°ã£ã¦æ¥ãï¼»ï¼ã帰ã£ã¦æ¥ããã¯åºæ¬ã§ã¯ã帰ã£ãæ¥ããï¼½ã"
L"ä»åº¦ã¯æ£é¢ãè¦ãããä¸åéã®å¼å½ã¯ãããã¾ãããã§ããã"
L"ä¸ãåãã¦ä¸çæ¸å½ã«ç®¸ãã¯ãããçªã£è¾¼ãã§äºå£ä¸å£ã»ãã°ã£ããã"
L"女ã¯ãã©ããã¾ã å
ã®å¸ã¸å¸°ããªããããã"
L"ãããã¨æã£ã¦ãã²ããã¨ç®ãä¸ãã¦è¦ãã¨ãã£ã±ãæ£é¢ã«ç«ã£ã¦ããã"
L"ãããä¸åéãç®ãä¸ããã¨åæã«å¥³ã¯åãã ããã"
L"ãã ä¸åéã®æ¨ªãéã£ã¦ãèªåã®åº§ã¸å¸°ãã¹ãã¨ããããããã¨åã¸æ¥ã¦ã"
L"ããã ã横ã¸åãã¦ãçªããé¦ãåºãã¦ãéãã«å¤ããªããã ããã"
L"風ãå¼·ãããã£ã¦ã鬢ãã³ããããµããµãããã¨ãããä¸åéã®ç®ã«ã¯ãã£ãã"
L"ãã®æä¸åéã¯ããã«ãªã£ãå¼å½ã®æãããããåãã£ã±ãã«çªããã»ããåºããã"
L"女ã®çªã¨ä¸åéã®çªã¯ä¸è»ããã®é£ã§ãã£ãã"
L"風ã«éãã£ã¦ãªããæã®èããµãããç½ãèããã©ã£ãããã«è¦ããæã"
L"ä¸åéã¯ã¨ãã ãã¨ãããã®ãã¨æ°ãã¤ãã¦ããµã¨å¥³ã®é¡ãè¦ãã"
L"é¡ã¯ããã«ãåè»ã®å¤ã«åºã¦ããã"
L"ããã©ãã女ã¯éãã«é¦ãå¼ã£è¾¼ãã¦æ´ç´ãããããã®ãã³ã±ãã§"
L"é¡ã®ã¨ãããä¸å¯§ã«ãµãå§ããã"
L"ä¸åéã¯ã¨ããããããã¾ãã»ããå®å
¨ã ã¨èããã"
L"ãããããªãããã¨è¨ã£ãã";
try {
boost::wsmatch what;
boost::regex_search(s, what, re);
} catch (const std::exception& ex) {
std::cerr << "Caught exception: " << ex.what() <<
std::endl;
}
return 0;
}
}}}
-- Ticket URL: <http://svn.boost.org/trac/boost/ticket/2143> 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:49:58 UTC