0

I am attempting to simply test some of the objective-c API but I am having some issues with unhandled exceptions in the generated code created by SUP. I have set up a simple test with the following code:

+(void)testPersonalizationKeys
{
    TaskTracker_PersonalizationParameters *pp = nil;
    pp = [TaskTracker_TaskTrackerDB
    getPersonalizationParameters];
    pp.username = @"************";
    pp.password = @"************";
    [pp save];

    while([TaskTracker_TaskTrackerDB hasPendingOperations])
    {
        [NSThread sleepForTimeInterval:1];
    }

    [self printLogs];
}

I call this static method from main and run the application, but the application terminates with this message:

Terminating app due to uncaught exception 'SUPReadWriteLock error', reason: 'attempt to unlock when not locked'

Here is the full stack track:

*** Call stack at first throw:
(
    0   CoreFoundation                      0x00a685a9  __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x018fc313  objc_exception_throw + 44
    2   TaskTracker                         0x000c4b29 -[SUPReadWriteLock unlock] + 118
    3   TaskTracker                         0x00067356 +[TaskTracker_SubscriptionStatusfind:inTable:] + 1590
    4   TaskTracker                         0x00066d09 +[TaskTracker_SubscriptionStatusfind:] + 73
    5   TaskTracker                         0x00071256 -[TaskTracker_TaskTrackerDB packageIsSubscribed] + 70
    6   TaskTracker                         0x0006d561 +[TaskTracker_TaskTrackerDB packageHasSubscription] + 81
    7   TaskTracker                         0x00063981 -[TaskTracker_PersonalizationParameters save] + 1617
    8   TaskTracker                         0x00072f22 +[SampleApp testPersonalizationKeys] + 178
    9   TaskTracker                         0x00072a60 +[SampleApp runAPITests] + 272
    10  TaskTracker                         0x000023ea main + 138
    11  TaskTracker                         0x00002355 start + 53
)

Has anyone run into anything like this with iOS to SUP connections? If so how did you get past it?

Any help is appreciated!

janarde
  • 115
  • 9
  • Ever heard of @try and @catch blocks? – Macmade Jul 18 '11 at 18:41
  • yep. The issue is that this code is supposed to be black box. I shouldn't have to touch it. I was hoping that I wouldn't have to "break the warranty" but it may be my only option. – janarde Jul 18 '11 at 20:13

1 Answers1

0

I got a similar exception when we had overridden a library function in my class.

Nirmal Patel
  • 5,128
  • 8
  • 41
  • 52
  • Were you able to get past it? Do you remember what function it was? – janarde Jul 26 '11 at 23:10
  • 1
    We had used the name "release" for an MBO operation which overrides the release of Objective C. Since then, we decided to prefix all MBO operations with a "op_" :D – Nirmal Patel Aug 01 '11 at 19:29