Skip to content

macOS Command Line App Crash #1391

@JohnCaccavale

Description

@JohnCaccavale

I am getting a 'NSInvalidArgumentException', reason: 'Invalid class name. Class names cannot start with an underscore.' shortly after running my macOS app.

When setting a symbolic breakpoint in +[PFObject(Private) _assertValidInstanceClassName:] which checks if a class name is nil or begins with an underscore,

+ (void)_assertValidInstanceClassName:(NSString *)className {
    PFParameterAssert(className, @"Class name can't be 'nil'.");
    PFParameterAssert(![className hasPrefix:@"_"], @"Invalid class name. Class names cannot start with an underscore.");
}

I see that the class name being passed in is:

@"_Installation"

In looking at PFInstallation it does appear to be returning a class name with an underscore.

return @"_Installation";

Has anyone seen this behavior before or know why an underscore is being returned from parseClassName for PFInstallation and other classes such as PFPin, PFProduct, PFUser if class names cannot start with an underscore?

I am using the latest from master with the macOS SDK compiled with bundle exec rake package:frameworks

Please let me know if any additional detail would be needed. Thanks in advance.

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid class name. Class names cannot start with an underscore.'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff3ae58ecd __exceptionPreprocess + 256
	1   libobjc.A.dylib                     0x00007fff66f24720 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff3ae58cff +[NSException raise:format:] + 201
	3   Parse                               0x00000001003b6735 +[PFObject(Private) _assertValidInstanceClassName:] + 128
	4   Parse                               0x00000001003bcf0d -[PFObject init] + 381
	5   Parse                               0x00000001003bd1bc -[PFObject initWithObjectState:] + 62
	6   Parse                               0x00000001003bd2ca +[PFObject objectWithClassName:objectId:completeData:] + 244
	7   Parse                               0x00000001003bd719 +[PFObject object] + 211
	8   Parse                               0x0000000100406485 __56-[PFCurrentInstallationController getCurrentObjectAsync]_block_invoke.40 + 251
	9   Bolts                               0x000000010050235b __62-[BFTask continueWithExecutor:successBlock:cancellationToken:]_block_invoke + 126
	10  Bolts                               0x0000000100501c8b __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke + 93
	11  Bolts                               0x0000000100502ff2 __29+[BFExecutor defaultExecutor]_block_invoke_2 + 138
	12  Bolts                               0x00000001005035a6 -[BFExecutor execute:] + 72
	13  Bolts                               0x0000000100501868 -[BFTask runContinuations] + 392
	14  Bolts                               0x000000010050137e -[BFTask trySetResult:] + 165
	15  Bolts                               0x00000001004ff8a3 -[BFTaskCompletionSource trySetResult:] + 86
	16  Parse                               0x00000001003ae9f4 __28-[PFAsyncTaskQueue enqueue:]_block_invoke_2 + 211
	17  Bolts                               0x0000000100501c8b __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke + 93
	18  libdispatch.dylib                   0x00000001005266eb _dispatch_call_block_and_release + 12
	19  libdispatch.dylib                   0x00000001005277c3 _dispatch_client_callout + 8
	20  libdispatch.dylib                   0x000000010052a3d2 _dispatch_queue_override_invoke + 1046
	21  libdispatch.dylib                   0x000000010053a270 _dispatch_root_queue_drain + 334
	22  libdispatch.dylib                   0x000000010053ad33 _dispatch_worker_thread2 + 125
	23  libsystem_pthread.dylib             0x00000001005a2119 _pthread_wqthread + 619
	24  libsystem_pthread.dylib             0x00000001005a1e41 start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions