Boost logo

Boost-Build :

From: Jonathan Y. Walther (Jonathan.Y.Walther_at_[hidden])
Date: 2006-02-02 09:22:01

I am having problems building the Boost 1.33.1 libraries using gcc 4.0.2
on a Linux system. I have used boost:regex for years, but am upgrading
to gcc 4.

All builds appear to complete successfully, but even the simplest
program seg faults upon the first boost usage:

Sample program:

$ cat
#include <boost/regex.hpp>

int main (int argc, char *argv[])
  boost::regex setEvent_RE("Set");


$ REGEX_INC=/sps_home/play/install/include/boost-1_33_1
$ REGEX_LIB=/sps_home/play/install/lib/libboost_regex-gcc-d.a
$ g++ -I$REGEX_INC -c -o sp20.o
$ g++ -o sp20 sp20.o $REGEX_LIB -lstdc++


$ ./sp20
Segmentation fault

$ ldd ./sp20 => /usr/local/lib/ (0x40018000) => /lib/i686/ (0x40114000) => /usr/local/lib/ (0x40137000) => /lib/i686/ (0x40142000)
        /lib/ => /lib/ (0x40000000)

$ gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.0.2/configure --enable-languages=c++,f95,c
--prefix=/usr/local --with-gmp=/usr/local/
Thread model: posix
gcc version 4.0.2

Running in the debugger indicates a seg fault when the boost:regex
constuctor is executed. Here is a trace of the debug session:

[mpguser_at_speedy play]$ gdb ./sp20
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db
library "/lib/".

(gdb) run
Starting program: /mnt/60GB/sps_home/play/sp20

Program received signal SIGSEGV, Segmentation fault.
0x401cdd37 in __strxfrm_l () at strxfrm.c:99
99 strxfrm.c: No such file or directory.
        in strxfrm.c
gdb) backtrace
#0 0x401cdd37 in __strxfrm_l () at strxfrm.c:99
#1 0x40076965 in std::collate<char>::_M_transform (this=0x0, __to=0x0,
__from=0x0, __n=0) at
#2 0x400a179a in std::collate<char>::do_transform (this=0x400fd204,
__lo=0xbffff48a "a", __hi=0xbffff48b "")
#3 0x40097d57 in std::collate<char>::transform (this=0x2, __lo=0x0,
#4 0x0804e413 in
(this=0x807e3c8, p1=0xbffff48a "a", p2=0xbffff48b "")
#5 0x0804e706 in
char> (pt=0x807e3c8, delim=0x807e5d4 "")
#6 0x0805f064 in
#7 0x0806d331 in cpp_regex_traits_implementation (this=0x807e3c8,
#8 0x080700ca in
boost::re_detail::cpp_regex_traits_implementation<char> >::do_get (
    k=@0xbffff6b4, max_cache_size=5) at
#9 0x080707b9 in
boost::re_detail::cpp_regex_traits_implementation<char> >::get (
    k=@0xbffff6b4, max_cache_size=5) at
#10 0x080708dd in boost::re_detail::create_cpp_regex_traits<char>
#11 0x0807093a in cpp_regex_traits (this=0x807e358) at
#12 0x0807097f in regex_traits (this=0x807e358) at
#13 0x08070993 in regex_traits_wrapper (this=0x807e358) at
#14 0x080709b7 in regex_data (this=0x807e220) at
#15 0x08070a25 in basic_regex_implementation (this=0x807e220) at
#16 0x08070a6c in boost::basic_regex<char, boost::regex_traits<char,
boost::cpp_regex_traits<char> > >::do_assign (this=0xbffff840,
p1=0x80728e8 "Set",
    p2=0x80728eb "", f=0) at
#17 0x0804c048 in boost::basic_regex<char, boost::regex_traits<char,
boost::cpp_regex_traits<char> > >::assign ()
#18 0x0804c07d in boost::basic_regex<char, boost::regex_traits<char,
boost::cpp_regex_traits<char> > >::assign ()
#19 0x0804c0b6 in boost::basic_regex<char, boost::regex_traits<char,
boost::cpp_regex_traits<char> > >::basic_regex ()
#20 0x0804b037 in main ()

I have recreated this error on two different linux machines, and under
two versions of gcc (4.0.2 and 3.4.5).

I have built with and without BOOST_DISABLE_THREADS, and
-fvisibility=default to no avail. I have also built with the compiler
set in a non standard location and also later in a standard location

Both linux systems are older, Red Hat 7.2 systems on which I have just
recently installed gcc 4.0.2. The compiler built and installed without
problems, but are otherwise untested.

When I try to run regression tests libs/regex/test/regress, I get the
same segfault behavior. runs, but compiler_status returns the following:

warning: could not find build results for 't_1_33_1/status'.

**** exception(205): std::exception:
boost::filesystem::directory_iterator constructor: "": No such file or dir
******** errors detected; see standard output for details ********

(I am looking into why this program is looking for 't_1_33_1/status'
instead of 'boost_1_33_1/status')

Based on some googling, it does not appear that this is a known problem,
and I strongly suspect that the problem relates to my particular
installation, but cannot figure out what to try next.

Any ideas?


Jonathan Y. Walther

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at