<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>87390</bug_id>
          
          <creation_ts>2004-08-17 22:06:59 +0000</creation_ts>
          <short_desc>Kopete crashes when receiving an icq-message</short_desc>
          <delta_ts>2004-09-03 15:20:06 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>kopete</product>
          <component>ICQ and AIM Plugins</component>
          <version>0.9.0</version>
          <rep_platform>Gentoo Packages</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>crash</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>config</reporter>
          <assigned_to name="Matt Rogers">mattr</assigned_to>
          <cc>kopete-bugs-null</cc>
    
    <cc>martin</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>259634</commentid>
    <comment_count>0</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-17 22:06:59 +0000</bug_when>
    <thetext>Version:           0.9 (using KDE KDE 3.3.0)
Installed from:    Gentoo Packages
Compiler:          gcc-3.4.1 
OS:                Linux

When receiving an icq-message, gaim segfaults. I&apos;m compiling kdenetwork with debug options, so I don&apos;t have a backtrace at the moment
If I don&apos;t have a window open, i.e. a bubble appears at the systray with a new message, kopete wouldn&apos;t crash. But any other incoming icq-message make it crash. 

This bug is very severe and I haven&apos;t seen it beeing reported already, so I suspect it to be an x86_bug (May be casting a pointer or so)
Note: I don&apos;t have _any_ aggressive Optimization flags (-O2 -fomit-frame-pointer -pipe), they are all considered perfectly stable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259635</commentid>
    <comment_count>1</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-17 22:07:40 +0000</bug_when>
    <thetext>Huch, I forgot to add: I&apos;m on x86-64 (Gentoo-amd64), this might be the important thing here ;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259647</commentid>
    <comment_count>2</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-17 22:51:48 +0000</bug_when>
    <thetext>Is there a way to disable kcrash? 

That&apos;s all I get from KCrash, but I think I&apos;d get more out of gdb. Can you help me with this?

Using host libthread_db library &quot;/lib/libthread_db.so.1&quot;.
0x00000038202e637e in waitpid () from /lib/libpthread.so.0
#0  0x00000038202e637e in waitpid () from /lib/libpthread.so.0
#1  0x000000381d9efb11 in KCrash::defaultCrashHandler ()
   from /usr/kde/3.3/lib/libkdecore.so.4
#2  0x00000038202e5107 in __pthread_clock_settime () from /lib/libpthread.so.0
#3  0x000000382069c2a0 in killpg () from /lib/libc.so.6
#4  0x0000000000000000 in ?? ()
#5  0x0000000000000000 in ?? ()
#6  0x0000000000000000 in ?? ()
#7  0x0000003800000002 in ?? ()
#8  0x0000000000000000 in ?? ()
#9  0xfefefefefefefeff in ?? ()
#10 0x0000000000c7f4d0 in ?? ()
#11 0x0000000000000001 in ?? ()
#12 0x00000075a76a3030 in ?? ()
#13 0x00000075a76a2f70 in ?? ()
#14 0x0000000000977170 in ?? ()
#15 0x0000000000a308e0 in ?? ()
#16 0x0000000800abb588 in ?? ()
#17 0x00000075a76a25e0 in ?? ()
#18 0x00000075a76a2640 in ?? ()
#19 0x0000000000000000 in ?? ()
#20 0x0000000800abb588 in ?? ()
#21 0x0000000800abb588 in ?? ()
#22 0x0000000000c637b8 in ?? ()
#23 0x00000075a76a2630 in ?? ()
#24 0x0000003821d2b088 in QColor::blue (this=0xc3c9000000ff2508)
    at qcolor.h:196
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259649</commentid>
    <comment_count>3</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-17 23:02:31 +0000</bug_when>
    <thetext>Allright, I found a way to disable kcrash. But I think, the problem lies in the icq-plugin. I&apos;m not getting a segfault with gdb, the program silently exits (Kcrash reportet a segfault).
However, I got some debug-output from kopete, but I don&apos;t know how useful this is:

kopete (oscar): [virtual void OscarSocket::slotRead()] SNAC(4,20), id=2264531911
kopete (oscar): [virtual void OscarSocket::slotRead()] SNAC(4,20), id=2264532126
kopete (oscar): [virtual void OscarSocket::slotRead()] SNAC(4,7), id=2264532287
kopete (oscar): [void OscarSocket::parseIM(Buffer&amp;)] IM received on channel 2 from &apos;165579559&apos;
kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] RECV TYPE-2 message
kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] msgType=1, msgFlags=0, status=0, priority=33
kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] RECV TYPE-2 IM, normal/auto message

After the last message, kopete died</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259660</commentid>
    <comment_count>4</comment_count>
    <who name="Michel Hermier">michel.hermier</who>
    <bug_when>2004-08-17 23:30:18 +0000</bug_when>
    <thetext>Try to run it with valgrind ... if it works under x86-64.
A good command with it, could be:
valgrind --tool=addrcheck --num-callers=30 -- kopete --nofork
This will report invalids read/write with a trace up to 30 lines.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259679</commentid>
    <comment_count>5</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-18 01:45:04 +0000</bug_when>
    <thetext>Hmm... valgrind does not seem to work on amd64 yet.
http://www.durables.org/software/valgrind/ - that&apos;s the only amd64 thing I found, and it can only handle 32bit executables.... so this is not an option. But I&apos;m open to any suggestions. kopete is unusable like this...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259680</commentid>
    <comment_count>6</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-18 01:47:56 +0000</bug_when>
    <thetext>Uhm... I think the problem most likely lies in the icq-plugin. Kopete-0.8.4 worked for me, so is there a way to get a diff of the icq-plugin between v-0.8.4 and 0.9? May be the diff is not huge....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259683</commentid>
    <comment_count>7</comment_count>
    <who name="Matt Rogers">mattr</who>
    <bug_when>2004-08-18 02:09:02 +0000</bug_when>
    <thetext>the diff is huge. your debug output did help though. I&apos;ll take a look at it. What client sent you the message and did it have rich text formatting? (colors and stuff like that)
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259684</commentid>
    <comment_count>8</comment_count>
    <who name="Matt Rogers">mattr</who>
    <bug_when>2004-08-18 02:23:33 +0000</bug_when>
    <thetext>was the user on your contact list?

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259687</commentid>
    <comment_count>9</comment_count>
    <who name="Matt Rogers">mattr</who>
    <bug_when>2004-08-18 02:39:47 +0000</bug_when>
    <thetext>also, can you run kopete in gdb and get a decent backtrace? you&apos;ll need to run 
it with the &apos;--nofork&apos; argument. Hopefully this will be better than the first 
backtrace. 

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259756</commentid>
    <comment_count>10</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-18 12:22:21 +0000</bug_when>
    <thetext>-Ok: I tried both with people on the contact list and not, I was able to crash with both, though it took longer with one that was not on my contact list. It was very odd - it took like 2-3 messages until kopete died (I&apos;ll try that again though). With somebody on the contact list, kopete instantly died. 

-There was no text-formatting

-When setting --nofork in gdb, kopete would hang on startup. Kopete wouldn&apos;t listen to SIGTERM, but only to SIGKILL - even gdb became unresponsive...
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259757</commentid>
    <comment_count>11</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-18 12:26:36 +0000</bug_when>
    <thetext>Oh, and I just tried running kopete without gdb (Letting kcrash handling the segfault) with --nofork. Kopete wouldn&apos;t freeze, but the backtrace I got is the same I already posted</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259759</commentid>
    <comment_count>12</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-18 12:34:19 +0000</bug_when>
    <thetext>I truly hate spamming, but I just forgot another thing... ;)

When running inside gdb with --nofork, the program stalled after the messages
(There were a lot more above of course):

kopete (jabber): [void JabberResourcePool::removeLock(const XMPP::Jid&amp;)] Removing resource lock for config@jabber.org
kopete (jabber): [void JabberResourcePool::removeLock(const XMPP::Jid&amp;)] No locks found.
kopete (jabber): [virtual void JabberByteStream::close()] Closing stream.
kopete (jabber): [virtual void JabberConnector::connectToServer(const QString&amp;)] Initiating connection to jabber.org
kopete (jabber): [bool JabberByteStream::connect(QString, QString)] Connecting to jabber.org, service 5222
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259761</commentid>
    <comment_count>13</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-18 13:03:38 +0000</bug_when>
    <thetext>Wait a minute.... the debug output is indeed helpful ;)

kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] RECV TYPE-2 message 
 kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] msgType=1, msgFlags=0, status=0, priority=33 
 kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] RECV TYPE-2 IM, normal/auto message 

That&apos;s what I got right? parseAdvanceMessage uses kdebug twice... however, the second time parseAdvanceMessage gets called, The second kdebug won&apos;t show (with msgType=.... etc) - so the error must happen in oscarsocket.icq.cpp between lines 786 and 815

Could I be right about this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259814</commentid>
    <comment_count>14</comment_count>
    <who name="Matt Rogers">mattr</who>
    <bug_when>2004-08-18 16:11:49 +0000</bug_when>
    <thetext>ok, so, to make sure that i understand correctly: the first time parseAdvanceMessage gets called, you get the three lines of debug output from your last post. However, the second time parseAdvanceMessage gets called (with a new message) then you don&apos;t get the line of debug output that contains &quot;msgType = ...&quot; Is that correct?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259822</commentid>
    <comment_count>15</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-18 16:33:41 +0000</bug_when>
    <thetext>Ok, this is really strange.....:
You are basically understanding me correctly.
I started up kopete, let a friend send me a message, and the last three lines of output I had were the three I pointed out, indicating that the second time, OscarSocket::parseAdvanceMessage got called didn&apos;t terminate anymore: (last three lines of kopete)

kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] RECV TYPE-2 message
kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] msgType=1, msgFlags=0, status=0, priority=33
kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] RECV TYPE-2 IM, normal/auto message

However, I have to complicate things a little bit: but I just found somebody, with which it would not crash.... I got a very lengthy output, I have put it on the net:
http://www.n.ethz.ch/student/bschindl/kopete
The client, my friend was using (where I did get no crash): licq
The client, another friend was using (where it did crash): icq (Normal windows version)

The messages I received from friend 1(using licq), gave the following output:
kopete (oscar): [void OscarSocket::parseSimpleIM(Buffer&amp;, const UserInfo&amp;)] RECV TYPE-1 IM from &apos;42566108&apos;
kopete (oscar): [void OscarSocket::parseSimpleIM(Buffer&amp;, const UserInfo&amp;)] TLV(2)
kopete (oscar): [void OscarSocket::parseMessage(const UserInfo&amp;, OscarMessage&amp;,BYTE, BYTE)] Got a normal message: &apos;hmm.. grins..&apos;
kopete (oscar): [void OscarAccount::slotReceivedMessage(const QString&amp;, OscarMessage&amp;)] account=&apos;57828646&apos;, type=0, sender=&apos;42566108&apos;

etc (I trust you not to misuse these icq-numbers ;) )

When receiving from friend 2 (using regular icq): 
kopete (oscar): [void OscarSocket::parseIM(Buffer&amp;)] IM received on channel 2 from &apos;294347960&apos;
kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] RECV TYPE-2 message
kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] msgType=1, msgFlags=0, status=0, priority=33
kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] RECV TYPE-2 IM, normal/auto message
KCrash: Application &apos;kopete&apos; crashing...

(Note again, the three times parseAdvanceMessage is listed, and per call, two entries have to be there)
And btw... I tried it with somebody using miranda: same thing happens: crash
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259829</commentid>
    <comment_count>16</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-18 16:46:22 +0000</bug_when>
    <thetext>btw.... is it on purpose that parseAdvancedMessage gets called twice? If I look at the parseSimpleIM, I only have one call listed (2 Debug outputs per call as well)... why is that?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259833</commentid>
    <comment_count>17</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-18 16:51:25 +0000</bug_when>
    <thetext>I&apos;m terribly sorry.... I was wrong.. the third output came from later in the function call. So... forget about the calling twice and not terminating (Which I&apos;m not sure abourt)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259835</commentid>
    <comment_count>18</comment_count>
    <who name="Matt Rogers">mattr</who>
    <bug_when>2004-08-18 16:55:28 +0000</bug_when>
    <thetext>&gt; btw.... is it on purpose that parseAdvancedMessage gets called twice? If I look at the parseSimpleIM, I only have one call listed (2 Debug outputs per call as well)... why is that?

It actually doesn&apos;t get called twice, it&apos;s just three lines of debug output. :-)

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259843</commentid>
    <comment_count>19</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-18 17:14:18 +0000</bug_when>
    <thetext>I&apos;ve seen that you have a lot of kdebugs commented out in the parseAdvanceMessage
I&apos;m installing now with uncommented kdebugs - hopefully this gives a clue where it&apos;s crashing
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259874</commentid>
    <comment_count>20</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-18 18:23:22 +0000</bug_when>
    <thetext>All right, I got the output from a crash: parseAdvancedMessage really does not terminage:
kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] RECV TYPE-2 message
kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] msgType=1, msgFlags=0, status=0, priority=33
kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] RECV TYPE-2 IM, normal/auto message
kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] fg color=(0, 0, 0, 0)
kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] bg color=(255, 255, 255, 0)
kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] Peer announces message is RTF!
kopete (oscar): [void OscarSocket::parseAdvanceMessage(Buffer&amp;, UserInfo&amp;, Buffer&amp;)] messagetext=&apos;{\rtf1\ansi\ansicpg1252\deff0\deflang1031{\fonttbl{\f0\fswiss\fprq2\fcharset0 MS Sans Serif;}}
{\colortbl ;\red21\green43\blue77;}
\viewkind4\uc1\pard\cf1\f0\fs22 k\par
}
kopete (oscar): &apos;
KCrash: Application &apos;kopete&apos; crashing...

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259878</commentid>
    <comment_count>21</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-18 18:30:41 +0000</bug_when>
    <thetext>I just forgot to add: This means that it crashes in oscarsocket.icq.cpp between lines 886 and 895</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259882</commentid>
    <comment_count>22</comment_count>
    <who name="Richard Smith">kde</who>
    <bug_when>2004-08-18 18:47:59 +0000</bug_when>
    <thetext>The first line after the last successful kdDebug is this one:

OscarContact *contact = static_cast&lt;OscarContact*&gt;(mAccount-&gt;contacts()
[tocNormalize(user.sn)]);

Maybe contact is NULL? Try adding:

if( contact )
	kdDebug &lt;&lt; k_funcinfo &lt;&lt; &quot;contact was NULL!&quot; &lt;&lt; endl;

after that line. See if the message gets printed.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259889</commentid>
    <comment_count>23</comment_count>
    <who name="Richard Smith">kde</who>
    <bug_when>2004-08-18 19:09:35 +0000</bug_when>
    <thetext>I&apos;ve looked at ServerToQString, and it looks safe in the case that rtf == true. So I guess that it&apos;s this line (line 890):

oMsg.setText(msgText, OscarMessage::Rtf);

That ends up calling some Flex-generated code. Without a backtrace, I&apos;m not sure I can go any further. But you might want to try to regenerate rtf.cc from rtf.ll (instructions at the top of the latter file -- maybe an old version of Flex itself was generating some non-x86-64-compatible code?).

As for your problem running Kopete in gdb (with --nofork), how long did you wait after you got the jabber-related debug messages above? It could be waiting for something to time out.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259892</commentid>
    <comment_count>24</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-18 19:22:26 +0000</bug_when>
    <thetext>I&apos;ll have a look for it this, but I&apos;m still in the middle of compiling with lots of debug-information. After this, I&apos;ll be able to tell you which function failed. I have learned one thing on amd64: NULL != 0 - gnometris crashed because it passed 0 as a NULL-Pointer. Just letting you know.

As for --nofork: I tried with the --noconnect switch and then connected manually to icq (which works _very_ fast usually) and the program stalled as well</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259894</commentid>
    <comment_count>25</comment_count>
    <who name="Richard Smith">kde</who>
    <bug_when>2004-08-18 19:46:24 +0000</bug_when>
    <thetext>On Wednesday 18 August 2004 6:22 pm, config@gmx.ch wrote:
&gt; I have learned one thing on amd64: NULL != 0 - gnometris
&gt; crashed because it passed 0 as a NULL-Pointer. Just letting you know.

Interesting. I guess the compiler in question has

#define NULL ((void*)0)

I read that the 0 -&gt; pointer conversion is buggy on some versions of gcc 
targetting x86_64, so that could be the cause of that crash. But C++ 
programmers basically never use the NULL macro, and write 0 instead (mainly 
because ((void*)0) does not convert to other pointer types without a cast in 
C++).

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259897</commentid>
    <comment_count>26</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-18 19:58:41 +0000</bug_when>
    <thetext>I don&apos;t really know, but passing to a function 0, and then testing agains NULL will not work, that&apos;s why gnometris crashed. As far as I know, gcc is fine - it&apos;s just an arch-specific thing (Pointers are 64bit, and a 0 is 32bit, and the conversion does not result in the same thing)
http://bugs.gentoo.org/show_bug.cgi?id=48948 - here is the description of the thing</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259899</commentid>
    <comment_count>27</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-18 20:09:32 +0000</bug_when>
    <thetext>btw... contact was not NULL or the function did not terminate. I forgot to include one debug statement, so I&apos;m compiling again to figure out where it broke... *sigh*</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259902</commentid>
    <comment_count>28</comment_count>
    <who name="Richard Smith">kde</who>
    <bug_when>2004-08-18 20:25:09 +0000</bug_when>
    <thetext>Ouch - they were passing 0 to a varargs function, then trying to read a 
pointer from the argument list. I&apos;m currently reviewing our code to make sure 
we&apos;ve not done the same thing.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259910</commentid>
    <comment_count>29</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-18 21:09:34 +0000</bug_when>
    <thetext>OscarContact *contact = static_cast&lt;OscarContact*&gt;(mAccount-&gt;contacts() 
 [tocNormalize(user.sn)]);

That&apos;s where it crashes. I&apos;ll look into it (probably not today anymore, since I&apos;m really busy, but tomorrow (too bad this bug will be in release....)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259939</commentid>
    <comment_count>30</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-18 22:36:13 +0000</bug_when>
    <thetext>Awww... I just overlooked another few lines... I was wrong again, it doesn&apos;t crash there, it doesn&apos;t crash where it&apos;s running ServerToQString (Which is good news ;) )

It seems to crash on:

oMsg.setText(msgText, OscarMessage::Rtf);
(I double checked, there is no line saying oMsg.setText finished... which I told it to do....)

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259942</commentid>
    <comment_count>31</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-18 22:56:31 +0000</bug_when>
    <thetext>Did this parser change over time? I&apos;m asking because it could be the .ll code or flex which is broken. I&apos;ve seen that there have been some updates to flex in july, so may something broke back then.

I&apos;ll try it with an older version once... not today anymore though</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259953</commentid>
    <comment_count>32</comment_count>
    <who name="Michel Hermier">michel.hermier</who>
    <bug_when>2004-08-18 23:55:52 +0000</bug_when>
    <thetext>Looking for this bug I found something else in oscartypes.h:
typedef unsigned long DWORD;
which is right for x86, but not for x86_64, as long on this platform is a 64bits.
shouldn&apos;t it be instead:
typedef unsigned DWORD;
or
typedef unsigned int DWORD;

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259958</commentid>
    <comment_count>33</comment_count>
    <who name="Richard Smith">kde</who>
    <bug_when>2004-08-19 00:46:44 +0000</bug_when>
    <thetext>Michel: better would be some automake magic, or uint32_t from inttypes.h. This definitely needs fixing, though it doesn&apos;t look to be the cause in this case (not that we can really tell without a backtrace).

On the subject of backtraces, I&apos;ve been told that &quot;SIG32 events need to be ignored by gdb in order to keep kopete running when attempting to connect&quot;. I don&apos;t know how to set gdb to ignore them, but it sounds like something to try.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259991</commentid>
    <comment_count>34</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-19 08:44:22 +0000</bug_when>
    <thetext>http://mythtv.org/pipermail/mythtv-dev/2004-March/020553.html

handle SIG32 pass noprint nostop

Like this, we can disable SIG32 events - I&apos;ll try it out and port results as soon as possibel</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>259997</commentid>
    <comment_count>35</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-19 08:55:09 +0000</bug_when>
    <thetext>I&apos;m sorry to disappoint you again, but kopete stalled again, but it got further this time: 

It requested the wallet-password, which it didn&apos;t before (without ignoring SIG32)
That&apos;s the output I got when it stalled:

kopete (oscar/icq): [const long unsigned int ICQAccount::fullStatus(long unsigned int)] ORing with show ip flag
kopete (oscar/icq): [const long unsigned int ICQAccount::fullStatus(long unsigned int)] ORing with web aware flag
kopete (oscar/icq): [virtual void ICQAccount::setStatus(long unsigned int, const QString&amp;)] LOGGING IN; accountId=&apos;287665734&apos;, status=196608, awaymessage=
libkopete: [void Kopete::WalletManager::slotWalletChangedStatus()]  isOpen: true
kopete (oscar): [void OscarSocket::doLogin(const QString&amp;, int, const QString&amp;,const QString&amp;, const QString&amp;, long unsigned int, const QString&amp;)] Connecting to &apos;login.icq.com&apos;, port=5190
kopete (oscar): [void OscarAccount::slotOurStatusChanged(unsigned int)] Called;newStatus=10
kopete: [const Kopete::ContactPropertyTmpl&amp; Kopete::Global::Properties::createProp(const QString&amp;, const QString&amp;, const QString&amp;, bool) const] CREATING NEW ContactPropertyTmpl WITH key = onlineSince, label = Online Since, persisten = false
kopete: [Kopete::ContactPropertyTmpl::ContactPropertyTmpl(const QString&amp;, constQString&amp;, const QString&amp;, bool, bool, bool)] Creating new template for key = &apos;onlineSince&apos;

After this, kopete stalled (Still with the disconnected symbol in the systray)

I&apos;ll try out the WORD thing - but this will take time to compile - again...
If you&apos;ve got any good idea to get a backtrace... please.... ;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>260033</commentid>
    <comment_count>36</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-19 11:25:52 +0000</bug_when>
    <thetext>All right: I tried two things: I regenerated the flex-parser with my version generated by my version of flex (which differed a lot from the original version) and I replaced this unsigned long with unsigned int

Unfortunatelly, kopete still crashed :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>260233</commentid>
    <comment_count>37</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-19 23:40:24 +0000</bug_when>
    <thetext>Hei - I figured a few things - I&apos;m not there yet, but it&apos;s a start ;)

In QString RTF2HTML::Parse(const char *rtf, const char *_encoding), I added a few kdDebugs.... and indeed, in this function it crashes.
The good: It does not crash in yylex - so it seems flex is ok
Where does it crash? Well, here is my output:

kopete (oscar): [QString RTF2HTML::Parse(const char*, const char*)] Finished yylex - the value of res is: 3
kopete (oscar): [QString RTF2HTML::Parse(const char*, const char*)] Start a for-iteration
kopete (oscar): [QString RTF2HTML::Parse(const char*, const char*)] Finished yylex - the value of res is: 3
kopete (oscar): [QString RTF2HTML::Parse(const char*, const char*)] Start a for-iteration
kopete (oscar): [QString RTF2HTML::Parse(const char*, const char*)] Finished yylex - the value of res is: 3
kopete (oscar): [QString RTF2HTML::Parse(const char*, const char*)] Start a for-iteration
kopete (oscar): [QString RTF2HTML::Parse(const char*, const char*)] Finished yylex - the value of res is: 3
kopete (oscar): [QString RTF2HTML::Parse(const char*, const char*)] Start a for-iteration
kopete (oscar): [QString RTF2HTML::Parse(const char*, const char*)] Finished yylex - the value of res is: 3
kopete (oscar): [QString RTF2HTML::Parse(const char*, const char*)] Start a for-iteration
kopete (oscar): [QString RTF2HTML::Parse(const char*, const char*)] Finished yylex - the value of res is: 3
kopete (oscar): [QString RTF2HTML::Parse(const char*, const char*)] Start a for-iteration
kopete (oscar): [QString RTF2HTML::Parse(const char*, const char*)] Finished yylex - the value of res is: 4

(There were a lot more &quot;Start a for-iteration&quot; etc messages, but I just posted the last few). When res is 4, this means it goes into case TXT, which makes:

case TXT:
            cur_level.setText(yytext);
            break;

I&apos;m now going to trace further, but hey - it&apos;s a start :D</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>260240</commentid>
    <comment_count>38</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-19 23:57:33 +0000</bug_when>
    <thetext>Oh, and btw - the reason why it didn&apos;t work with one friend is, that the message came in plain format (void OscarMessage::setText(const QString &amp;txt, MessageFormat format)) - which works fine here too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261147</commentid>
    <comment_count>39</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-22 22:07:42 +0000</bug_when>
    <thetext>All right - I&apos;ve traced it as far I can pretty much. There is still something to check, which I&apos;ll do tomorrow (I don&apos;t have any friends online anymore which have clients that make me crash)
So far, what I have gathered... I&apos;ll try to reconstruct the backtrace:

void Level::resetTag(TagEnum tag) &lt;-- iterates through the for-loop many times. At the time it crashed, res is 4
void Level::setText(const char *str) &lt;-- m_bcolors is false, as is m_bFontTbl, so it goes into the else part
void RTF2HTML::FlushOutTags() &lt;-- The for loop iterates two times. The second time, it crashes. When it crashes, t.tag is TAG_FONT_COLOR (if you look at the original backtrace, this is quite logical). It crashes here: 
QColor &amp;c = colors[t.param-1];

I wanted to output the size of the colors vector and the value of t.param-1, but now all friends are gone, so I&apos;m on my own for now. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261334</commentid>
    <comment_count>40</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-23 11:55:59 +0000</bug_when>
    <thetext>Ok, I&apos;m getting closer now... I got the following odd output of my run: 

kopete (oscar): [void RTF2HTML::FlushOutTags()] t.param &gt; colors.size() was false... index is: 4294967295 Size of the color vector is: 1

And index is the value: t.params - 1 - this is for sure a very odd value. Where do these values get set? I don&apos;t know kopetes code very well
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261346</commentid>
    <comment_count>41</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-23 12:25:20 +0000</bug_when>
    <thetext>Ok, I have tracked this down. The problem is that t.param is an unsigned int, and if you subtract one and param is 0, you get an overflow and you get that well known upper-bound of int I&apos;m seeing here. 
I&apos;m attaching a patch which fixes the problem for me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261347</commentid>
    <comment_count>42</comment_count>
      <attachid>7234</attachid>
    <who name="">config</who>
    <bug_when>2004-08-23 12:26:19 +0000</bug_when>
    <thetext>Created attachment 7234
Fixes the crash when receiving rtf/utf messages from icq

Doing a boundary check for t.param</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261956</commentid>
    <comment_count>43</comment_count>
    <who name="Matt Rogers">mattr</who>
    <bug_when>2004-08-24 18:17:53 +0000</bug_when>
    <thetext>wow, thanks for the excellent debugging work and the patch. I should be able to review this by the end of the week and have it in for KDE 3.3.1. RL has been quite busy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261961</commentid>
    <comment_count>44</comment_count>
    <who name="">config</who>
    <bug_when>2004-08-24 18:30:49 +0000</bug_when>
    <thetext>Just a little side-note...
I was obvously the first to discover this bug. I suspect, that the bug is amd64 specific. This would mean, that t.param is not supposed to become 0. (Otherwise, it would trigger on 32bit arches too)
I did not look further to figure this out, since it would require good knowledge of the code.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262603</commentid>
    <comment_count>45</comment_count>
    <who name="Matt Rogers">mattr</who>
    <bug_when>2004-08-26 06:27:47 +0000</bug_when>
    <thetext>CVS commit by mattr: 

Fix byg 87390 with the patch provided by the reporter.

Thanks again for the excellent debugging and patch. Should be in KDE 3.3.1
and will be forward ported shortly

CCMAIL: 87390-done@bugs.kde.org


  M +1 -1      rtf.cc   1.3.2.1
  M +1 -1      rtf.ll   1.4.2.1


--- kdenetwork/kopete/protocols/oscar/oscarsocket/rtf.cc  #1.3:1.3.2.1
@@ -1791,5 +1791,5 @@ void RTF2HTML::FlushOutTags()
             {
                // RTF colors are 1-based; colors[] is a 0-based array.
-               if (t.param &gt; colors.size())
+               if (t.param &gt; colors.size() || t.param == 0)
                    break;
                QColor &amp;c = colors[t.param-1];

--- kdenetwork/kopete/protocols/oscar/oscarsocket/rtf.ll  #1.4:1.4.2.1
@@ -126,5 +126,5 @@
             {
                // RTF colors are 1-based; colors[] is a 0-based array.
-               if (t.param &gt; colors.size())
+               if (t.param &gt; colors.size() || t.param == 0)
                    break;
                QColor &amp;c = colors[t.param-1];


</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>265550</commentid>
    <comment_count>46</comment_count>
    <who name="Matt Rogers">mattr</who>
    <bug_when>2004-09-03 15:20:06 +0000</bug_when>
    <thetext>*** Bug 88748 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>7234</attachid>
            <date>2004-08-23 12:26:19 +0000</date>
            <delta_ts>2004-08-23 12:26:19 +0000</delta_ts>
            <desc>Fixes the crash when receiving rtf/utf messages from icq</desc>
            <filename>kopete-amd64-patch</filename>
            <type>text/plain</type>
            <size>566</size>
            <attacher>config</attacher>
            
              <data encoding="base64">LS0tIGtkZW5ldHdvcmstMy4zLjAva29wZXRlL3Byb3RvY29scy9vc2Nhci9vc2NhcnNvY2tldC9y
dGYuY2MJMjAwNC0wNy0xNyAyMToxMDozMy4wMDAwMDAwMDAgKzAyMDAKKysrIHJ0Zi5jYwkyMDA0
LTA4LTIzIDEyOjE3OjAwLjQwNTQzMTYwMCArMDIwMApAQCAtMTc5MCw3ICsxNzkwLDcgQEAKICAg
ICAgICAgY2FzZSBUQUdfRk9OVF9DT0xPUjoKICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAg
IC8vIFJURiBjb2xvcnMgYXJlIDEtYmFzZWQ7IGNvbG9yc1tdIGlzIGEgMC1iYXNlZCBhcnJheS4K
LSAgICAgICAgICAgICAgIGlmICh0LnBhcmFtID4gY29sb3JzLnNpemUoKSkKKyAgICAgICAgICAg
ICAgIGlmICh0LnBhcmFtID4gY29sb3JzLnNpemUoKSB8fCB0LnBhcmFtID09IDApCiAgICAgICAg
ICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICBRQ29sb3IgJmMgPSBjb2xvcnNbdC5w
YXJhbS0xXTsKICAgICAgICAgICAgICAgIFByaW50VW5xdW90ZWQoIjxzcGFuIHN0eWxlPVwiY29s
b3I6IyUwMlglMDJYJTAyWFwiPiIsIGMucmVkKCksIGMuZ3JlZW4oKSwgYy5ibHVlKCkpOwo=
</data>

          </attachment>
      

    </bug>

</bugzilla>