[regex] "EXC_BAD_ACCESS" when iterating over smatch captures
All: I'm trying to run the captures example included in the Boost.Regex documentation. When running the captures example verbatim, I get: "Program received signal: "EXC_BAD_ACCESS"." This is happening on Mac OS X 10.4.6 (Intel) with Boost 1.33.1. This problem seems to be related to the definition of BOOST_REGEX_MATCH_EXTRA - if I don't use captures and leave the macro undefined, other regex functions work fine.
From gdb:
(gdb) backtrace
#0 0x00003ad4 in boost::sub_match<__gnu_cxx::__normal_iterator
Christopher Hart wrote:
All:
I'm trying to run the captures example included in the Boost.Regex documentation. When running the captures example verbatim, I get: "Program received signal: "EXC_BAD_ACCESS"."
This is happening on Mac OS X 10.4.6 (Intel) with Boost 1.33.1. This problem seems to be related to the definition of BOOST_REGEX_MATCH_EXTRA - if I don't use captures and leave the macro undefined, other regex functions work fine.
In order to use the extended capture information then you must define BOOST_REGEX_MATCH_EXTRA: *both when building your application, and when building the regex lib* If you're linking against the standard bjam built lib's then this won't work: the lib's won't be binary compatible with the BOOST_REGEX_MATCH_EXTRA option. Yes I no this is a pain, but it's a feature that has costs, so I don't want to enable it by default. John.
When I received the error, BOOST_REGEX_MATCH_EXTRA was defined both at
my program's compile time and when in user.hpp when I built boost.
Based on my vauge understanding of that error, my impression was that
it was attempting to read memory that had already been de-allocated.
Is that consistent with a missing definition (either when the library
was built or at my program's compile time)? Or am I missing
something?
Thanks,
Chris
On 5/23/06, John Maddock
Christopher Hart wrote:
All:
I'm trying to run the captures example included in the Boost.Regex documentation. When running the captures example verbatim, I get: "Program received signal: "EXC_BAD_ACCESS"."
This is happening on Mac OS X 10.4.6 (Intel) with Boost 1.33.1. This problem seems to be related to the definition of BOOST_REGEX_MATCH_EXTRA - if I don't use captures and leave the macro undefined, other regex functions work fine.
In order to use the extended capture information then you must define BOOST_REGEX_MATCH_EXTRA:
*both when building your application, and when building the regex lib*
If you're linking against the standard bjam built lib's then this won't work: the lib's won't be binary compatible with the BOOST_REGEX_MATCH_EXTRA option. Yes I no this is a pain, but it's a feature that has costs, so I don't want to enable it by default.
John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Actually, I stand corrected. Just to be sure, I did a clean and
re-built and it's working now. Mia culpa! Thanks for the
information.
Chris
On 5/23/06, Christopher Hart
When I received the error, BOOST_REGEX_MATCH_EXTRA was defined both at my program's compile time and when in user.hpp when I built boost. Based on my vauge understanding of that error, my impression was that it was attempting to read memory that had already been de-allocated. Is that consistent with a missing definition (either when the library was built or at my program's compile time)? Or am I missing something?
Thanks, Chris
On 5/23/06, John Maddock
wrote: Christopher Hart wrote:
All:
I'm trying to run the captures example included in the Boost.Regex documentation. When running the captures example verbatim, I get: "Program received signal: "EXC_BAD_ACCESS"."
This is happening on Mac OS X 10.4.6 (Intel) with Boost 1.33.1. This problem seems to be related to the definition of BOOST_REGEX_MATCH_EXTRA - if I don't use captures and leave the macro undefined, other regex functions work fine.
In order to use the extended capture information then you must define BOOST_REGEX_MATCH_EXTRA:
*both when building your application, and when building the regex lib*
If you're linking against the standard bjam built lib's then this won't work: the lib's won't be binary compatible with the BOOST_REGEX_MATCH_EXTRA option. Yes I no this is a pain, but it's a feature that has costs, so I don't want to enable it by default.
John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Christopher Hart
-
John Maddock