Boost C++ Libraries: Ticket #12300: boost::smatch::suffix() bug https://svn.boost.org/trac10/ticket/12300 <p> Hello, </p> <p> regex are broken in my app after a compil on Ubuntu Xenial (libboost_regex1.58.0). The app was working fine on Ubuntu trusty (libboost_regex1.54). </p> <p> Here follows the minimal code snippet (boostrebug.cpp). </p> <p> compile: </p> <p> g++ -g boostrebug.cpp -l boost_regex </p> <p> run: ./a.out </p> <p> The assertion fails on Ubuntu Xenial. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12300 Trac 1.4.3 Pascal Séguy <pascal.seguy@…> Fri, 24 Jun 2016 15:08:06 GMT attachment set https://svn.boost.org/trac10/ticket/12300 https://svn.boost.org/trac10/ticket/12300 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boostrebug.cpp</span> </li> </ul> Ticket John Maddock Fri, 24 Jun 2016 17:10:23 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/12300#comment:1 https://svn.boost.org/trac10/ticket/12300#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> There's a nasty bug in your program - it's referencing dangling iterators. </p> <p> Remember that boost::smatch holds iterators into the string that you're matching against, as soon as you assign a new value to variable "comm" then all the iterators stored in "match" are now invalid. Your program is now entitled to crash in any way it chooses. </p> <p> This is not new behaviour: it has always been this, and is by design as holding iterators is so much efficient than strings. </p> Ticket