From kde Thu Aug 27 23:09:57 1998 From: "Steven W. Orr" Date: Thu, 27 Aug 1998 23:09:57 +0000 To: kde Subject: I need some help and it's not officially a KDE problem. X-MARC-Message: https://marc.info/?l=kde&m=90425953018000 I'm trying to get an app working called pi-address. It is QT based and is used to muck with the address database of a palm pilot. It seems to work well except for the import/export ability. It gets a SIGSEGV and my C++ isn't quite up to schnuff. If you guys have some patience, the relevant info might be more meaningful to you than it is to me. (I really want this thing to work.): BTW, I have qt-1.40 installed under RH-5.1. When I tell pi-address to export the database to a csv file, then I get the SIGSEGV. I ran it inside gdb and got a stacktrace. Here's the stack: (gdb) bt #0 0x4021fb8e in chunk_realloc (ar_ptr=0x402738a0, oldp=0x80eea20, oldsize=264, nb=392) at malloc.c:3130 #1 0x4021fb18 in __libc_realloc (oldmem=0x80eea28, bytes=385) at malloc.c:3092 #2 0x400cd88c in QGArray::resize () #3 0x400d518b in QString::resize () #4 0x400d5254 in QString::sprintf () #5 0x805a861 in PiAddress::export (this=0xbffff188) at pia.cpp:1866 #6 0x400b163f in QObject::activate_signal () #7 0x40151cf4 in QButton::clicked () #8 0x400da510 in QButton::mouseReleaseEvent () #9 0x400c31d2 in QWidget::event () #10 0x4009107b in QApplication::notify () #11 0x40127ce8 in QETWidget::translateMouseEvent () #12 0x40126004 in QApplication::x11ProcessEvent () #13 0x40125bde in QApplication::processNextEvent () #14 0x4012677d in QApplication::enter_loop () #15 0x40125b55 in QApplication::exec () #16 0x805f9e7 in main (argc=3, argv=0xbffff5c4) at pia.cpp:2893 (gdb) The line of code that it's dying on is this: s->sprintf("\"%s\",\"%s\"\n", (a->getNote()) ? a->getNote() : "", (a->getPrivate()) ? "1" : "0"); Since the sprintf (#4) is on the stack, I assume that that means that getNote and getPrivate have already run. They are *not* inlines. The instanciation of s is: QString s; The class definition for a is: class AddressRecord : public QObject { Q_OBJECT public: AddressRecord(); AddressRecord(const Address *, int iCat=0, bool bMod=FALSE); ~AddressRecord(); void putShowPhone(int); void putFN (const char *); void putGN (const char *); void putTitle (const char *); void putCompany (const char *); void putPhone1 (const char*); void putPhone2 (const char *); void putPhone3 (const char *); void putPhone4 (const char *); void putPhone5 (const char *); void putAddress (const char *); void putZIP (const char *); void putTown (const char *); void putState (const char *); void putCountry (const char *); void putDefined1(const char *); void putDefined2(const char *); void putDefined3(const char *); void putDefined4(const char *); void putNote (const char *); void putPrivate (bool); void putModified(bool); void setCat (int); void putPhoneLabelIdx0(int); void putPhoneLabelIdx1(int); void putPhoneLabelIdx2(int); void putPhoneLabelIdx3(int); void putPhoneLabelIdx4(int); int getShowPhone(); const char *getFN (); const char *getGN (); const char *getTitle (); const char *getCompany (); const char *getPhone1 (); const char *getPhone2 (); const char *getPhone3 (); const char *getPhone4 (); const char *getPhone5 (); const char *getAddress (); const char *getZIP (); const char *getTown (); const char *getState (); const char *getCountry (); const char *getDefined1(); const char *getDefined2(); const char *getDefined3(); const char *getDefined4(); const char *getNote (); bool getPrivate (); bool getModified(); int getCat(); int getPhoneLabelIdx0(); int getPhoneLabelIdx1(); int getPhoneLabelIdx2(); int getPhoneLabelIdx3(); int getPhoneLabelIdx4(); private: Address Addr; bool bPrivate; int iCat; bool bModified; }; Is there anything obvious going on here? Many thanks in advance. -Time flies like the wind. Fruit flies like a banana. steveo@world.std.com- -Stranger things have happened but none stranger than this. Steven W. Orr- Does your driver's license say Organ Donor?Black holes are where God \ -------divided by zero. Listen to me! We are all individuals!--------- -- Send posts to: kde@lists.netcentral.net Send all commands to: kde-request@lists.netcentral.net Put your command in the SUBJECT of the message: "subscribe", "unsubscribe", "set digest on", or "set digest off" ********************************************************************** This list is from your pals at NetCentral