Thread: question to the pros: nasty ASSERTION in BOOST

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    2

    question to the pros: nasty ASSERTION in BOOST

    Hy there!
    i have a hughe problem in my company. i have a quite complex application (distributed, corba, mulithreaded, Boost, QT 3.3)
    and after closing the program (int closeevent() pApp->exit())
    the program closes but after ca 5 sec. there comes an ASSERTION

    attached_thread_count == 0
    in tss_hooks.cpp

    the code in boost looks like that:

    attached_threadcount == 0 in tss_hooks.cpp. der code dazu sieht so aus:

    + catch( ... )
    {
    - boost::call_once(init_threadmon_mutex, once_init_threadmon_mutex);
    - boost::mutex::scoped_lock lock(*threadmon_mutex);
    -
    - BOOST_ASSERT(attached_thread_count == 0);
    + return -1;


    even with the help of some c++ gurus and DevPartnerStudio we could not find the problem.
    actually it isnt that annoying because only at exit it happens. but we cant deliver it to the customer like that.

    does enyone has an idea what to do against it, even a trick to just dont show the assertion?

    unfortunately i cant make a release-version for different reasons.

    ideas? suggestions??

    thanx for any input!!

    andreas

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Are you ensuring that all threads have exitted before the process exits?

    What version of Boost?
    What OS?
    What function is the BOOST_ASSERT() in? on_process_exit()?

    gg

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Whatever code you posted there, it's not valid C++. It looks like a patch file.
    There is no catch(...) in either 1.33.1 or 1.34.0.

    Anyway, the assertion comes from the thread_specific_ptr machinery. It means that something registered a thread-exit handler but it wasn't called. This might happen if, for example, you use a thread_specific_ptr from a thread that wasn't created with boost::threads.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  4. #4
    Registered User
    Join Date
    Mar 2008
    Posts
    2

    correction

    hy, thanx for the input, i will think about it!

    the code snippet comes from on_process_exit()

    and it is in tss_hooks.cpp. it is no patch! (ignore the + and - at the left side)

    anyway, we use Windows XP, but i dont know the version of boost. today a developer told me that we use a version that is actually not supportet anymore..

    today i also found out, that when i dont use an initialisation-function (for a device) on a pointer to a library wich uses a lot of threads, then the assertion does not appear..

    greez
    Last edited by Andruu; 03-07-2008 at 10:50 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. boost serialization question
    By l2u in forum C++ Programming
    Replies: 1
    Last Post: 02-26-2008, 01:53 PM
  2. Replies: 3
    Last Post: 06-12-2007, 11:21 AM
  3. I need help to compile this code...
    By wise_ron in forum C Programming
    Replies: 17
    Last Post: 05-07-2006, 12:22 PM
  4. another exercise question
    By luigi40 in forum C# Programming
    Replies: 3
    Last Post: 11-28-2005, 03:52 PM
  5. what does this warningmean???
    By kreyes in forum C Programming
    Replies: 5
    Last Post: 03-04-2002, 07:53 AM