hi,

while debugging/fixing the nepomukservicestub crash that like always happens, 
I found it's main cause is badly chosen defaults by the port system for 
soprano.

Basically, we provide the user with a not working strigi service, as per 
nepomuk/services/strigi/strigiservice.cpp:
    52      // Using Strigi with the redland backend is torture.                
           
    53      // Thus we simply fail initialization if it is used                 
           
    54      // ==============================================================   
           
    55      if ( org::kde::nepomuk::Storage( "org.kde.NepomukStorage",          
           
    56                                       "/nepomukstorage",
    57                                       QDBusConnection::sessionBus() )
    58           .usedSopranoBackend().value() != QString::fromLatin1( 
"redland" ) ) {

This is also the cause of the following crash:
(gdb) bt
#0  0x281467a6 in QThread::d_func (this=0xa5a5a5a5) at qthread.h:125
#1  0x281457ae in QThread::isRunning (this=0xa5a5a5a5) at 
thread/qthread.cpp:403
#2  0x2b475175 in Nepomuk::IndexScheduler::stop (this=0xa5a5a5a5)
    at /stable/usr/obj/usr/ports/x11/kdebase4-runtime/work/kdebase-
runtime-4.2.4/nepomuk/services/strigi/indexscheduler.cpp:150
#3  0x2b470937 in ~StrigiService (this=0x2b52f2c0)
    at /stable/usr/obj/usr/ports/x11/kdebase4-runtime/work/kdebase-
runtime-4.2.4/nepomuk/services/strigi/strigiservice.cpp:90
#4  0x28253414 in QObjectPrivate::deleteChildren (this=0x2ada5dd0)
    at kernel/qobject.cpp:1875
#5  0x2825a387 in ~QObject (this=0x2ada2f40) at kernel/qobject.cpp:884
#6  0x0804c58c in ~ServiceControl (this=0x2ada2f40)
    at /stable/usr/obj/usr/ports/x11/kdebase4-runtime/work/kdebase-
runtime-4.2.4/nepomuk/servicestub/servicecontrol.cpp:39
#7  0x28253414 in QObjectPrivate::deleteChildren (this=0x2ad57180)
    at kernel/qobject.cpp:1875
#8  0x2825a387 in ~QObject (this=0xbfbfe78c) at kernel/qobject.cpp:884
#9  0x2824594c in ~QCoreApplication (this=0xbfbfe78c) at 
kernel/qcoreapplication.cpp:516
#10 0x285c8816 in ~QApplication (this=0xbfbfe78c) at 
kernel/qapplication.cpp:1044
#11 0x0804b3ac in main (argc=Cannot access memory at address 0xa5a5a5a5
)
    at /stable/usr/obj/usr/ports/x11/kdebase4-runtime/work/kdebase-
runtime-4.2.4/nepomuk/servicestub/main.cpp:149
(gdb) frame 3
#3  0x2b470937 in ~StrigiService (this=0x2b52f2c0)
    at /stable/usr/obj/usr/ports/x11/kdebase4-runtime/work/kdebase-
runtime-4.2.4/nepomuk/services/strigi/strigiservice.cpp:90
90              m_indexScheduler->stop();
(gdb) print *this
$9 = {<Nepomuk::Service> = {<QObject> = {_vptr$QObject = 0x2b4877e8,
      static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x282dbdc0 
"QObject",
          data = 0x282dbe40, extradata = 0x0}}, d_ptr = 0x2b530150,
      static staticQtMetaObject = {d = {superdata = 0x0, stringdata = 
0x282e5260 "Qt",
          data = 0x282e6f00, extradata = 0x0}}}, static staticMetaObject = {d 
= {
        superdata = 0x804ee18, stringdata = 0x2948a9c0 "Nepomuk::Service",
        data = 0x2948a9e0, extradata = 0x0}}, d = 0x2ad072b0}, static 
staticMetaObject = {
    d = {superdata = 0x804ed98, stringdata = 0x2b483fe0 
"Nepomuk::StrigiService",
      data = 0x2b4840c0, extradata = 0x0}}, m_indexManager = 0xa5a5a5a5,
  m_indexScheduler = 0xa5a5a5a5}
(gdb) print *this->m_indexManager
Cannot access memory at address 0xa5a5a5a5

I don't know what other storage backends beside redland and the java one are 
available for soprano, but I think we should not make redland the default.

I'm currently rebuilding kdebase4-runtime with the attached patch applied, and 
am fairly confident it will fix the crash. I chose not to call isInitialized() 
in the destructor as there may be other cases where m_indexManager is checked 
rather then checking for successful initialization, plus it seemed cleaner to 
me to call setServiceInitialized at the end of the constructor so that any 
logic above it can fail at will.
-- 
Mel


--- nepomuk/services/strigi/strigiservice.cpp.orig	2008-11-28 06:33:44.000000000 -0900
+++ nepomuk/services/strigi/strigiservice.cpp	2009-06-20 09:03:10.000000000 -0800
@@ -71,16 +71,14 @@
         else {
             kDebug() << "Failed to load sopranobackend Strigi index manager.";
         }
-
-
-        // service initialization done if creating a strigi index manager was successful
-        // ==============================================================
-        setServiceInitialized( m_indexManager != 0 );
     }
     else {
         kDebug() << "Will not start when using redland Soprano backend due to horrible performance.";
-        setServiceInitialized( false );
+	m_indexManager = 0;
     }
+    // service initialization done if creating a strigi index manager was successful
+    // ==============================================================
+    setServiceInitialized( m_indexManager != 0 );
 }
 
 
_______________________________________________
kde-freebsd mailing list
kde-freebsd@kde.org
https://mail.kde.org/mailman/listinfo/kde-freebsd
See also http://freebsd.kde.org/ for latest information

Reply via email to