Skip to content

New unexpected issue in Parse.initialize #1851

Open
@phbardon

Description

@phbardon

New Issue Checklist

Issue Description

  • Running app on Simulator without any recent change in versions used (for months…).
  • For information, an Xcode crash led me just before to delete existing schemes to create new ones

Then recurrent crash in Parse.initialize which has not been changed.

        let configuration = ParseClientConfiguration {
            $0.isLocalDatastoreEnabled = false
            $0.applicationId = holisService.applicationId
            $0.clientKey = holisService.clientKey
            $0.server = holisService.server
			$0.networkRetryAttempts = 3
        }
        Parse.initialize(with: configuration)

Finally solved by adding the subclassing below for all reserved classes, but as explained in #1792 and #1809 it should not be needed anymore.

		PFInstallation.registerSubclass()
		PFUser.registerSubclass()
		PFSession.registerSubclass()
		PFRole.registerSubclass()

Steps to reproduce

Not sure that it can be reproduced as this has been already solved by #1792 and #1809 and it could come from local unknown configuration.

Actual Outcome

Crash

Expected Outcome

Is there any setting in the schemes that could change this behaviour?

Environment

  • Xcode: 16.3
  • iOS: 18.0
  • Operating system: MacOS Sequoia 15.4

Client

  • Parse ObjC SDK version: 5.1.1

Server

  • Parse Server version: 3.6.0
  • Operating system: UNKNOWN
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): REMOTE

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 3.6.0
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): REMOTE

Logs

2025-05-08 18:39:14.684534+0200 APPNAME[52544:1867994] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid class name. Class names cannot start with an underscore.'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001804c88c0 __exceptionPreprocess + 172
	1   libobjc.A.dylib                     0x00000001800937cc objc_exception_throw + 72
	2   CoreFoundation                      0x00000001804c87d0 -[NSException initWithCoder:] + 0
	3   APPNAME.debug.dylib            0x0000000107adb508 +[PFObject(Private) _assertValidInstanceClassName:] + 112
	4   APPNAME.debug.dylib            0x0000000107ae01c0 -[PFObject init] + 268
	5   APPNAME.debug.dylib            0x0000000107ae0470 +[PFObject objectWithClassName:objectId:completeData:] + 172
	6   APPNAME.debug.dylib            0x0000000107ae06e4 +[PFObject objectWithoutDataWithClassName:objectId:] + 160
	7   APPNAME.debug.dylib            0x0000000107aa0ef8 +[PFObjectFile2025-05-08 18:39:14.684569+0200 APPNAME[52544:1868000] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid class name. Class names cannot start with an underscore.'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001804c88c0 __exceptionPreprocess + 172
	1   libobjc.A.dylib                     0x00000001800937cc objc_exception_throw + 72
	2   CoreFoundation                      0x00000001804c87d0 -[NSException initWithCoder:] + 0
	3   APPNAME.debug.dylib            0x0000000107adb508 +[PFObject(Private) _assertValidInstanceClassName:] + 112
	4   APPNAME.debug.dylib            0x0000000107ae01c0 -[PFObject init] + 268
	5   APPNAME.debug.dylib            0x0000000107ae0470 +[PFObject objectWithClassName:objectId:completeData:] + 172
	6   APPNAME.debug.dylib            0x0000000107ae07c0 +[PFObject object] + 160
	7   APPNAME.debug.dylib            0x0000000107a8c284 __56-[PFCurrentInstallationController getCurrentObjectAsync]_block_invoke.9 + 196
	8   APPNAME.debug.d
Coder objectFromData:usingDecoder:] + 276
	8   APPNAME
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid class name. Class names cannot start with an underscore.'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001804c88c0 __exceptionPreprocess + 172
	1   libobjc.A.dylib                     0x00000001800937cc objc_exception_throw + 72
	2   CoreFoundation                      0x00000001804c87d0 -[NSException initWithCoder:] + 0
	3   APPNAME.debug.dylib            0x0000000107adb508 +[PFObject(Private) _assertValidInstanceClassName:] + 112
	4   APPNAME.debug.dylib            0x0000000107ae01c0 -[PFObject init] + 268
	5   APPNAME.debug.dylib            0x0000000107ae0470 +[PFObject objectWithClassName:objectId:completeData:] + 172
	6   APPNAME.debug.dylib            0x0000000107ae06e4 +[PFObject objectWithoutDataWithClassName:objectId:] + 160
	7   APPNAME.debug.dylib            0x0000000107aa0ef8 +[PFObjectFileCoder objectFromData:usingDecoder:] + 276
	8   APPNAME.debug.dylib            0x0000000107aa2df0 __69-[PFObjectFilePersistenceController loadPersistentObjectAsyncForKey:]_block_invoke.2 + 92
	9   APPNAME.debug.dylib            0x0000000107afbd78 __62-[BFTask continueWithExecutor:successBlock:cancellationToken:]_block_invoke + 76
	10  APPNAME.debug.dylib            0x0000000107afb88c __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke + 72
	11  APPNAME.debug.dylib            0x0000000107af98d0 __29+[BFExecutor defaultExecutor]_block_invoke_2 + 128
	12  APPNAME.debug.dylib            0x0000000107af9d8c -[BFExecutor execute:] + 60
	13  APPNAME.debug.dylib            0x0000000107afb54c -[BFTask runContinuations] + 272
	14  APPNAME.debug.dylib            0x0000000107afb180 -[BFTask trySetResult:] + 112
	15  APPNAME.debug.dylib            0x0000000107afc2a4 -[BFTaskCompletionSource setResult:] + 60
	16  APPNAME.debug.dylib            0x0000000107afba34 __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke_2 + 160
	17  APPNAME.debug.dylib            0x0000000107afb88c __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke + 72
	18  APPNAME.debug.dylib            0x0000000107af98d0 __29+[BFExecutor defaultExecutor]_block_invoke_2 + 128
	19  APPNAME.debug.dylib            0x0000000107af9d8c -[BFExecutor execute:] + 60
	20  APPNAME.debug.dylib            0x0000000107afb54c -[BFTask runContinuations] + 272
	21  APPNAME.debug.dylib            0x0000000107afb180 -[BFTask trySetResult:] + 112
	22  APPNAME.debug.dylib            0x0000000107afc2a4 -[BFTaskCompletionSource setResult:] + 60
	23  APPNAME.debug.dylib            0x0000000107afb940 __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke + 252
	24  libdispatch.dylib                   0x0000000100743ec8 _dispatch_call_block_and_release + 24
	25  libdispatch.dylib                   0x000000010075d798 _dispatch_client_callout + 12
	26  libdispatch.dylib                   0x000000010077b624 _dispatch_queue_override_invoke + 976
	27  libdispatch.dylib                   0x0000000100757290 _dispatch_root_queue_drain + 356
	28  libdispatch.dylib                   0x0000000100757dd4 _dispatch_worker_thread2 + 256
	29  libsystem_pthread.dylib             0x0000000100c66b90 _pthread_wqthread + 228
	30  libsystem_pthread.dylib             0x0000000100c6598c start_wqthread + 8
)
libc++abi: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid class name. Class names cannot start with an underscore.'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001804c88c0 __exceptionPreprocess + 172
	1   libobjc.A.dylib                     0x00000001800937cc objc_exception_throw + 72
	2   CoreFoundation                      0x00000001804c87d0 -[NSException initWithCoder:] + 0
	3   APPNAME.debug.dylib            0x0000000107adb508 +[PFObject(Private) _assertValidInstanceClassName:] + 112
	4   APPNAME.debug.dylib            0x0000000107ae01c0 -[PFObject init] + 268
	5   APPNAME.debug.dylib            0x0000000107ae0470 +[PFObject objectWithClassName:objectId:completeData:] + 172
	6   APPNAME.debug.dylib            0x0000000107ae07c0 +[PFObject object] + 160
	7   APPNAME.debug.dylib            0x0000000107a8c284 __56-[PFCurrentInstallationController getCurrentObjectAsync]_block_invoke.9 + 196
	8   APPNAME.debug.dylib            0x0000000107afbd78 __62-[BFTask continueWithExecutor:successBlock:cancellationToken:]_block_invoke + 76
	9   APPNAME.debug.dylib            0x0000000107afb88c __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke + 72
	10  APPNAME.debug.dylib            0x0000000107af98d0 __29+[BFExecutor defaultExecutor]_block_invoke_2 + 128
	11  APPNAME.debug.dylib            0x0000000107af9d8c -[BFExecutor execute:] + 60
	12  APPNAME.debug.dylib            0x0000000107afb54c -[BFTask runContinuations] + 272
	13  APPNAME.debug.dylib            0x0000000107afb180 -[BFTask trySetResult:] + 112
	14  APPNAME.debug.dylib            0x0000000107afc428 -[BFTaskCompletionSource trySetResult:] + 60
	15  APPNAME.debug.dylib            0x0000000107aa9ed0 __28-[PFAsyncTaskQueue enqueue:]_block_invoke_2 + 140
	16  APPNAME.debug.dylib            0x0000000107afb88c __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke + 72
	17  libdispatch.dylib                   0x0000000100743ec8 _dispatch_call_block_and_release + 24
	18  libdispatch.dylib                   0x000000010075d798 _dispatch_client_callout + 12
	19  libdispatch.dylib                   0x000000010077b624 _dispatch_queue_override_invoke + 976
	20  libdispatch.dylib                   0x0000000100757290 _dispatch_root_queue_drain + 356
	21  libdispatch.dylib                   0x0000000100757dd4 _dispatch_worker_thread2 + 256
	22  libsystem_pthread.dylib             0x0000000100c66b90 _pthread_wqthread + 228
	23  libsystem_pthread.dylib             0x0000000100c6598c start_wqthread + 8
)
terminating due to uncaught exception of type NSException
libc++abi: terminating due to 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