Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9158163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:11:06+00:00 2026-06-17T13:11:06+00:00

Currently I am using boost::program_options to parse a configuration file on the BeagleBoard (ARM-based

  • 0

Currently I am using boost::program_options to parse a configuration file on the BeagleBoard (ARM-based processor). My program is multi-threaded and linked against the boost 1.45 multithreaded libraries.

My program just seems to hang when parsing the configuration file though

namespace po = boost::program_options;
po::options_description desc("Options");
uint32_t option1=0;
std::vector<std::string> optionsString;
std::cout<<"Before adding options"<<std::endl;
desc.add_options()
    ("option1",
     po::value<uint32_t>(&option1), "...")
    ("finaloption",
     po::value<std::vector<std::string> >(&optionsString)->multitoken(), "string of options");
//Never gets here
std::cout<<"After adding options"<<std::endl; 
po::variables_map vm;
std::cout<<"Starting program"<<std::endl;

The program hangs before printing out “After adding options”. If I run the program through gdb stop it and do a back trace it just shows that it was on the line before the “Never gets here” comment. The top of the backtrace just has it at

#0 ??
#1 __lll_lock_wait lowlevellock.c:47
#2 __pthread_mutex_lock pthread_mutex_lock.c:61
#3 in boost::shared_ptr<boost::program_options::option_description>* std::__uninitialized_move_a<boost::shared_ptr<boost::program_options::option_description>*, boost::shared_ptr<boost::program_options::option_description>*, std::allocator<boost::shared_ptr<boost::program_option::option_description> > >(boost::shared_ptr<boost::program_optionns::option_description>*, boost::shared_ptr<boost::program_options::option_description>*, std::allocator<boost::shared_ptr<boost::program_options::option_description> >&) () from /usr/local/lib/libboost_program_options-mt.so.1.45.0
#4 in std::vector<boost::shared_ptr<boost::program_options::option_description>, std::allocator<boost::shared_ptr<boost::program_options::option_description> > >::_M_insert_aux(__gnu_cxx::__normal_iterator<boost::shared_ptr<boost::program_options::option_description>, std::vector<boost::shared_ptr<boost::program_options::option_description>, std::allocator<boost::shared_ptr<boost::program_options::option_description> const&)() from /usr/local/lib/libboost_program_options-mt.so.1.45.0
#5 in boost::program_options::options_description::add(boost::shared_ptr<boost::program_options::option_description>) () from /usr/local/lib/libboost_program_options-mt.so.1.45.0

…(let me know if you want more)

Any thoughts? This program works fine on an x86 machine

Edit: Further information, this does not seem to happen with optimizations off (compiled with -O2 this will fairly consistently occur).

Edit2: Further analysis reveals that this still happens with optimizations off, -O0.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:11:07+00:00Added an answer on June 17, 2026 at 1:11 pm

    This could be a problem related to how you build boost and your application. The mutex lock implementations are different if you compile for thumb and without thumb. Make sure you compile both the application and the boost library with the same thumb settings.

    Here’s an example user-config.jam I use to compile boost:

    if [ os.name ] = CYGWIN || [ os.name ] = NT
    {
        HOST_TAG = windows ;
    }
    else if [ os.name ] = LINUX
    {
        HOST_TAG = linux-x86 ;
    }
    else if [ os.name ] = MACOSX
    {
        HOST_TAG = darwin-x86 ;
    }
    
    modules.poke : NO_BZIP2 : 1 ;
    modules.poke : NO_GZIP : 1 ;
    
    LIB_ROOT = /home/user/lib ;
    
    NDK_ROOT = $(LIB_ROOT)/android-ndk-r8c ;
    
    LLVM_VERSION = 3.1 ;
    LLVM_NAME = llvm-$(LLVM_VERSION) ;
    LLVM_TOOLCHAIN_ROOT = $(NDK_ROOT)/toolchains/$(LLVM_NAME) ;
    LLVM_TOOLCHAIN_PREBUILT_ROOT = $(LLVM_TOOLCHAIN_ROOT)/prebuilt/$(HOST_TAG) ;
    LLVM_TOOLCHAIN_PREFIX = $(LLVM_TOOLCHAIN_PREBUILT_ROOT)/bin/ ;
    
    TOOLCHAIN_VERSION = 4.6 ;
    TOOLCHAIN_NAME = arm-linux-androideabi-$(TOOLCHAIN_VERSION) ;
    TOOLCHAIN_ROOT = $(NDK_ROOT)/toolchains/$(TOOLCHAIN_NAME) ;
    TOOLCHAIN_PREBUILT_ROOT = $(TOOLCHAIN_ROOT)/prebuilt/$(HOST_TAG) ;
    TOOLCHAIN_PREFIX = $(TOOLCHAIN_PREBUILT_ROOT)/bin/arm-linux-androideabi- ;
    
    using clang : $(TOOLCHAIN_VERSION) :
    $(LLVM_TOOLCHAIN_PREFIX)clang :
    <compileflags>"-gcc-toolchain $(TOOLCHAIN_PREBUILT_ROOT)"
    <compileflags>"-isystem $(LLVM_TOOLCHAIN_PREBUILT_ROOT)/lib/clang/$(LLVM_VERSION)/include"
    <compileflags>"-isysroot $(NDK_ROOT)/platforms/android-9/arch-arm/usr/include"
    <compileflags>-std=gnu++11
    <compileflags>-stdlib=libc++
    <compileflags>-fomit-frame-pointer
    <compileflags>-ffast-math
    <compileflags>"-target armv7-none-linux-androideabi"
    <compileflags>-march=armv7-a
    <compileflags>-mfloat-abi=softfp
    <compileflags>-mfpu=neon
    <compileflags>-DPAGE_SIZE=sysconf\\(_SC_PAGESIZE\\)
    <compileflags>-I$(NDK_ROOT)/boost/include
    <compileflags>-I$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/$(TOOLCHAIN_VERSION)/include
    <compileflags>-I$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/$(TOOLCHAIN_VERSION)/libs//armeabi-v7a/include
    <compileflags>-I$(NDK_ROOT)/platforms/android-9/arch-arm/usr/include
    <linkflags>-s
    <archiver>$(TOOLCHAIN_PREFIX)ar
    <ranlib>$(TOOLCHAIN_PREFIX)ranlib
    ;
    

    Note, that in this example, I did not compile with thumb enabled.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To narrow it down: I'm currently using Boost.Unordered . I see two possible solutions:
I'm trying to have CMake 2.8.6 link to boost::program_options using the following code in
I am working on a multithreaded program using C++ and Boost. I am using
I ran this simple program: #include <iostream> #include <string> using namespace std; #include <boost/regex.hpp>
I wanted to start using boost:python to embed python in my C++ program, but
I'm using boost 1.47 for Arm, with the Code Sourcery C++ compiler (4.5.1), crosscompiling
I have written a small example C++ program, using boost::thread. Since it's 215 lines,
I'm currently struggling with a basic socket problem using boost::asio. A server is sending
The following C++ program #include <iostream> #include <boost/tokenizer.hpp> using namespace std; int main() {
I am currently writing a CUDA application and want to use the boost::program_options library

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.