[program_options] crashes when calling po::store
[Note: I already posted this on -devel. The used CVS version of Boost is
now about one week old.]
I have the following program:
#include <string>
#include <iostream>
#include
I usually get problems like this when I build my executable with a
different version of gcc, than the one boost was build with.
I don't have any ideas other than that.
Chris
On 12/14/06, Jens Müller
[Note: I already posted this on -devel. The used CVS version of Boost is now about one week old.]
I have the following program:
#include <string> #include <iostream> #include
namespace po = boost::program_options;
int main(char argc,char** argv) { using std::string;
// Kommandozeile parsen po::options_description desc("Allowed options"); desc.add_options() ("help,H", "print help message") ;
po::variables_map vm; po::store(po::parse_command_line(argc, argv, desc), vm) ; po::notify(vm);
if (vm.count("help")) { std::cout << desc << "\n"; return 1; } }
Results when building with 1.33.1 headers and linking against 1.33.1 libs:
$ cc -c -o separator2.o -g -Wall -Wno-deprecated -pipe -O -I. -I/home/jmueller/software/boost/include separator2.cpp $ cc -lboost_program_options-gcc-d -L/home/jmueller/software/boost/lib -o separator2 separator2.o $ ./separator2 $ ./separator2 --help Allowed options: -H [ --help ] print help message
Results when building with CVS headers and linking against CVS libs:
$ cc -c -o separator2.o -g -Wall -Wno-deprecated -pipe -O -I. -I/home/jmueller/software/boost-cvs/include separator2.cpp $ cc -lboost_program_options-gcc-d -L/home/jmueller/software/boost-cvs/lib -o separator2 separator2.o $ ./separator2 --help Segmentation fault
My compiler: $ cc -v Using built-in specs. Target: i586-suse-linux Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib --enable-languages=c,c++,objc,fortran,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.1.0 --enable-ssp --disable-libssp --enable-java-awt=gtk --enable-gtk-cairo --disable-libjava-multilib --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --enable-libstdcxx-allocator=new --without-system-libunwind --with-cpu=generic --host=i586-suse-linux Thread model: posix gcc version 4.1.0 (SUSE Linux)
Has anyone an idea what's going wrong here? If you need further info, please ask.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Chris Weed wrote:
I usually get problems like this when I build my executable with a different version of gcc, than the one boost was build with. I don't have any ideas other than that. Chris
OK, this might be the case perhaps. I noticed, when I wanted to run the regression tests, that it started compiling them with gcc 3.4 (or at least, g++-3.4 system header files were included). But why does it do that? The build system of 1.33.1 correctly chose the latest gcc-4.1.0, and I didn't anything different when building the CVS Boost.
Jens Müller wrote:
Chris Weed wrote:
I usually get problems like this when I build my executable with a different version of gcc, than the one boost was build with. I don't have any ideas other than that. Chris
OK, this might be the case perhaps. I noticed, when I wanted to run the regression tests, that it started compiling them with gcc 3.4 (or at least, g++-3.4 system header files were included).
But why does it do that? The build system of 1.33.1 correctly chose the latest gcc-4.1.0, and I didn't anything different when building the CVS Boost.
OK, just tried it again with latest CVS build, now the build system used gcc-4.1.0 and the libraries all have gcc41 in the filename. It still crashed. Unfortunately, I cannot really debug it: (gdb) run Starting program: /amd.home/home/jmueller/separator_devel/separator_jens/separator -f test -i test2 [Thread debugging using libthread_db enabled] [New Thread -1211864896 (LWP 1526)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1211864896 (LWP 1526)] 0xb7f40979 in ?? () from /home/jmueller/software/boost-cvs/lib/libboost_program_options-gcc41-mt-d-1_35.so.1.35.0 - whatever "??" is ...
I am not sure what the problem is, but type "bt" after the segfault in
gdb to get the back trace.
Chris
On 12/21/06, Jens Müller
Jens Müller wrote:
Chris Weed wrote:
I usually get problems like this when I build my executable with a different version of gcc, than the one boost was build with. I don't have any ideas other than that. Chris
OK, this might be the case perhaps. I noticed, when I wanted to run the regression tests, that it started compiling them with gcc 3.4 (or at least, g++-3.4 system header files were included).
But why does it do that? The build system of 1.33.1 correctly chose the latest gcc-4.1.0, and I didn't anything different when building the CVS Boost.
OK, just tried it again with latest CVS build, now the build system used gcc-4.1.0 and the libraries all have gcc41 in the filename.
It still crashed.
Unfortunately, I cannot really debug it:
(gdb) run Starting program: /amd.home/home/jmueller/separator_devel/separator_jens/separator -f test -i test2 [Thread debugging using libthread_db enabled] [New Thread -1211864896 (LWP 1526)]
Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1211864896 (LWP 1526)] 0xb7f40979 in ?? () from /home/jmueller/software/boost-cvs/lib/libboost_program_options-gcc41-mt-d-1_35.so.1.35.0
- whatever "??" is ...
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Chris Weed
-
Jens Müller