2010-07-26 6 views
0

Je développe un port de lecteur audio à l'environnement Mac. Cela fonctionne bien sous Windows, mais pas avec Mac. J'ai une impasse imprévisible quand je joue de la musique avec le lecteur, la seule information que je peux obtenir est de jeter la pile de threads du processus de suspension. Voici la pile d'appel que je reçois:Comment déboguer un blocage sous mac osx?

Sampling process 1808 for 1 seconds with 1 millisecond of run time between samples 
Sampling completed, processing symbols... 
Analysis of sampling Python (pid 1808) every 1 millisecond 
Call graph: 
    785 Thread_32664 DispatchQueue_1: com.apple.main-thread (serial) 
     785 0x1ea9 
     785 0x1f82 
      785 Py_Main 
      785 PyRun_SimpleFileExFlags 
       785 PyRun_FileExFlags 
       785 PyEval_EvalCode 
        785 PyEval_EvalCodeEx 
        785 PyEval_EvalFrameEx 
         785 time_sleep 
         785 select 
          785 select$DARWIN_EXTSN$NOCANCEL 
    785 Thread_32672 DispatchQueue_2: com.apple.libdispatch-manager (serial) 
     785 start_wqthread 
     785 _pthread_wqthread 
      785 _dispatch_worker_thread2 
      785 _dispatch_queue_invoke 
       785 _dispatch_mgr_invoke 
       785 kevent 
    785 Thread_32679 
     785 thread_start 
     785 _pthread_start 
      785 CAPThread::Entry(CAPThread*) 
      785 HP_IOThread::ThreadEntry(HP_IOThread*) 
       785 HP_IOThread::WorkLoop() 
       785 HP_IOThread::PerformIO(AudioTimeStamp const&, double) 
        785 IOA_Device::CallIOProcs(AudioTimeStamp const&, AudioTimeStamp const&, AudioTimeStamp const&) 
        785 HP_IOProc::Call(AudioTimeStamp const&, AudioTimeStamp const&, AudioBufferList const*, AudioTimeStamp const&, AudioBufferList*) 
         785 BASS_ChannelIsSliding 
         785 MPEnterCriticalRegion 
          785 TSWaitOnConditionTimedRelative 
          785 TSWaitOnCondition 
           785 pthread_cond_wait$UNIX2003 
           785 _pthread_cond_wait 
            785 __semwait_signal 
    785 Thread_32680 
     785 0xa4fffad 
     785 dict_repr 
      785 0x1307ccd 
      785 MPEnterCriticalRegion 
       785 TSWaitOnConditionTimedRelative 
       785 TSWaitOnCondition 
        785 pthread_cond_wait$UNIX2003 
        785 _pthread_cond_wait 
         785 __semwait_signal 
    785 Thread_32681 
     785 MPEnterCriticalRegion 
     785 TSWaitOnConditionTimedRelative 
      785 TSWaitOnCondition 
      785 pthread_cond_wait$UNIX2003 
       785 _pthread_cond_wait 
       785 __semwait_signal 
    785 Thread_36905 
     785 start_wqthread 
     785 _pthread_wqthread 
      785 __workq_kernreturn 

Total number in stack (recursive counted multiple, when >=5): 

Sort by top of stack, same collapsed (when >= 5): 
     __semwait_signal  2355 
     __workq_kernreturn  785 
     kevent  785 
     select$DARWIN_EXTSN$NOCANCEL  785 
Sample analysis of process 1808 written to file /dev/stdout 

je ne peux connaître quelques threads attendent pour d'autres, mais je ne sais pas ce qu'ils Ecluses, qui attend. Voici ma question, comment puis-je déboguer le blocage sous environnement Mac?

+0

Est-ce une application Python? Si c'est le cas, vous avez manqué le tag le plus important de tous, "python". Veuillez ajouter cette balise au tout premier plan de votre liste de balises. – Mecki

Répondre

0

Déboguer des applications multi-thread est intrinsèquement difficile. Une approche simple (et peut-être simpliste) consiste à écrire tous vos événements de verrouillage sur le point de saisir/bloquer/libérer dans un fichier journal. Rien de particulièrement OS X à ce sujet, mais je l'ai utilisé à bon escient sur des problèmes similaires.