Hi
I have a heavy crash, that I do not understand why:
I send from a client program the following message:
[aUser conformsToProtocol:@protocol(UserProtocol)];
This makes my server crash in
#2 in +[NSObject conformsToProtocol:aProtocol] at NSObject.m:1286
where the protocol list gives something probably wrong:
(gdb) print *aProtocol
$3 = {isa = 0x4022c680, protocol_name = 0x0, protocol_list =
0c8165c78, instance_methods = 0x0, class_methods = 0x1}
(gdb) print *aProtocol->protocol_list
$2 = {next = 0x40228580, count = 257, list = {0x0}}
Count is surely wrong and the protocol name of the first protocol too.
So the program crashes with somewhere in libc:
#0 in strcmp () from /lib/i686/libc.so.6
#1 in -[Protocol conformsTo:] () from /usr/lib/libobjc.so.1
#2 in +[NSObject conformsToProtocol:] at NSObject.m:1286
#3 in -[NSObject conformsToProtocol:] at NSObject.m:1309
#4 in __builtin_avcall () from /usr/lib/libavcall.so.0
#5 in GSFFCallInvokeWithTargetAndImp at GSFFCallInvocation.m:638
#6 in callframe_do_call at callframe.m:442
#7 in -[NSConnection(Private) _service:forwardForProxy:] at
NSConnection.m:2390
#8 in -[NSConnection(Private) handlePortMessage:] at
NSConnection.m:2149
#9 in -[NSSocketPort handlePortMessage:] at NSSocketPort.m:1712
#10 in -[GSTcpHandle receivedEvent:type:extra:forMode:] at
NSSocketPort.m:1021
#11 in -[NSSocketPort receivedEvent:type:extra:forMode:] at
NSSocketPort.m:1864
#12 in -[GSRunLoopCtxt pollUntil:within:] at NSRunLoop.m:835
#13 in -[NSRunLoop acceptInputForMode:beforeDate:] at
NSRunLoop.m:1960
#14 in -[NSRunLoop runMode:beforeDate:] at NSRunLoop.m:2030
#15 in -[NSRunLoop runUntilDate:] at NSRunLoop.m:2051
#16 in -[NSRunLoop run] at NSRunLoop.m:2039
#17 in main (argc=1, argv=0xbffff434) at main.m:62
if I replace the call to -conformsToProtocol: with
[aUser respondsToSelector:@selector(loginName)]
it works.
Does anybody have an idea, why this crashes? Or why perhaps the
protocol is not correctly sent over the wire?