Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#6433 closed Bugs (worksforme)

Problem in the release mode with the Boost::Regex::Regex_match and search

Reported by: legi0n69@… Owned by: John Maddock
Milestone: To Be Determined Component: regex
Version: Boost 1.48.0 Severity: Problem
Keywords: Cc:

Description

#include "boost/regex.hpp" Problem:

boost::regex rx("Hello word"); if(boost::regex_search(iFileName, rx)) access violation {

....

}

walk around: #include "boost/tr1/regex.hpp" std::tr1::regex rx("Hello world");

if(std::tr1::regex_search(iFileName, rx)) {

result = true;

}

Change History (5)

comment:1 by anonymous, 11 years ago

Fairly obviously this works for me, and is the sort of thing we test all the time.

Please provide:

  • The compiler and platform used.
  • A reduced self contained test case that allows us to reproduce the issue.

Also note that normally, odd issues like this are caused by a binary incompatibility between the regex lib and your executable (ie different build options used for each), so please check that if you're able.

comment:2 by John Maddock, 10 years ago

Resolution: worksforme
Status: newclosed

Closed pending further information.

comment:3 by s.a.h., 10 years ago

I am facing the same problem. I am using Intel 11.1 compiler and boost 1.51. It's crashing only in Release mode. It works fine with boost 1.45.

comment:4 by s.a.h., 10 years ago

The problem is happening on Windows only.

Anyone knows what is the difference in regex lib in boost 1.45c and 1.51?

comment:5 by John Maddock, 10 years ago

Anyone knows what is the difference in regex lib in boost 1.45c and 1.51?

Very little other than some almost-trivial bug fixes. There may well be changes to the Regex lib's dependencies though.

I just tried running the regex lib regression tests with Intel-11.1 and Intel-12.1 in release mode (Win32), and all the tests pass for me here.

Suggest the problem is likely to be:

1) Linking to the wrong .lib file (are you using the auto-linking support?) 2) Incorrect include path pulling in the wrong Boost version when you switched to release mode. 3) Some other compiler option used in release mode that results in code binary-incompatible with the .lib's.

You could try:

1) cd into libs/regex/test and do a "bjam toolset=intel release" and make sure the tests pass on your machine with your specific Intel revision. 2) If you can't spot the error from the suggestions above, try defining BOOST_REGEX_NO_LIB in your project settings and adding libs/regex/src/*.cpp direct to your projects source files.

HTH, John Maddock.

Note: See TracTickets for help on using tickets.