Opened 4 years ago

Closed 4 years ago

#8843 closed Bugs (fixed)

bugs: xpressive: assertion begin!=end fails, instead of throwing an exception

Reported by: richelbilderbeek@… Owned by: Eric Niebler
Milestone: To Be Determined Component: xpressive
Version: Boost 1.54.0 Severity: Problem
Keywords: xpressive debug release Cc:


When a defect string ("\d{4} [") is compiled to be a sregex, then an assertion fails, instead of an exception being thrown. This is only in debug mode: in release mode, an exception is thrown as expected.

The full error message:

Assertion failed!

Program: myfolder/myexe.exe
File: myfolder/boost_1_54_0/boost/xpressive/detail/dynamic/parse_charset.hpp, Line 201

Expression: begin != end

The full code:

#include <iostream>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#include <boost/xpressive/xpressive.hpp>
#pragma GCC diagnostic pop

int main()
    boost::xpressive::sregex::compile("\\d{4} [");
  catch (boost::xpressive::regex_error& e)
    std::cout << "OK\n";
    return 0;
  return 1;

The Qt Creator project file:

CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += main.cpp
QMAKE_CXXFLAGS += -std=c++11 -Wall -Wextra -Werror


CONFIG(release, debug|release) {


  • Operating system: Windows Windows XP
  • IDE: Qt Creator 2.7.2
  • Project type: Console application
  • C++ standard: C++11
  • Compiler(s): G++ 4.8.0
  • Library used: Boost: version 1.54.0

The full Qt Creator project is added to this ticket.

Thanks for Boost.Xpressive!

Richel Bilderbeek

Attachments (1) (3.5 KB) - added by richelbilderbeek@… 4 years ago.
CppRuntimeErrorAssertionFailedXpressiveDetailDynamicParse_charset201 error

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by richelbilderbeek@…

CppRuntimeErrorAssertionFailedXpressiveDetailDynamicParse_charset201 error

comment:1 Changed 4 years ago by Eric Niebler

Status: newassigned

Oh huh. Sounds like a bug. Thanks for the report. I'll look into it.

comment:2 Changed 4 years ago by Eric Niebler

(In [85118]) throw instead of assert at incomplete charset, refs #8843

comment:3 Changed 4 years ago by Eric Niebler

Resolution: fixed
Status: assignedclosed

(In [85427]) merge [85118],[85119],[85120],[85121] from trunk; fixes #8843, fixes #8880, fixes #8882, fixes #8474

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Eric Niebler.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.