Boost logo

Boost Users :

Subject: [Boost-users] [Regex] problems compiling with gcc 4.4
From: Aonghus Lawlor (thecolourblue_at_[hidden])
Date: 2008-12-08 11:52:52


Hi,

I am using boost 1.37 on osx from macports and I have a problem using the
regex library with gcc 4.4, although it seems to work perfectly with gcc 4.3
and 4.2.

The problem is with creating a boost::regex object- simple program below:

#include <boost/regex.hpp>
#include <string>

int main(int argc, char **argv)
{
  std::string s("(.*)bar|(.*)bah");
  boost::regex re_node(s);
  return 1;
}

The backtrace it produces is below:

(gdb) bt
#0 0x90d90b9e in __kill ()
#1 0x90d90b91 in kill$UNIX2003 ()
#2 0x90e07ec2 in raise ()
#3 0x90e1747f in abort ()
#4 0x0026792c in __gnu_cxx::__verbose_terminate_handler ()
#5 0x00265239 in __cxxabiv1::__terminate ()
#6 0x0026527d in std::terminate ()
#7 0x0026539c in __cxa_throw ()
#8 0x001eeb00 in std::__throw_bad_cast ()
#9 0x00370d25 in std::use_facet<std::messages<char> > ()
#10 0x00127c93 in boost::re_detail::cpp_regex_traits_base<char>::imbue () at
cpp_regex_traits.hpp:215
#11 regex_data [inlined] () at basic_regex.hpp:173
#12 basic_regex_implementation (this=0x500200) at cpp_regex_traits.hpp:93
#13 0x001256a6 in
shared_ptr<boost::re_detail::basic_regex_implementation<char,
boost::regex_traits<char, boost::cpp_regex_traits<char> > > > [inlined] ()
at shared_ptr.hpp:525
#14 boost::basic_regex<char, boost::regex_traits<char,
boost::cpp_regex_traits<char> > >::do_assign (this=0xbfffe790, p1=0x5001ec
"(.*)bar|(.*)bah", p2=0x5001fb "", f=0) at basic_regex.hpp:525
#15 0x00001d6a in boost::basic_regex<char, boost::regex_traits<char,
boost::cpp_regex_traits<char> > >::assign ()
#16 0x00001d3e in boost::basic_regex<char, boost::regex_traits<char,
boost::cpp_regex_traits<char> > >::assign<std::char_traits<char>,
std::allocator<char> > ()
#17 0x00001c9f in boost::basic_regex<char, boost::regex_traits<char,
boost::cpp_regex_traits<char> > >::basic_regex<std::char_traits<char>,
std::allocator<char> > ()
#18 0x00001b20 in main ()
(gdb)

Is this a problem with boost, or with the compiler? Any ideas for a fix?

many thanks,

a



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net