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

List:       kde-pim
Subject:    [Kde-pim] kabc: Crash in releaseSaveTicket() - resource problem?
From:       Will Stephenson <lists () stevello ! free-online ! co ! uk>
Date:       2003-11-14 11:36:45
[Download RAW message or body]

Hi all

I'm responsible for the code in Kopete which stores IM addresses in KABC 
custom fields.  At the time (September) the code seemed stable, but now I get 
segfaults on calling releaseSaveTicket().   Bug is #68085

Going on the backtrace, it seems like ticket->resource() is returning a bad 
pointer in releaseSaveTicket() (addressbook.cpp line 506)

I can't see where the simplified code differs from the kabc HOWTO.  The 
addressbook I'm saving to in kopete is KABC::StdAddressbook::self().  Can 
anyone spot where I'm going wrong?  What could cause me to get a bad resource 
on save?

My standard KDE address book was copied from my kde 3.1 KDEHOME.  KAddressbook 
can happily use and change it, which was all the testing I did when copying 
it.  

I didn't change any resource settings.  Every time I open kresources, it warns 
me there is no valid standard resource for 'contact', but on closing the 
dialog, an apparently valid, read/write, standard addressbook resource 
corresponding to my std.vcf appears. 

TIA

Will

Backtrace: 
#3  <signal handler called>
#4  0x4015b54c in KABC::AddressBook::releaseSaveTicket(KABC::Ticket*) (
    this=0x832faf8, ticket=0x8463f18)
    at /home/will/projects/kde/src/kdelibs/kabc/addressbook.cpp:506
#5  0x400be8a1 in KopeteMetaContact::updateKABC() (this=0x82a1da0)
    
at /home/will/projects/kde/src/kdenetwork/kopete/libkopete/kopetemetacontact.cpp:823
#6  0x400be1b0 in KopeteMetaContact::setMetaContactId(QString const&) (
    this=0x82a1da0, newMetaContactId=@0xbfffdca0)

I was doing the save in a slot to perform several addressee changes 
simultaneously, and removed this to see if it would solve the problem, but it 
still dies.  
The simplified code:
·   ·   ·   ab->insertAddressee( theAddressee );

·   ·   ·   kdDebug( 14010 ) << k_funcinfo << kdBacktrace() << endl;
·   ·   ·   //· KABC::AddressBook* ab = addressBook();

·   ·   ·   KABC::Ticket *ticket = ab->requestSaveTicket();
·   ·   ·   if ( !ticket )
·   ·   ·   ·   kdWarning( 14010 ) << k_funcinfo << "WARNING: (...)!" << endl;
·   ·   ·   else
·   ·   ·   {
·   ·   ·   ·   if ( !ab->save( ticket ) )
·   ·   ·   ·   ·   kdWarning( 14010 ) << k_funcinfo << "ERROR: (...)!"<<endl;
#if KDE_IS_VERSION (3,1,90)
·   ·   ·   ·   ab->releaseSaveTicket( ticket );
#endif
·   ·   ·   }

-- 
Will Stephenson
IRC: Bille
_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/

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

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