Porting libpurple plugin: newbie question

Matt Meissner meissnem at gmail.com
Thu Nov 5 03:27:24 UTC 2009


On Nov 4, 2009, at 8:26 PM, Peter Hosey wrote:

> On Nov 4, 2009, at 14:32:58, Matt Meissner wrote:
>> Nov  1 21:59:12 Scooter Adium[24744]: server: ‡»ò†<U+F8FF>^G
>> Nov  1 21:59:15 Scooter com.apple.launchd.peruser.501[748]  
>> ([0x0-0x1f06f05].com.adiumX.adiumX[24744]): Job appears to have  
>> crashed: Bus error
>>
>> The Account, port, and server lines are NSLog calls from my code.
>>
>> I'm at a loss as to how the port number is showing up fine but the  
>> server is gibberish and the account is blank.  Being new to Cocoa,  
>> I'm afraid I'm making a pretty newbie mistake but I'm just not sure  
>> what it is.
>
> You're using the %s formatter, which takes a pointer to char, but  
> then passing it NSString objects. Either send the UTF8String message  
> to the objects to get pointers to their characters encoded in UTF-8,  
> or (preferable) use the %@ formatter to print the objects'  
> description, which, in the case of a string, is simply the string  
> itself.

Peter,

Thanks for the tip, but something else is certainly wrong in my code.   
Switching to %@ causes the call NSLog to fail and crash Adium.

Here's the system.log:
Nov  4 21:19:44 Scooter [0x0-0x22ce2cc].com.adiumX.adiumX[42778]: **  
(process:42778): CRITICAL **: purple_accounts_add: assertion `account ! 
= NULL' failed
Nov  4 21:19:45 Scooter com.apple.launchd.peruser.501[748]  
([0x0-0x22ce2cc].com.adiumX.adiumX[42778]): Job appears to have  
crashed: Bus error


And here's the top of the stacktrace from crashreporter:

> Process:         Adium [42778]
> Path:            /Users/matt/In Progress/adium/build/Release-Debug/ 
> Adium.app/Contents/MacOS/Adium
> Identifier:      com.adiumX.adiumX
> Version:         1.4hg (1.4hg)
> Code Type:       X86 (Native)
> Parent Process:  launchd [748]
>
> Date/Time:       2009-11-04 21:19:44.762 -0600
> OS Version:      Mac OS X 10.6.1 (10B504)
> Report Version:  6
>
> Exception Type:  EXC_BAD_ACCESS (SIGBUS)
> Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000020
> Crashed Thread:  0  Dispatch queue: com.apple.main-thread
>
> Application Specific Information:
> objc_msgSend() selector name: respondsToSelector:
>
> Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
> 0   libobjc.A.dylib                 0x96739917 objc_msgSend + 23
> 1   com.apple.CoreFoundation        0x980180a2  
> _CFStringAppendFormatAndArgumentsAux + 3138
> 2   com.apple.CoreFoundation        0x98017429  
> _CFStringCreateWithFormatAndArgumentsAux + 105
> 3   com.apple.CoreFoundation        0x980be8fe _CFLogvEx + 142
> 4   com.apple.Foundation            0x96e9d838 NSLogv + 143
> 5   com.apple.Foundation            0x96e9d7a7 NSLog + 27
> 6   ...eforge.sipe.SIPEAdiumPlugin  0x16c2b2ef -[ESPurpleSIPEAccount  
> configurePurpleAccount] + 101 (ESPurpleSIPEAccount.m:23)
> 7   com.adiumX.AdiumPurple          0x003acb8e -[CBPurpleAccount  
> configurePurpleAccountNotifyingTarget:selector:] + 39
> 8   com.adiumX.AdiumPurple          0x003b37d1 -[CBPurpleAccount  
> connect] + 177
> 9   com.adiumX.adiumX               0x001040cf -[AdiumPasswords  
> retrievedPassword:] + 307
> 10  com.apple.Foundation            0x96e35e6d  
> __NSThreadPerformPerform + 506
> 11  com.apple.CoreFoundation        0x9802a8cb __CFRunLoopDoSources0  
> + 1563
> 12  com.apple.CoreFoundation        0x9802885f __CFRunLoopRun + 1071
> 13  com.apple.CoreFoundation        0x98027d34 CFRunLoopRunSpecific  
> + 452
> 14  com.apple.CoreFoundation        0x98027b61 CFRunLoopRunInMode + 97
> 15  com.apple.HIToolbox             0x927b9eec  
> RunCurrentEventLoopInMode + 392
> 16  com.apple.HIToolbox             0x927b9bdf  
> ReceiveNextEventCommon + 158
> 17  com.apple.HIToolbox             0x927b9b28  
> BlockUntilNextEventMatchingListInMode + 81
> 18  com.apple.AppKit                0x94d3747d _DPSNextEvent + 847
> 19  com.apple.AppKit                0x94d36cbe -[NSApplication  
> nextEventMatchingMask:untilDate:inMode:dequeue:] + 156
> 20  com.apple.AppKit                0x94cf8e65 -[NSApplication run]  
> + 821
> 21  com.apple.AppKit                0x94cf0f01 NSApplicationMain + 574
> 22  com.adiumX.adiumX               0x00003562 start + 54
>

I must be missing something important in one of my classes -- some  
glue that gets the login name from the GUI and stuffs it into a class  
variable maybe?  Any suggested reading or other plugins that I could  
reference?

Thanks for your help,
Matt


-- 
Matt Meissner
meissnem at gmail.com



-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3368 bytes
Desc: not available
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20091104/fd94abc3/attachment.p7s>


More information about the devel mailing list