Re: [Boost-bugs] [Boost C++ Libraries] #3936: [xpressive] stack overflow.

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3936: [xpressive] stack overflow.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-02-17 00:06:35


#3936: [xpressive] stack overflow.
----------------------------------+-----------------------------------------
 Reporter: shewitt.au@… | Owner: eric_niebler
     Type: Bugs | Status: assigned
Milestone: Boost 1.43.0 | Component: xpressive
  Version: Boost 1.42.0 | Severity: Problem
 Keywords: |
----------------------------------+-----------------------------------------
Changes (by eric_niebler):

  * status: new => assigned

Comment:

 This is a known problem with xpressive's implementation. All I can say is:
 don't do that. I'll leave the bug open, but I'm sorry to say that it's
 unlikely to ever be fixed. Due to the nested regex, there are simply too
 many states in this regular expression and the algorithm runs out of stack
 space. As a small consolation, on MSVC, xpressive traps the stack
 overflow, resets the stack guard page, and throws an exception which you
 can handle. I understand this is not ideal.

 There are other things you can do to avoid the trouble. Don't use nested
 regexes needlessly. In your case, you can simply rewrite the regex as:

 {{{
     // Doesn't blow the stack
     sregex rx2 = +~(set='{', '}', ',');
 }}}

 You can also use the linker's /STACK switch to give threads in your
 process more stack space. The default is really quite low.

 Sorry I don't have a better answer for you.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3936#comment:1>
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:02 UTC