nanosleep blocks inifinity (internal rtems deathlock?) even CPU is in idle Task

Matthias Goldhoorn matthias.goldhoorn at uni-bremen.de
Thu Nov 15 09:44:25 UTC 2012


Hello Again,
new Problem i got the debugger working (will port it later to the wiki, 
needed adaptations for the compiler and mentioned scripts).

It seems there is an bugg inside of rtems. My Code calls nanosleep and 
never returnes from there.
My main-cread is idling, so there is no higher priority process running. 
I wonder why my thread which has called nanosleep never returns...
Any suggestions?

Matthias


P.S. some debug infos:

Hanging thread got never executed, called usleep(1000):

(gdb) rtems_posix_thread 5
=====================================================================
  # | Name |    ID    | Pri |    Nsecs     | State
---+------+----------+-----+--------------+------------------------------
  5 |      | 0b010005 | 253 |    427814006 | DELAY
BACKTRACE
No line number information available for address 0x730d9c <nanosleep+254>
Line 17 of "../../../../../../gcc-4.6.3/newlib/libc/posix/usleep.c" 
starts at address 0x764bc5 <usleep+69> and ends at 0x764bdb <usleep+91>.
Line 167 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/rtt/os/Thread.cpp" 
starts at address 0x43e323 <_ZN3RTT2os15thread_functionEPv+680>
    and ends at 0x43e32c <_ZN3RTT2os15thread_functionEPv+689>.
No line number information available for address 0x7570b9 
<_Thread_Handler+229>
No line number information available.

Thread overview:

(gdb) rtems_posix_threads
=====================================================================
  # | Name |    ID    | Pri |    Nsecs     | State
---+------+----------+-----+--------------+------------------------------
  1 |      | 0b010001 | 253 |    951544529 | DELAY
  2 |      | 0b010002 | 253 |     10983912 | Wevnt
  3 |      | 0b010003 | 253 |       228075 | Wcvar
  4 |      | 0b010004 | 253 |       520904 | Wsem
  5 |      | 0b010005 | 253 |    427814006 | DELAY
  6 |      | 0b010006 | 253 |       864120 | Wsem
  7 |      | 0b010007 | 254 |      1035727 | Wcvar
  8 |      | 0b010008 | 253 |     43619192 | SUSP TRANS


Current Backtrace:
(gdb) bt
#0  0x00739776 in _CPU_Thread_Idle_body ()
#1  0x0075708a in _Thread_Handler ()
#2  0x00000000 in ?? ()



Backtrace of all threads (think unimportant, the got blocked because 
thread 5 never wakes up):

(gdb) rtems_posix_thread 1
=====================================================================
  # | Name |    ID    | Pri |    Nsecs     | State
---+------+----------+-----+--------------+------------------------------
  1 |      | 0b010001 | 253 |    951544529 | DELAY
BACKTRACE
No line number information available for address 0x733d04 
<rtems_task_wake_after+118>
No line number information available for address 0x715dc3 
<fillBufferPoll+63>
No line number information available for address 0x7161f4 
<rtems_termios_read+276>
No line number information available for address 0x701e03 <console_read+17>
No line number information available for address 0x756ed4 <rtems_io_read+80>
No line number information available for address 0x750e1e <device_read+95>
No line number information available for address 0x713d8b <read+247>
Line 276 of 
"/home/goldhoorn/limes/rock-rtems/rock/tutorial/orogen/message_producer/.orogen/main-orogen_default_message_producer__Task.cpp"
    starts at address 0x101959 <_Z13ORO_main_impliPPc+4329> and ends at 
0x10195c <_Z13ORO_main_impliPPc+4332>.
No line number information available for address 0xc66a04
Line 20 of 
"/home/goldhoorn/limes/rock-rtems/rock/tutorial/orogen/message_producer/tasks/Task.cpp" 
starts at address 0x377090 <_ZN16message_producer4TaskD0Ev>
    and ends at 0x377098 <_ZN16message_producer4TaskD0Ev+8>.
No line number information available for address 0x20245c8b
No line number information available.
(gdb) rtems_posix_thread 2
=====================================================================
  # | Name |    ID    | Pri |    Nsecs     | State
---+------+----------+-----+--------------+------------------------------
  2 |      | 0b010002 | 253 |     10983912 | Wevnt
BACKTRACE
No line number information available for address 0x7325ef 
<rtems_event_receive+107>
No line number information available for address 0x724a0c <select+510>
Line 1306 of "SocketCollection.cc" starts at address 0x548be4 
<_ZN4omni16SocketCollection6SelectEv+456> and ends at 0x548bed 
<_ZN4omni16SocketCollection6SelectEv+465>.
Line 721 of "./tcp/tcpEndpoint.cc" starts at address 0x564773 
<_ZN4omni11tcpEndpoint16AcceptAndMonitorEPFvPvPNS_14giopConnectionEES1_+87>
    and ends at 0x56477f 
<_ZN4omni11tcpEndpoint16AcceptAndMonitorEPFvPvPNS_14giopConnectionEES1_+99>.
Line 96 of "giopRendezvouser.cc" starts at address 0x530564 
<_ZN4omni16giopRendezvouser7executeEv+24> and ends at 0x53057d 
<_ZN4omni16giopRendezvouser7executeEv+49>.
Line 242 of "invoker.cc" starts at address 0x4dff67 
<_ZN15omniAsyncWorker3runEPv+295> and ends at 0x4dff6e 
<_ZN15omniAsyncWorker3runEPv+302>.
Line 465 of "posix.cc" starts at address 0x56ecb3 
<omni_thread_wrapper+127> and ends at 0x56ecbf <omni_thread_wrapper+139>.
No line number information available for address 0x7570b9 
<_Thread_Handler+229>
No line number information available.
(gdb) rtems_posix_thread 3
=====================================================================
  # | Name |    ID    | Pri |    Nsecs     | State
---+------+----------+-----+--------------+------------------------------
  3 |      | 0b010003 | 253 |       228075 | Wcvar
BACKTRACE
No line number information available for address 0x72ff7b 
<_POSIX_Condition_variables_Wait_support+232>
No line number information available for address 0x72fe2a 
<pthread_cond_timedwait+86>
Line 180 of "posix.cc" starts at address 0x56dc70 
<_ZN14omni_condition9timedwaitEmm+28> and ends at 0x56dc87 
<_ZN14omni_condition9timedwaitEmm+51>.
Line 238 of "../../../../include/omnithread.h" starts at address 
0x527ba3 <_ZN4omni9Scavenger7executeEv+175> and ends at 0x527bae 
<_ZN4omni9Scavenger7executeEv+186>.
Line 242 of "invoker.cc" starts at address 0x4dff67 
<_ZN15omniAsyncWorker3runEPv+295> and ends at 0x4dff6e 
<_ZN15omniAsyncWorker3runEPv+302>.
Line 465 of "posix.cc" starts at address 0x56ecb3 
<omni_thread_wrapper+127> and ends at 0x56ecbf <omni_thread_wrapper+139>.
No line number information available for address 0x7570b9 
<_Thread_Handler+229>
No line number information available.
(gdb) rtems_posix_thread 4
=====================================================================
  # | Name |    ID    | Pri |    Nsecs     | State
---+------+----------+-----+--------------+------------------------------
  4 |      | 0b010004 | 253 |       520904 | Wsem
BACKTRACE
No line number information available for address 0x74cf0f 
<_POSIX_Semaphore_Wait_support+107>
No line number information available for address 0x73216d <sem_wait+33>
Line 127 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/rtt/os/rtems/fosi.h" 
starts at address 0x43df50 <rtos_sem_wait+17> and ends at 0x43df52 
<rtos_sem_value>.
Line 118 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/rtt/os/Thread.cpp" 
starts at address 0x43e1d8 <_ZN3RTT2os15thread_functionEPv+349>
    and ends at 0x43e1e3 <_ZN3RTT2os15thread_functionEPv+360>.
No line number information available for address 0x7570b9 
<_Thread_Handler+229>
No line number information available.
(gdb) rtems_posix_thread 5
=====================================================================
  # | Name |    ID    | Pri |    Nsecs     | State
---+------+----------+-----+--------------+------------------------------
  5 |      | 0b010005 | 253 |    427814006 | DELAY
BACKTRACE
No line number information available for address 0x730d9c <nanosleep+254>
Line 17 of "../../../../../../gcc-4.6.3/newlib/libc/posix/usleep.c" 
starts at address 0x764bc5 <usleep+69> and ends at 0x764bdb <usleep+91>.
Line 167 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/rtt/os/Thread.cpp" 
starts at address 0x43e323 <_ZN3RTT2os15thread_functionEPv+680>
    and ends at 0x43e32c <_ZN3RTT2os15thread_functionEPv+689>.
No line number information available for address 0x7570b9 
<_Thread_Handler+229>
No line number information available.
(gdb) rtems_posix_thread 6
=====================================================================
  # | Name |    ID    | Pri |    Nsecs     | State
---+------+----------+-----+--------------+------------------------------
  6 |      | 0b010006 | 253 |       864120 | Wsem
BACKTRACE
No line number information available for address 0x74cf0f 
<_POSIX_Semaphore_Wait_support+107>
No line number information available for address 0x73216d <sem_wait+33>
Line 127 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/rtt/os/rtems/fosi.h" 
starts at address 0x43df50 <rtos_sem_wait+17> and ends at 0x43df52 
<rtos_sem_value>.
Line 118 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/rtt/os/Thread.cpp" 
starts at address 0x43e1d8 <_ZN3RTT2os15thread_functionEPv+349>
    and ends at 0x43e1e3 <_ZN3RTT2os15thread_functionEPv+360>.
No line number information available for address 0x7570b9 
<_Thread_Handler+229>
No line number information available.

(gdb) rtems_posix_thread 7
=====================================================================
  # | Name |    ID    | Pri |    Nsecs     | State
---+------+----------+-----+--------------+------------------------------
  7 |      | 0b010007 | 254 |      1035727 | Wcvar
BACKTRACE
No line number information available for address 0x72ff7b 
<_POSIX_Condition_variables_Wait_support+232>
No line number information available for address 0x72fe54 
<pthread_cond_wait+40>
Line 171 of "posix.cc" starts at address 0x56dc0e 
<_ZN14omni_condition4waitEv+10> and ends at 0x56dc25 
<_ZN14omni_condition4waitEv+33>.
Line 823 of "corbaOrb.cc" starts at address 0x4c71bc 
<_ZN10omniOrbORB3runEv+96> and ends at 0x4c71cf <_ZN10omniOrbORB3runEv+115>.
Line 311 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/rtt/transports/corba/TaskContextServer.cpp"
    starts at address 0x47cb67 
<_ZN3RTT5corba17TaskContextServer6RunOrbEv+155> and ends at 0x47cb8a 
<_ZN3RTT5corba17TaskContextServer6RunOrbEv+190>.
Line 332 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/rtt/transports/corba/TaskContextServer.cpp" 
starts at address 0x47da0d <_ZN3RTT5corba9OrbRunner4loopEv+89>
    and ends at 0x47da18 <_ZN3RTT5corba9OrbRunner4loopEv+100>.
Line 194 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/rtt/os/Thread.cpp" 
starts at address 0x43e3e7 <_ZN3RTT2os15thread_functionEPv+876>
    and ends at 0x43e3f9 <_ZN3RTT2os15thread_functionEPv+894>.
No line number information available for address 0x7570b9 
<_Thread_Handler+229>
No line number information available.
(gdb) rtems_posix_thread 8
=====================================================================
  # | Name |    ID    | Pri |    Nsecs     | State
---+------+----------+-----+--------------+------------------------------
  8 |      | 0b010008 | 253 |     43619192 | SUSP TRANS
BACKTRACE
No line number information available for address 0x734b7a 
<_CORE_mutex_Seize_interrupt_blocking+129>
No line number information available for address 0x730ad9 
<_POSIX_Mutex_Lock_support+226>
No line number information available for address 0x7307b1 
<pthread_mutex_lock+33>
Line 1133 of "poa.cc" starts at address 0x505ddc 
<_ZN4omni10omniOrbPOA15activate_objectEPN14PortableServer11ServantBaseE+68>
    and ends at 0x505de3 
<_ZN4omni10omniOrbPOA15activate_objectEPN14PortableServer11ServantBaseE+75>.
Line 108 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/rtt/transports/corba/RemoteChannelElement.hpp"
    starts at address 0x362b86 
<_ZN3RTT5corba20RemoteChannelElementIiEC1ERKNS0_20CorbaTypeTransporterEPNS_17DataFlowInterfaceEPN14PortableServer3POAEb+524>
    and ends at 0x362bbe 
<_ZN3RTT5corba20RemoteChannelElementIiEC1ERKNS0_20CorbaTypeTransporterEPNS_17DataFlowInterfaceEPN14PortableServer3POAEb+580>.
Line 73 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/rtt/transports/corba/CorbaTemplateProtocol.hpp"
    starts at address 0x35ccd6 
<_ZNK3RTT5corba21CorbaTemplateProtocolIiE22createChannelElement_iEPNS_17DataFlowInterfaceEPN14PortableServer3POAEb+66>
    and ends at 0x35cce1 
<_ZNK3RTT5corba21CorbaTemplateProtocolIiE22createChannelElement_iEPNS_17DataFlowInterfaceEPN14PortableServer3POAEb+77>.
Line 153 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/rtt/transports/corba/RemotePorts.cpp"
    starts at address 0x4897c6 
<_ZN3RTT5corba15RemoteInputPort24buildRemoteChannelOutputERNS_4base19OutputPortInterfaceEPKNS_5types8TypeInfoERNS2_18InputPortInterfaceERKNS_10ConnPolicyE+532>
    and ends at 0x4897de 
<_ZN3RTT5corba15RemoteInputPort24buildRemoteChannelOutputERNS_4base19OutputPortInterfaceEPKNS_5types8TypeInfoERNS2_18InputPortInterfaceERKNS_10ConnPolicyE+556>.
Line 96 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/rtt/internal/ConnFactory.cpp"
    starts at address 0x4519c1 
<_ZN3RTT8internal11ConnFactory22createRemoteConnectionERNS_4base19OutputPortInterfaceERNS2_18InputPortInterfaceERKNS_10ConnPolicyE+439>
    and ends at 0x451a02 
<_ZN3RTT8internal11ConnFactory22createRemoteConnectionERNS_4base19OutputPortInterfaceERNS2_18InputPortInterfaceERKNS_10ConnPolicyE+504>.
Line 277 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/rtt/typekit/../internal/ConnFactory.hpp"
    starts at address 0x16e252 
<_ZN3RTT8internal11ConnFactory16createConnectionIiEEbRNS_10OutputPortIT_EERNS_4base18InputPortInterfaceERKNS_10ConnPolicyE+470>
    and ends at 0x16e287 
<_ZN3RTT8internal11ConnFactory16createConnectionIiEEbRNS_10OutputPortIT_EERNS_4base18InputPortInterfaceERKNS_10ConnPolicyE+523>.
Line 302 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/rtt/typekit/../OutputPort.hpp"
    starts at address 0x15e3f7 
<_ZN3RTT10OutputPortIiE16createConnectionERNS_4base18InputPortInterfaceERKNS_10ConnPolicyE+31> 
and ends at 0x15e3f9.
Line 571 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/rtt/transports/corba/DataFlowI.cpp"
    starts at address 0x4987f9 
<_ZN3RTT5corba20CDataFlowInterface_i16createConnectionEPKcPNS0_26_objref_CDataFlowInterfaceES3_RNS0_11CConnPolicyE+1143>
    and ends at 0x498806 
<_ZN3RTT5corba20CDataFlowInterface_i16createConnectionEPKcPNS0_26_objref_CDataFlowInterfaceES3_RNS0_11CConnPolicyE+1156>.
Line 1848 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/build/rtt/transports/corba/DataFlowC.cc"
    starts at address 0x49ebac 
<_ZL35_0RL_lcfn_8fd6acea43f2a3c6_c1000000P18omniCallDescriptorP11omniServant+133>
    and ends at 0x49ebf2 
<_ZL35_0RL_lcfn_8fd6acea43f2a3c6_c1000000P18omniCallDescriptorP11omniServant+203>.
Line 199 of "../../../../include/omniORB4/callDescriptor.h" starts at 
address 0x518fe0 
<_ZN14omniCallHandle6upcallEP11omniServantR18omniCallDescriptor+1260>
    and ends at 0x518ff4 
<_ZN14omniCallHandle6upcallEP11omniServantR18omniCallDescriptor+1280>.
Line 2422 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/build/rtt/transports/corba/DataFlowC.cc"
    starts at address 0x4a0227 
<_ZN3RTT5corba24_impl_CDataFlowInterface9_dispatchER14omniCallHandle+1077>
    and ends at 0x4a0239 
<_ZN3RTT5corba24_impl_CDataFlowInterface9_dispatchER14omniCallHandle+1095>.
Line 538 of 
"/home/goldhoorn/limes/rock-rtems/rock/tools/rtt/build/rtt/transports/corba/ServiceC.cc"
    starts at address 0x4b080b 
<_ZN3RTT5corba14_impl_CService9_dispatchER14omniCallHandle+685>
    and ends at 0x4b082b 
<_ZN3RTT5corba14_impl_CService9_dispatchER14omniCallHandle+717>.
Line 1936 of "poa.cc" starts at address 0x5091f3 
<_ZN4omni10omniOrbPOA8dispatchER14omniCallHandleP17omniLocalIdentity+427>
    and ends at 0x509207 
<_ZN4omni10omniOrbPOA8dispatchER14omniCallHandleP17omniLocalIdentity+447>.
Line 237 of "../../../../include/omnithread.h" starts at address 
0x56c496 <_ZN17omniLocalIdentity8dispatchER14omniCallHandle+70>
    and ends at 0x56c4a3 
<_ZN17omniLocalIdentity8dispatchER14omniCallHandle+83>.
Line 356 of "../../../../include/omniORB4/internal/objectAdapter.h" 
starts at address 0x53251b <_ZN4omni6GIOP_S13handleRequestEv+255>
    and ends at 0x53251d <_ZN4omni6GIOP_S13handleRequestEv+257>.
Line 278 of "GIOP_S.cc" starts at address 0x534efc 
<_ZN4omni6GIOP_S10dispatcherEv+376> and ends at 0x534f0c 
<_ZN4omni6GIOP_S10dispatcherEv+392>.
Line 215 of "giopWorker.cc" starts at address 0x52fed8 
<_ZN4omni10giopWorker12real_executeEv+64> and ends at 0x52feed 
<_ZN4omni10giopWorker12real_executeEv+85>.
Line 118 of "giopWorker.cc" starts at address 0x5304f0 
<_ZN4omni10giopWorker7executeEv+60> and ends at 0x5304f2.
Line 242 of "invoker.cc" starts at address 0x4dff67 
<_ZN15omniAsyncWorker3runEPv+295> and ends at 0x4dff6e 
<_ZN15omniAsyncWorker3runEPv+302>.
Line 465 of "posix.cc" starts at address 0x56ecb3 
<omni_thread_wrapper+127> and ends at 0x56ecbf <omni_thread_wrapper+139>.
No line number information available for address 0x7570b9 
<_Thread_Handler+229>
---Type <return> to continue, or q <return> to quit---
No line number information available.


-- 
  Dipl.-Inf. Matthias Goldhoorn
  Space and Underwater Robotic

  Universität Bremen
  FB 3 - Mathematik und Informatik
  AG Robotik
  Robert-Hooke-Straße 5
  28359 Bremen, Germany

  Tel.:     +49 421 178 45-4193
  Zentrale: +49 421 178 45-6550
  Fax:      +49 421 178 45-4150
  E-Mail:   matthias.goldhoorn at uni-bremen.de

  Weitere Informationen: http://www.informatik.uni-bremen.de/robotik




More information about the users mailing list