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 8138035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:22:09+00:00 2026-06-06T11:22:09+00:00

I am having some trouble using the pantheios logging library with boost::threads. It seems

  • 0

I am having some trouble using the pantheios logging library with boost::threads. It seems that if I use any pantheios logging before creating the thread, I will get a segfault.

For example, the following would work:

thread_ = new boost::thread(&foo);
pantheios::log(pantheios::debug, "Hello world");

But if the order of the statements are switched, a stack trace reveals that I crash on start_thread in boost.

pantheios::log(pantheios::debug, "Hello world");
thread_ = new boost::thread(&foo);
// SEGFAULT!

Any ideas?

EDIT: More context

int main()
{
    pantheios::log(...);
    MyClass myClass(/* some arguments, which are all literals */);

    // Do some more work

    return 0;
}

// MyClass constructor
MyClass::MyClass(/* args */)
    : member1_(arg1)
    , member2_(arg2)
{
    thread_ = new boost::thread(&MyClass::workerLoop, this);
}

// Destructor
MyClass::~MyClass()
{
    thread_->join();
    delete thread_;
}

This will segfault at start_thread. Once again if I swap the two lines in main it will work without any problems.

  • 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-06T11:22:10+00:00Added an answer on June 6, 2026 at 11:22 am

    Looks like I figured it out. I was linking to different versions of boost. My system had boost version 1.40, whereas I was also using a newer version of boost I downloaded, 1.49. Notable the boost thread I was linking was to the older version.

    Once I made the links to boost consistent, everything worked as expected.

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

Sidebar

Related Questions

I'm having some trouble with a program using pthreads, where occassional crashes occur, that
I'm having some trouble using SML/NJ interactive system, namely, that when I try to
I am creating a Guitar Hero Clone using C# and am having some trouble
I'm having some trouble editing a table using <p:rowEditor> I use encoding='windows-1252' to be
Im having some trouble reading xml files using jquery that containts swedish chars (åäö)
I'm having some trouble using SSE4.1 intrinsics on hardware that (I think) supports it.
I'm having some trouble using constraints correctly. I have three tables, 'item', 'store' and
I'm having some trouble using regular expression to get date in a string. Example
Basically having some trouble with using Hover to hide or show an item. The
I'm having some trouble with MySQLdb when using it in a CGI script. I'm

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.