[Mono-dev] Segfault on mono_jit_cleanup

Arno Rehn mono-devel at arnorehn.de
Tue Jul 1 19:24:46 EDT 2008


Hi,

I hope this is the right place for this question:
Currently I'm working on providing a Mono plugin factory for KDE. I've 
followed the instructions for embedding Mono in the wiki and it works quite 
well, up to the point where I want to call mono_jit_cleanup(). It segfaults 
with the following stacktrace:

**                                                                                                                     
** ERROR:(../../mono/io-layer/handles-
private.h:160):_wapi_handle_set_signal_state: assertion failed: (thr_ret == 0)   
Stacktrace:                                                                                                            


Native stacktrace:

        /usr/lib64/pkgconfig/../../lib64/libmono.so.0 [0x2aaab171505e]
        /lib64/libpthread.so.0 [0x2b868685c340]                       
        /lib64/libc.so.6(gsignal+0x35) [0x2b868d67f535]               
        /lib64/libc.so.6(abort+0x110) [0x2b868d6809e0]                
        /usr/lib64/pkgconfig/../../lib64/libglib-2.0.so.0(g_assertion_message+0x104) 
[0x2aaab1d313c4]
        /usr/lib64/pkgconfig/../../lib64/libglib-2.0.so.0 [0x2aaab1d31842]                           
        /usr/lib64/pkgconfig/../../lib64/libmono.so.0 [0x2aaab17d9202]                               
        /usr/lib64/pkgconfig/../../lib64/libmono.so.0 [0x2aaab17d93b8]                               
        /usr/lib64/pkgconfig/../../lib64/libmono.so.0(mono_domain_finalize+0xed) 
[0x2aaab17791cd]    
        /usr/lib64/pkgconfig/../../lib64/libmono.so.0 [0x2aaab16ca759]                               
        /usr/kde/trunk/lib/kde4/kimonopluginfactory.so [0x2aaab126b814]                              
        /usr/lib64/qt4/libQtCore.so.4(_ZN21QObjectCleanupHandler5clearEv+0x4f) 
[0x2b868657cb1f]      
        /usr/lib64/qt4/libQtCore.so.4(_ZN21QObjectCleanupHandlerD0Ev+0x24) 
[0x2b868657cb84]          
        /lib64/libc.so.6(exit+0x7e) [0x2b868d681fde]                                                 
        /lib64/libc.so.6(__libc_start_main+0xfb) [0x2b868d66c4ab]                                    
        plasmoidviewer(_ZN13QGraphicsView15keyReleaseEventEP9QKeyEvent+0x41) 
[0x404979]              

Debug info from gdb:

Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]            
[New Thread 47856949390496 (LWP 7074)]                   
[New Thread 1076005200 (LWP 7076)]                       
[New Thread 1073903952 (LWP 7075)]                       
0x00002b868d70dc12 in select () from /lib64/libc.so.6    
  3 Thread 1073903952 (LWP 7075)  0x00002b868685bac1 in ?? ()
   from /lib64/libpthread.so.0                               
  2 Thread 1076005200 (LWP 7076)  0x00002b868685adc4 in __lll_lock_wait ()
   from /lib64/libpthread.so.0                                            
  1 Thread 47856949390496 (LWP 7074)  0x00002b868d70dc12 in select ()     
   from /lib64/libc.so.6                                                  

Thread 3 (Thread 1073903952 (LWP 7075)):
#0  0x00002b868685bac1 in ?? () from /lib64/libpthread.so.0
#1  0x00002aaab17d878f in ?? ()                            
   from /usr/lib64/pkgconfig/../../lib64/libmono.so.0      
#2  0x00002b8686854067 in start_thread () from /lib64/libpthread.so.0
#3  0x00002b868d713edd in clone () from /lib64/libc.so.6             
#4  0x0000000000000000 in ?? ()                                      

Thread 2 (Thread 1076005200 (LWP 7076)):
#0  0x00002b868685adc4 in __lll_lock_wait () from /lib64/libpthread.so.0
#1  0x00002b868685daaa in _L_cond_lock_51 () from /lib64/libpthread.so.0
#2  0x00002b868685d402 in __pthread_mutex_cond_lock ()                  
   from /lib64/libpthread.so.0                                          
#3  0x00002b86868589d4 in pthread_cond_wait@@GLIBC_2.3.2 ()             
   from /lib64/libpthread.so.0                                          
#4  0x00002aaab17dada5 in ?? ()                                         
   from /usr/lib64/pkgconfig/../../lib64/libmono.so.0                   
#5  0x00002aaab17dd37b in ?? ()                                         
   from /usr/lib64/pkgconfig/../../lib64/libmono.so.0                   
#6  0x00002aaab17ec50f in ?? ()                                         
   from /usr/lib64/pkgconfig/../../lib64/libmono.so.0                   
#7  0x00002aaab1778471 in ?? ()                                         
   from /usr/lib64/pkgconfig/../../lib64/libmono.so.0                   
#8  0x00002aaab1795d93 in ?? ()                                         
   from /usr/lib64/pkgconfig/../../lib64/libmono.so.0                   
#9  0x00002aaab17eb043 in ?? ()                                         
   from /usr/lib64/pkgconfig/../../lib64/libmono.so.0                   
#10 0x00002aaab1805722 in ?? ()                                         
   from /usr/lib64/pkgconfig/../../lib64/libmono.so.0                   
#11 0x00002b8686854067 in start_thread () from /lib64/libpthread.so.0   
#12 0x00002b868d713edd in clone () from /lib64/libc.so.6                
#13 0x0000000000000000 in ?? ()                                         

Thread 1 (Thread 47856949390496 (LWP 7074)):
#0  0x00002b868d70dc12 in select () from /lib64/libc.so.6
#1  0x00002aaab1d41f7a in g_spawn_sync ()                
   from /usr/lib64/pkgconfig/../../lib64/libglib-2.0.so.0
#2  0x00002aaab1d42358 in g_spawn_command_line_sync ()   
   from /usr/lib64/pkgconfig/../../lib64/libglib-2.0.so.0
#3  0x00002aaab17150ed in ?? ()                          
   from /usr/lib64/pkgconfig/../../lib64/libmono.so.0    
#4  <signal handler called>                              
#5  0x00002b868d67f535 in raise () from /lib64/libc.so.6 
#6  0x00002b868d6809e0 in abort () from /lib64/libc.so.6 
#7  0x00002aaab1d313c4 in g_assertion_message ()         
   from /usr/lib64/pkgconfig/../../lib64/libglib-2.0.so.0
#8  0x00002aaab1d31842 in g_assertion_message_expr ()    
   from /usr/lib64/pkgconfig/../../lib64/libglib-2.0.so.0
#9  0x00002aaab17d9202 in ?? ()                          
   from /usr/lib64/pkgconfig/../../lib64/libmono.so.0    
#10 0x00002aaab17d93b8 in ?? ()                          
   from /usr/lib64/pkgconfig/../../lib64/libmono.so.0    
#11 0x00002aaab17791cd in mono_domain_finalize ()        
   from /usr/lib64/pkgconfig/../../lib64/libmono.so.0    
#12 0x00002aaab16ca759 in ?? ()                          
   from /usr/lib64/pkgconfig/../../lib64/libmono.so.0    
#13 0x00002aaab126b814 in ~KimonoPluginFactory (this=0x6def20)
    at 
/home/pumphaus/dev/KDE/kdebindings/csharp/kimono/src/kimonopluginfactory.cpp:93
#14 0x00002b868657cb1f in QObjectCleanupHandler::clear ()                             
   from /usr/lib64/qt4/libQtCore.so.4                                                 
#15 0x00002b868657cb84 in QObjectCleanupHandler::~QObjectCleanupHandler ()            
   from /usr/lib64/qt4/libQtCore.so.4                                                 
#16 0x00002b868d681fde in exit () from /lib64/libc.so.6                               
#17 0x00002b868d66c4ab in __libc_start_main () from /lib64/libc.so.6                  
#18 0x0000000000404979 in _start ()                                                   
#0  0x00002b868d70dc12 in select () from /lib64/libc.so.6                             


=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.                                        
=================================================================

Aborted

I think this is connected to something the KDE/Qt internals do because if I 
try a simple example without all the KDE stuff, it works well.
I'd like to fix it, but I don't really understand what the stacktrace wants to 
tell me. Especially I have no clue what Especially I have no clue what
_wapi_handle_set_signal_state: assertion failed: (thr_ret == 0)
means. Could anyone explain this to me?

I could leave mono_jit_cleanup out and it would work nicely, but I guess this 
creates nasty memory leaks and stuff, so I better don't.

Thanks in advance,

-- 
Arno Rehn
arno at arnorehn.de




More information about the Mono-devel-list mailing list