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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:33:46+00:00 2026-05-27T08:33:46+00:00

I just compiled and installed clang+llvm 3.0 on my ubuntu 10.04, and also libc++

  • 0

I just compiled and installed clang+llvm 3.0 on my ubuntu 10.04, and also libc++ from svn. As the status in libc++ shows thread support is complete, I wanted to try std::async. So I follow the example given by Anthony Williams in

http://www.justsoftwaresolutions.co.uk/threading/multithreading-in-c++0x-part-8-futures-and-promises.html

And just make minor change to make it compile:

#include <future>
#include <iostream>

int calculate_the_answer_to_LtUaE()
{
  return 42;
}

void do_stuff()
{
  std::cout << "doing stuff" << std::endl;
}

int main()
{
  std::future<int> the_answer=std::async(calculate_the_answer_to_LtUaE);
  do_stuff();
  std::cout<<"The answer to life, the universe and everything is "
    <<the_answer.get()<<std::endl;
}

And I compile with

clang++ –std=c++0x -stdlib=libc++ -lpthread async.cpp

However, it runs and always finish with a core dump:

doing stuff
The answer to life, the universe and everything is Aborted (core dumped)

I check the core dump and it shows stack like this (which I don’t quite get a hint)

#0  0x00007fd0a1a7ba75 in raise () from /lib/libc.so.6
#1  0x00007fd0a1a7f5c0 in abort () from /lib/libc.so.6
#2  0x00007fd0a22a735b in std::exception_ptr::~exception_ptr (this=) at ../src/exception.cpp:130
#3  0x0000000000404178 in void std::__1::__assoc_state::set_value(int&&) ()
#4  0x00000000004051ae in _ZNSt3__119__async_assoc_stateIiNS_12__async_funcIPFivEJEEEE9__executeEv ()
#5  0x0000000000404e00 in _ZNSt3__114__thread_proxyINS_5tupleIJMNS_19__async_assoc_stateIiNS_12__async_funcIPFivEJEEEEEFvvEPS7_EEEEEPvSC_ ()
#6  0x00007fd0a250f9ca in start_thread () from /lib/libpthread.so.0
#7  0x00007fd0a1b2e70d in clone () from /lib/libc.so.6
#8  0x0000000000000000 in ?? ()

Anybody has an idea why?

  • 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-05-27T08:33:47+00:00Added an answer on May 27, 2026 at 8:33 am

    I ran your example on OS X Lion, using:

    clang++ -std=c++0x -stdlib=libc++ async.cpp
    

    And the program output:

    doing stuff
    The answer to life, the universe and everything is 42
    

    Inspecting the source of libc++ as suggested by moshbear’s comment I see:

    exception_ptr::~exception_ptr() _NOEXCEPT
    {
    #if HAVE_DEPENDENT_EH_ABI
        __cxa_decrement_exception_refcount(__ptr_);
    #else
        #warning exception_ptr not yet implemented
        ::abort();
    #endif  // __APPLE__
    }
    

    It appears to me that ~exception_ptr() has not been ported to ubuntu 10.04. This is a low-level facility not implementable in portable C++. Work on creating a GPL-free implementation of this level is ongoing at libc++abi. I can assure you that libc++abi is not ready for prime time at this time.

    There has also been an independent effort at this low-level library at: https://github.com/pathscale/libcxxrt . I do not know the status of this library nor whether it has been ported to ubuntu.

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

Sidebar

Related Questions

I've just downloaded from SVN the DUnit2 code base. Does someone has compiled it
I compiled and installed OpenCV (last version from the SVN) on Mac Os X
I just compiled Linux Kernel 2.6.27.62 and installed it in Ubuntu in VitualBox. Now,
I'm new to Mono and just started recently. Is mono program are compiled from
I've just installed clang in to cygwin: clang version 3.1 (trunk 151024) TargetL i386-pc-cygwin
On an almost default install of Ubuntu 11.04 I installed clang. I am trying
I just compiled and installed mysqldb for python 2.7 on my mac os 10.6.
I have checked out the OpenCV SVN repo, installed all necessary libraries, compiled it
I have Qt 4.6.3 installed at C:\Qt\4.6.3 (Windows). I just compiled a Qt application
Using Ubuntu 10.10 I have compiled and installed the latest Ogre and CEGUI libraries.

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.