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 sp20.cc
#include <boost/regex.hpp>

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

Build:

$ 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 sp20.cc -o sp20.o
$ g++ -o sp20 sp20.o $REGEX_LIB -lstdc++

Execution:

$ ./sp20
Segmentation fault

$ ldd ./sp20
        libstdc++.so.6 => /usr/local/lib/libstdc++.so.6 (0x40018000)
        libm.so.6 => /lib/i686/libm.so.6 (0x40114000)
        libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 (0x40137000)
        libc.so.6 => /lib/i686/libc.so.6 (0x40142000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (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/
 --with-mpfr=/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
conditions.
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/libthread_db.so.1".

(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 collate_members.cc:55
#2 0x400a179a in std::collate<char>::do_transform (this=0x400fd204,
__lo=0xbffff48a "a", __hi=0xbffff48b "")
    at
/sps_home/play/objdir/i686-pc-linux-gnu/libstdc++-v3/include/bits/locale_facets.tcc:2354
#3 0x40097d57 in std::collate<char>::transform (this=0x2, __lo=0x0,
__hi=0x0)
    at
/sps_home/play/objdir/i686-pc-linux-gnu/libstdc++-v3/include/bits/locale_facets.h:2544
#4 0x0804e413 in
boost::re_detail::cpp_regex_traits_implementation<char>::transform
(this=0x807e3c8, p1=0xbffff48a "a", p2=0xbffff48b "")
    at
/mnt/60GB/sps_home/play/boost_1_33_1/boost/regex/v4/cpp_regex_traits.hpp:560
#5 0x0804e706 in
boost::re_detail::find_sort_syntax<boost::re_detail::cpp_regex_traits_implementation<char>,
char> (pt=0x807e3c8, delim=0x807e5d4 "")
    at
/mnt/60GB/sps_home/play/boost_1_33_1/boost/regex/v4/primary_transform.hpp:70
#6 0x0805f064 in
boost::re_detail::cpp_regex_traits_implementation<char>::init
(this=0x807e3c8)
    at
/mnt/60GB/sps_home/play/boost_1_33_1/boost/regex/v4/cpp_regex_traits.hpp:729
#7 0x0806d331 in cpp_regex_traits_implementation (this=0x807e3c8,
l=@0xbffff6b4)
    at
/mnt/60GB/sps_home/play/boost_1_33_1/boost/regex/v4/cpp_regex_traits.hpp:417
#8 0x080700ca in
boost::object_cache<boost::re_detail::cpp_regex_traits_base<char>,
boost::re_detail::cpp_regex_traits_implementation<char> >::do_get (
    k=@0xbffff6b4, max_cache_size=5) at
/mnt/60GB/sps_home/play/boost_1_33_1/boost/regex/pending/object_cache.hpp:118
#9 0x080707b9 in
boost::object_cache<boost::re_detail::cpp_regex_traits_base<char>,
boost::re_detail::cpp_regex_traits_implementation<char> >::get (
    k=@0xbffff6b4, max_cache_size=5) at
/mnt/60GB/sps_home/play/boost_1_33_1/boost/regex/pending/object_cache.hpp:69
#10 0x080708dd in boost::re_detail::create_cpp_regex_traits<char>
(l=@0xbffff6f0)
    at
/mnt/60GB/sps_home/play/boost_1_33_1/boost/regex/v4/cpp_regex_traits.hpp:822
#11 0x0807093a in cpp_regex_traits (this=0x807e358) at
/mnt/60GB/sps_home/play/boost_1_33_1/boost/regex/v4/cpp_regex_traits.hpp:842
#12 0x0807097f in regex_traits (this=0x807e358) at
/mnt/60GB/sps_home/play/boost_1_33_1/boost/regex/v4/regex_traits.hpp:68
#13 0x08070993 in regex_traits_wrapper (this=0x807e358) at
/mnt/60GB/sps_home/play/boost_1_33_1/boost/regex/v4/regex_traits.hpp:162
#14 0x080709b7 in regex_data (this=0x807e220) at
/mnt/60GB/sps_home/play/boost_1_33_1/boost/regex/v4/basic_regex.hpp:54
#15 0x08070a25 in basic_regex_implementation (this=0x807e220) at
/mnt/60GB/sps_home/play/boost_1_33_1/boost/regex/v4/basic_regex.hpp:85
#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
/mnt/60GB/sps_home/play/boost_1_33_1/boost/regex/v4/basic_regex.hpp:517
#17 0x0804c048 in boost::basic_regex<char, boost::regex_traits<char,
boost::cpp_regex_traits<char> > >::assign ()
    at
/mnt/60GB/sps_home/play/boost_1_33_1/boost/regex/v4/cpp_regex_traits.hpp:1003
#18 0x0804c07d in boost::basic_regex<char, boost::regex_traits<char,
boost::cpp_regex_traits<char> > >::assign ()
    at
/mnt/60GB/sps_home/play/boost_1_33_1/boost/regex/v4/cpp_regex_traits.hpp:1003
#19 0x0804c0b6 in boost::basic_regex<char, boost::regex_traits<char,
boost::cpp_regex_traits<char> > >::basic_regex ()
    at
/mnt/60GB/sps_home/play/boost_1_33_1/boost/regex/v4/cpp_regex_traits.hpp:1003
#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
(/usr/local)

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.

run_tests.sh 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
ectory
******** 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?

Regards,

-- 
Jonathan Y. Walther
Jonathan.Y.Walther_at_[hidden]

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk