resistance is obsolete ™ ;-)
the groupware construction kit

Debugging OGo Instances

Some useful things for debugging ...

TODO: write much more

The defaults mentioned in Profiling OGo Instances are also useful for most debugging sessions.

Generate a CoreDump on Exception

Usually exceptions are catched by the user interface, so it is hard to know where they actually occured in the code. To debug that, you can turn on various core generation defaults:

WOCoreOnApplicationException = NO;
WOCoreOnHTTPAdaptorException = NO;
WOCoreOnXmlRpcFault = NO;
WOCoreOnRecursiveSubcomponents	= NO;
OGo Main
OGoCoreOnException = NO;

Some bug:

Jan 30 12:56:24 OpenGroupware [14795]: |OpenGroupware| <OpenGroupware[0x081346D4]: name=OpenGroupware>: caught:
(Exception name:<nil> class:ObjcRuntimeException reason:NSException (instance) does not recognize count info:<nil>)
in context:
<0x0898A1F4[WOContext]: 003401a54780898a1f4 app=OpenGroupware sn=39CB39CB01401A5475 eid=003401a54780898a1f4. rqeid=>.
Aborted (core dumped)

I have started the instance with "-WOCoreOnApplicationException YES -OGoCoreOnException YES" so that it properly ;-) dumps core.
Now we can ask GDB:

helge@dogbert:~/dev/> gdb ./OpenGroupware.woa/ix86/linux-gnu/gnu-fd-nil/OpenGroupware core
GNU gdb 5.3
Core was generated by `./OpenGroupware.woa/ix86/linux-gnu/gnu-fd-nil/OpenGroupware -WOCoreOnApplicatio'.
Program terminated with signal 6, Aborted.

... then use the GDB 'backtrace' command:

#0 0x40c40471 in kill () from /lib/
#1 0x40c401f5 in raise () from /lib/
#2 0x40c41830 in abort () from /lib/
#3 0x0804dbd8 in _i_OpenGroupware__handleException_inContext_ (self=0x81346d4, _cmd=0x402e1198, _exc=0x8a2f4b4, _ctx=0x898a1f4) at OpenGroupware.m:663
#4 0x401339bf in handler (localException=0x8a2f4b4) at WORequestHandler.m:254
#5 0x40aa1a10 in _i_NSException__raise (self=0x8a2f4b4, _cmd=0x40ba7158) at NSException.m:226
#6 0x40a9bf18 in _i_NSObject__doesNotRecognizeSelector_ (self=0x892570c, _cmd=0x40ba71e0, aSelector=0x41ccfd18) at NSObject.m:467
#7 0x40a9c388 in _i_NSObject__forwardInvocation_ (self=0x892570c, _cmd=0x40ba74b0, anInvocation=0x892574c) at NSObject.m:527
#8 0x40a9ece6 in _i_NSObject_GNU_forward__ (self=0x892570c, _cmd=0x8062160, aSel=0x41ccfd18, argFrame=0xbfffc76c) at NSObject.m:1008
#9 0x40bec3e7 in __objc_forward (object=0x892570c, sel=0x41ccfd18, args=0xbfffc76c) at sendmsg.c:597
#10 0x40bec0ed in __objc_word_forward (rcv=0x892570c, op=0x41ccfd18) at sendmsg.c:529
#11 0x41cc1701 in _i_OGoConfigDataSource___fetchAllEntries (self=0x88afddc, _cmd=0x41ccfd48) at OGoConfigDataSource.m:79
#12 0x41cc18c9 in _i_OGoConfigDataSource__fetchObjects (self=0x88afddc, _cmd=0x415ab478) at OGoConfigDataSource.m:102
#13 0x4158a00e in _i_SkyTableView___updateListFromDataSource (self=0x8a4c22c, _cmd=0x415ab7c0) at SkyTableView.m:312
#14 0x4158c14c in _i_SkyTableView__syncFromParent (self=0x8a4c22c, _cmd=0x415ab8f8) at SkyTableView.m:666
#15 0x4158ca99 in _i_SkyTableView__appendToResponse_inContext_ (self=0x8a4c22c, _cmd=0x402d83f0, _response=, _ctx=0x898a1f4) at SkyTableView.m:732
#16 0x401150b7 in _i_WOChildComponentReference__appendToResponse_inContext_ (self=0x88f1c9c, _cmd=0x402f6c20, _response=, _ctx=0x898a1f4) at WOChildComponentReference.m:188
#17 0x4017c6c4 in _i_WOCompoundElement__appendToResponse_inContext_ (self=0x88824dc, _cmd=0x4067a390, _response=0x8a306e4, _ctx=0x898a1f4) at WOCompoundElement.m:244
#18 0x4060280a in _i_WETabItem___appendBodyToResponse_inContext_activeKey_key_ (self=0x88f8024, _cmd=0x4067a440, _response=0x8a306e4, _ctx=0x898a1f4, tmp=0x88ff92c, k=0x88ff92c) at WETabItem.m:317
#19 0x40602dcb in _i_WETabItem__appendToResponse_inContext_ (self=0x88f8024, _cmd=0x415afe50, _response=0x8a306e4, _ctx=0x898a1f4) at WETabItem.m:374
#20 0x41599f08 in _i_SkySimpleTabItem__appendToResponse_inContext_ (self=0x89a72d4, _cmd=0x402f6c28, _response=0x8a306e4, _ctx=0x898a1f4) at SkySimpleTabItem.m:104
#21 0x4017c710 in _i_WOCompoundElement__appendToResponse_inContext_ (self=0x890b16c, _cmd=0x4067b680, _response=0x8a306e4, _ctx=0x898a1f4) at WOCompoundElement.m:249
#22 0x40607e61 in _i_WETabView___appendBodyRowToResponse_inContext_bgcolor_activeKey_ (self=0x88f778c, _cmd=0x4067b7f0, _response=0x8a306e4, _ctx=0x898a1f4, bgcolor=0x894f424, activeKey=0x88ff92c)

Analysis: Objective-C forwarding is triggered, which implies that some object didn't respond to a certain selector (stack level #0-#10). The code sending the unknown message is at stack level #11, _i_OGoConfigDataSource___fetchAllEntries, in this case.
Open the source "at OGoConfigDataSource.m:79" and take a look what is being done there.
Vola, bug fixed.

We welcome your feedback!
This site is sponsored by
SKYRIX Software AG
ZideOne GmbH