[NTLUG:Discuss] ACE related Trouble
Harshal Vaidya
harshalvaidya at yahoo.com
Fri Aug 13 16:52:13 CDT 2004
Hi everybody ,
I'm using ACE 5.2.1 over Sun Solaris 5.8 and built
over gcc 3.3.2(for Solaris). The build was no fancy, I
built the library as it was written on the ACE site.I
never modified any config or platform file at all.
I have an application whose code snippet looks like
this.
static void*
launch_function(void *pdata)
{
std::cout << "in launch function" << std::endl;
Spotter_Link* plink = static_cast<Spotter_Link*>
(pdata);
plink->event_loop();
std::cout << "out of launch function" <<
std::endl;
return 0;
}
void
Spotter_Link::launch_thread_for_event_loop()
{
std::cout << "entered spotter link. About to
launch thread" << std::endl;
if (ACE_Thread_Manager::instance() -> spawn(
&launch_function,
(void*) this,
THR_NEW_LWP | THR_DETACHED)
== -1)
{
std::cerr << "unable to launch thread to enter
event loop " << std::endl;
}
std::cout << "after thread launch " <<std::endl;
}
When I run the program it core dumps. The message
"entered spotter link. About to launch thread" and
"after thread launch" are printed. However the thread
which is spawned never gets a chance to execute the
"launch_function" as none of its messages are printed.
In the interim somewhere deep down the ACE code it
dumps.
When I analyse the core with dbx the debugger shows
the following stack trace.
#0 0xfee4bb40 in pthread_mutex_lock () from
/usr/lib/libthread.so.1
#1 0xff0bb548 in _ZN15ACE_Thread_Exit8instanceEv ()
at /home/pyramid/u675599/ACE5.2.1/ace/OS.i:1810
#2 0xff0bb2c4 in _ZN18ACE_Thread_Adapter6invokeEv
(this=<incomplete type>) at Thread_Adapter.cpp:65
#3 0xff090814 in ace_thread_adapter (args=0xc3e40) at
Base_Thread_Adapter.cpp:121
Looking at the stack trace the dump seems to be in the
ACE lib. However for all the reasons something might
be wrong in my code itself. I haven't been able to
figure out though.
I also wrote a small test program to see whether the
thread spawn functionality 'works' at all and it does.
This gave me the feeling that the libACE build went
correct.
Could anybody of you please point me towards what the
problem could be or give any sort of suggestions?
Thanks and Regards,
Harshal Vaidya.
=====
Harshal Vaidya.
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
More information about the Discuss
mailing list