[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: [nepomuk-core] services/storage: Initialize m_classAndPropertyTree
From:       Sebastian_Trüg <trueg () kde ! org>
Date:       2011-11-05 19:35:03
Message-ID: 4EB58FE7.2070900 () kde ! org
[Download RAW message or body]

Basically close() is called before open() has been called. Not entirely
sure how that happens - maybe a failed Virtuoso start or closing nepomuk
before being initialized...

On 11/05/2011 07:42 PM, Vishesh Handa wrote:
> 
> On Sat, Nov 5, 2011 at 11:54 PM, Sebastian Trüg <trueg@kde.org
> <mailto:trueg@kde.org>> wrote:
> 
>     see bug 285789
> 
> 
> Like most bugs I get what is happening, and what the fix is, but I don't
> understand why it is happening.
> 
> Could you shed some light?
>  
> 
> 
>     On 11/05/2011 04:28 PM, Vishesh Handa wrote:
>     >
>     > On Sat, Nov 5, 2011 at 7:25 PM, Sebastian Trüg <trueg@kde.org
>     <mailto:trueg@kde.org>
>     > <mailto:trueg@kde.org <mailto:trueg@kde.org>>> wrote:
>     >
>     >     avoids a crash. :)
>     >
>     >
>     > How?
>     >
>     > The class and property tree is created in Repository::open, and
>     that is
>     > called over here -
>     >
>     > Soprano::Model* Nepomuk::Core::createModel( const
>     > Soprano::BackendSettings& )
>     > {
>     >     if ( !m_repository ) {
>     >         m_repository = new Repository( QLatin1String(
>     s_repositoryName ) );
>     >         connect( m_repository, SIGNAL( opened( Repository*, bool ) ),
>     >                  this, SLOT( slotRepositoryOpened( Repository*,
>     bool ) ) );
>     >         QTimer::singleShot( 0, m_repository, SLOT( open() ) );
>     >     }
>     >     return m_repository;
>     > }
>     >
>     > Maybe someone uses it the classAndPropertyTree in the middle?
>     (Potential
>     > crash) But how does setting Repository::m_classAndPropertyTree to
>     0 help?
>     >
>     > Is it that the m_classAndPropertyTree might not get created, cause for
>     > some mysterious reason open() was not called, and then
>     > Repository::~Repository constructor deletes the invalid memory
>     location?
>     >
>     >
>     >
>     >     On 11/05/2011 02:48 PM, Vishesh Handa wrote:
>     >     > How does this matter?
>     >     >
>     >     > On Sat, Nov 5, 2011 at 6:09 PM, Sebastian Trueg
>     <trueg@kde.org <mailto:trueg@kde.org>
>     >     <mailto:trueg@kde.org <mailto:trueg@kde.org>>
>     >     > <mailto:trueg@kde.org <mailto:trueg@kde.org>
>     <mailto:trueg@kde.org <mailto:trueg@kde.org>>>> wrote:
>     >     >
>     >     >     Git commit 4e65fae92e7f38c3d0a47a12097d723de03ec059 by
>     >     Sebastian Trueg.
>     >     >     Committed on 05/11/2011 at 13:38.
>     >     >     Pushed by trueg into branch 'master'.
>     >     >
>     >     >     Initialize m_classAndPropertyTree to 0.
>     >     >
>     >     >     M  +1    -0    services/storage/repository.cpp
>     >     >
>     >     >
>     >    
>     http://commits.kde.org/nepomuk-core/4e65fae92e7f38c3d0a47a12097d723de03ec059
>     >     >
>     >     >     diff --git a/services/storage/repository.cpp
>     >     >     b/services/storage/repository.cpp
>     >     >     index 784cbe9..50c4cb7 100644
>     >     >     --- a/services/storage/repository.cpp
>     >     >     +++ b/services/storage/repository.cpp
>     >     >     @@ -60,6 +60,7 @@ Nepomuk::Repository::Repository( const
>     >     QString& name )
>     >     >         : m_name( name ),
>     >     >           m_state( CLOSED ),
>     >     >           m_model( 0 ),
>     >     >     +      m_classAndPropertyTree( 0 ),
>     >     >           m_inferencer( 0 ),
>     >     >           m_removableStorageModel( 0 ),
>     >     >           m_dataManagementModel( 0 ),
>     >     >
>     >     >
>     >     >
>     >     >
>     >     > --
>     >     > Vishesh Handa
>     >
>     >
>     >
>     >
>     > --
>     > Vishesh Handa
> 
> 
> 
> 
> -- 
> Vishesh Handa
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic