Boost logo

Boost Users :

From: Farberov, Inga (ifarberov_at_[hidden])
Date: 2007-07-05 09:23:49


My application actually hangs in the initialization phase, before I even
get a chance to start any threads - in the main thread. The stacktrace
that I have attached resulted from a call to init program_options
object.
Inga

-----Original Message-----
From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Ovanes
Markarian
Sent: Thursday, July 05, 2007 9:16 AM
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] [Boost-user]multithreaded app hangs in boost
libraries

Can you please describe a bit more? How do you start your threads
(before your app enters main or
from the main)? Is there any chance, that you create threads and
afterwards leave main?

Try to build in some simple logging mechanism, which will produce logs
to cout from your threads
and main as well... Do not forget to lock access to cout. Try may be
create an instance of a
global object, which will output log message from its constructor.

With Kind Regards,

Ovanes Markarian

On Thu, July 5, 2007 15:05, Farberov, Inga wrote:
> Hello,
>
>
>
> I have written a static library that uses boost program_options,
> threads, date-time and serialization libraries. There is also an
> extensive use of shared_ptr.
>
> I am working on a multithreaded application, so when I link my library
> into the executable, I use multithreaded versions of the boost
> libraries. When I compile my library and application that links to
it,
> I use -pthread flag in attempt to make it multi-threaded.
>
>
>
> Everything compiles and links without a problem, however when I try to
> run the application, it hangs. I have tried to bedug it and when I
> suspend a hanging thread it gives me following stack trace:
>
>
>
> 18 _dl_sysinfo_int80() 0x003317a2
>
> 17 __lll_mutex_lock_wait() 0x0062e30e
>
> 16 _L_mutex_lock_35() 0x0062af3b
>
> 15 <symbol is not available> 0x080c80e8
>
> 14 <symbol is not available> 0x00472ff4
>
> 13 <symbol is not available> 0x080c80e8
>
> 12 <symbol is not available> 0xbffff6b0
>
> 11 <symbol is not available> 0xbffff208
>
> 10 pthread_mutex_lock() 0x0042097e
>
> 9 pthread_mutex_lock() 0x0042097e
>
> 8 scoped_lock() /usr/include/boost/detail/lwm_pthreads.hpp:72
> 0x080598eb
>
> 7 boost::detail::sp_counted_base::add_ref_copy()
> /usr/include/boost/detail/shared_count.hpp:122 0x0805b679
>
> 6 shared_count()
> /usr/lib/boost/include/boost-1_34/boost/detail/shared_count.hpp:216
> 0x0805b65b
>
> 5 shared_ptr() /usr/include/c++/3.4.6/bits/stl_construct.h:81
> 0x0807a7c8
>
> 4
> boost::program_options::options_description_easy_init::operator()
> libs/program_options/src/options_description.cpp:178 0xb7fd7189
>
> 3 Settings() ../Settings.cpp:9 0x08081808
>
>
>
> If this post sounds familiar, that's because this is my second attempt
> to get this problem resolved.
>
> Previously I have been told that this sounds like I've built my
> application with single-threading, and linked it to multi-threaded
build
> of a boost library, or vice versa.
>
> Could you please let me know what's the right way to build my app with
> multi-threading.
>
>
>
> I am using Boost 1.34 libraries on Linux and compile with gcc 3.4.6
>
>
>
> Thank you in advance for your help,
>
> Inga
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


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