Hi Boost Users

 

I met a crash in following code after I upgrade from 1.44 to 1.74,

 

When I used “-O1 -DNDEBUG” to compile, it will crash.

But when  I used “-O1” or “-DNDEBUG” or “-O0 -DNDEBUG”, it will not crash.

In 1.44, all of them are ok.

 

My GCC version is 4.1.2 and test in redhat-AS 4 32 bit.

 

callstack

#0 at ./boost_1_74_0_bk/boost/xpressive/detail/static/transmogrify.hpp:160

160                 char const *name_end = m.name_ + std::strlen(m.name_);

#1  at ./boost_1_74_0_bk/boost/proto/transform/detail/preprocessed/fold_impl.hpp:80

#2  at ./boost_1_74_0_bk/boost/proto/transform/detail/preprocessed/fold_impl.hpp:80

#3  at ./boost_1_74_0_bk/boost/xpressive/detail/static/compile.hpp:79

#4  at ./boost_1_74_0_bk/boost/xpressive/detail/static/compile.hpp:99

#5  0x08049d5f in main () at ./boost_1_74_0_bk/boost/xpressive/basic_regex.hpp:252

 

Can you help to check this problem?

 

Best regards

Forston

 

callstack

 

Following is  source code.

#include <boost/xpressive/basic_regex.hpp>

#include <boost/xpressive/regex_primitives.hpp>

#include <boost/xpressive/match_results.hpp>

#include <boost/xpressive/regex_algorithms.hpp>

 

int main(int argc, char* argv[])

{

    std::wstring uri_string = L"https://192.168.1.1/test";

    printf("begin regex_match  %ls \n ", uri_string.c_str());

 

    using namespace boost::xpressive;

    static wsregex const uri_regex = bos

            >> (s1 = (alpha >> *(alnum | L'+' | L'-' | L'.')))

            >> L"://" >> (s2 = *(alnum | L'-' | L'.' | L':' | L'@' | L'[' | L']' | L'_'))

            >> !(as_xpr(L'/')

            >> (s3 = (*_)))

            >> eos

            ;

 

    wsmatch result;

    try

    {

        if (!regex_match(uri_string, result, uri_regex))

        {

                printf( "regex_match failed %ls \n ",  uri_string.c_str());

                return -1;

        }

 

    }

    catch (std::exception& e)

    {

        printf("regex_match failed %ls \n ", uri_string.c_str());

        return -1;

    }

 

    printf("end regex_match success %ls \n ", uri_string.c_str());

    return 0;

}

TREND MICRO EMAIL NOTICE

The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.

For details about what personal information we collect and why, please see our Privacy Notice on our website at: Read privacy policy