Ticket #958 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Crash in -[MVIRCChatConnection(MVIRCChatConnectionProtocolHandlers) _handle333WithParameters:fromSender:]

Reported by: narge Assigned to: timothy
Priority: normal Component: Colloquy (GUI)
Version: Latest 2.1 Severity: major
Keywords: Cc: narge-colloquy@derrin.id.au

Description

Colloquy occasionally crashes in -[MVIRCChatConnection(MVIRCChatConnectionProtocolHandlers) _handle333WithParameters:fromSender:]. The backtrace from GDB is:

#0  0x925fb7e4 in +[NSInvocation newInvocationWithMethodSignature:] ()
#1  0x925fb3f6 in -[NSObject(NSForwardInvocation) forward::] ()
#2  0x90a57ba1 in _objc_msgForward ()
#3  0x00321819 in -[MVIRCChatConnection(MVIRCChatConnectionProtocolHandlers) _handle333WithParameters:fromSender:] ()
#4  0x003194ad in -[MVIRCChatConnection(MVIRCChatConnectionPrivate) socket:didReadData:withTag:] ()
#5  0x0033b566 in -[AsyncSocket completeCurrentRead] ()
#6  0x0033b3cf in -[AsyncSocket doBytesAvailable] ()
#7  0x0033c0a5 in MyCFReadStreamCallback ()
#8  0x90876d4e in _CFStreamSignalEventSynch ()
#9  0x908769ed in CFReadStreamSignalEvent ()
#10 0x910216fa in _SocketCallBack ()
#11 0x9083f3a5 in __CFSocketDoCallback ()
#12 0x9083f11a in __CFSocketPerformV0 ()
#13 0x90829379 in CFRunLoopRunSpecific ()
#14 0x90828eb5 in CFRunLoopRunInMode ()
#15 0x9262adc6 in -[NSRunLoop runMode:beforeDate:] ()
#16 0x00317baa in -[MVIRCChatConnection(MVIRCChatConnectionPrivate) _ircRunloop] ()
#17 0x925f536c in forkThreadForFunction ()
#18 0x90023d87 in _pthread_body ()

I don't have a debug build, so it's difficult to tell which invocation is causing the crash. The instruction before 0x00321819 is the first of two calls to dyld_stub_objc_msgSend_fpret, so it appears to be the first -doubleValue call in -_handle333WithParameters:fromSender:

		if( [[parameters objectAtIndex:3] doubleValue] > 631138520 )

A friend of mine has been seeing this crash regularly since she started using colloquy about two months ago; this is the first time it's happened to me. I'm using build 3502. We're both using intel macs running 10.4.8, and both connecting via ctrlproxy.

I'll start using a debug build, and attach more information if I can get it.

Change History

01/07/07 19:59:44 changed by narge

  • cc set to narge-colloquy@derrin.id.au.

01/08/07 01:14:36 changed by timothy

  • status changed from new to assigned.

Anything in the console? I suspect [parameters objectAtIndex:3] is not a NSString, but a NSData on the server you are using.

01/08/07 05:29:41 changed by narge

Ah, I hadn't thought of looking at the console. You're right, it's an NSData:

2007-01-08 11:49:39.466 Colloquy[12094] *** -[NSConcreteMutableData doubleValue]: selector not recognized [self = 0xf6622e0]
2007-01-08 11:49:39.466 Colloquy[12094] *** NSRunLoop ignoring exception '*** -[NSConcreteMutableData doubleValue]: selector not recognized [self = 0xf6622e0]' that raised during posting of delayed perform with target e31ca30 and selector 'maybeDequeueRead'
2007-01-08 11:49:39.542 Colloquy[12094] *** -[NSConcreteMutableData doubleValue]: selector not recognized [self = 0xf4c6bd0]
2007-01-08 11:49:39.542 Colloquy[12094] An uncaught exception was raised
2007-01-08 11:49:39.542 Colloquy[12094] *** -[NSConcreteMutableData doubleValue]: selector not recognized [self = 0xf4c6bd0]
2007-01-08 11:49:39.543 Colloquy[12094] *** Uncaught exception: <NSInvalidArgumentException> *** -[NSConcreteMutableData doubleValue]: selector not recognized [self = 0xf4c6bd0]
Jan  8 11:49:40 cortana crashdump[12105]: Colloquy crashed
Jan  8 11:49:41 cortana crashdump[12105]: crash report written to: /Users/narge/Library/Logs/CrashReporter/Colloquy.crash.log

01/08/07 22:30:35 changed by timothy

What server is this on? This will be easy to fix, but I want to test.

01/08/07 22:32:25 changed by timothy

We use NSData for the last parameter if the server prefixes it with ":". This lets Colloquy decode that text separately, since that is usually a human readable message. In this case I am curious if the text is just a number with some human readable info after it.

01/09/07 19:15:26 changed by narge

It's connected to a proxy (ctrlproxy 2.6.1), which in my case is connected to a private server that is running Unreal3.2.3. The crash does not happen when connecting to the server directly, so I think a ctrlproxy bug is triggering it.

This bug looks relevant, though it's about client commands rather than server replies.

01/09/07 19:24:55 changed by narge

Sorry if it wasn't obvious in my previous comment, but this crash occurs every time that the proxy sends a 333. I can trigger it by /join to any channel that has a topic set. I'm not sure why I didn't see it earlier; perhaps because ctrlproxy joins my regular channels when it starts, with no client connected.

Why do you use NSData for text after a :, rather than NSString?

01/13/07 14:08:58 changed by timothy

Using NSData lets colloquy decode the data with a different encoding that the user can pick per room. The Chat Core layer has no details on what encoding the user interfaces wants to use. Using NSString limits us to one encoding and no choice to switch encoding later.

Can you look to see what the full 333 line is that crashes Colloquy? I specifically need to know what the text is after the ":".

01/14/07 12:18:26 changed by timothy

  • status changed from assigned to closed.
  • resolution set to fixed.

This should be fixed in [3550]. Let me know if there are any other problems.