Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-08-16 02:28:32


Hi Liam,

> Here is a simple test program (based on one of the early examples):
>
> =========
> #include <boost/program_options.hpp>
> namespace po = boost::program_options;
>
> int main ( int, char* )
> {
> po::options_description generic("Generic options");
>
> generic.add_options() ("version,v", "print version string");
> generic.add_options() ("help", "produce help message");
>
> return ( 0 );
> }
> =========
>
> The seg fault happens on the second add_options() line. If the two lines
> are combined (as in the original example) it faults somewhere in there,
> but I think it is the same place.
>
> My gdb session:
>
> =========

> #0 0x000000800005d7a8 in
> ._ZN5boost6detail17sp_counted_impl_pINS_15program_options18option_descriptionEE7disposeEv
> ()
> from /usr/lib/libboost_program_options.so.1.33.0
>
> (gdb) up
> #1 0x0000008000057b90 in
> ._ZN5boost15program_options29options_description_easy_initclEPKcS3_ ()
> from /usr/lib/libboost_program_options.so.1.33.0

My first guess is single-threaded/multi-threaded mismatch. Did you try
compiling the application with -pthread? Do you know if the program_options
library you use is build with multithreading or not?

HTH,
Volodya


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