openid / openid/AppAuth-iOS

Crash: OIDURLQueryComponent.m line 117

Open
#448 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Objective-C
Stars
2k
Forks
867
Avg merge
4d 48m
Merged PRs (30d)
1

Description

Happens for some users on iOS 12 and 13.

Here is a log from Fabric:

Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x1f043298c __exceptionPreprocess
1 libobjc.A.dylib 0x1ef60b9f8 objc_exception_throw
2 CoreFoundation 0x1f03ac3f8 _CFArgv
3 CoreFoundation 0x1f031d0cc -[__NSArrayM insertObject:atIndex:]
4 Safe In Cloud.Free 0x100c86314 -[OIDURLQueryComponent addParameter:value:] + 117 (OIDURLQueryComponent.m:117)
5 Safe In Cloud.Free 0x100c8495c -[OIDTokenRequest URLRequest] + 297 (OIDTokenRequest.m:297)
6 Safe In Cloud.Free 0x100c77b80 +[OIDAuthorizationService performTokenRequest:originalAuthorizationResponse:callback:] + 433 (OIDAuthorizationService.m:433)
7 Safe In Cloud.Free 0x100c7b004 -[OIDAuthState performActionWithFreshTokens:additionalRefreshParameters:dispatchQueue:] + 513 (OIDAuthState.m:513)
8 Safe In Cloud.Free 0x100c7ad6c -[OIDAuthState performActionWithFreshTokens:additionalRefreshParameters:] + 465 (OIDAuthState.m:465)
9 Safe In Cloud.Free 0x100c87fb8 -[GTMAppAuthFetcherAuthorization authorizeRequestArgs:] + 235 (GTMAppAuthFetcherAuthorization.m:235)
10 Safe In Cloud.Free 0x100c888f4 -[GTMAppAuthFetcherAuthorization authorizeRequest:delegate:didFinishSelector:] + 370 (GTMAppAuthFetcherAuthorization.m:370)
11 Safe In Cloud.Free 0x100c931d8 -[GTMSessionFetcher authorizeRequest] + 1600 (GTMSessionFetcher.m:1600)
12 Safe In Cloud.Free 0x100c8fadc -[GTMSessionFetcher beginFetchMayDelay:mayAuthorize:] + 751 (GTMSessionFetcher.m:751)
13 Safe In Cloud.Free 0x100cb7518 -[GTLRService fetchObjectWithURL:objectClass:bodyObject:dataToPost:ETag:httpMethod:mayAuthorize:completionHandler:executingQuery🎫] + 867 (GTLRService.m:867)
14 Safe In Cloud.Free 0x100cb8c34 -[GTLRService fetchObjectWithURL:objectClass:bodyObject:ETag:httpMethod:mayAuthorize:completionHandler:executingQuery🎫] + 1127 (GTLRService.m:1127)
15 Safe In Cloud.Free 0x100cbcda4 -[GTLRService executeQuery:completionHandler:] + 2248 (GTLRService.m:2248)
16 Safe In Cloud.Free 0x100c2851c __24-[GDriveDriver userInfo]_block_invoke + 132 (GDriveDriver.m:132)

The calling code:

NSError* error = nil;
GTLRDriveQuery_AboutGet *query = [GTLRDriveQuery_AboutGet query];
query.fields = @"kind,user(kind,displayName,emailAddress,photoLink)";
[self.service executeQuery:query completionHandler:^(GTLRServiceTicket *ticket, id about, NSError *error) {...}];

Pod file:

pod 'GoogleAPIClientForREST'
pod 'GoogleAPIClientForREST/Drive'
pod 'GoogleAPIClientForREST/Oauth2'
pod 'GTMAppAuth'
pod 'AppAuth'

Pod.lock:

  • AppAuth (1.2.0):
    • AppAuth/Core (= 1.2.0)
    • AppAuth/ExternalUserAgent (= 1.2.0)
  • AppAuth/Core (1.2.0)
  • AppAuth/ExternalUserAgent (1.2.0)
  • GoogleAnalytics (3.17.0)
  • GoogleAPIClientForREST (1.3.10):
    • GoogleAPIClientForREST/Core (= 1.3.10)
    • GTMSessionFetcher (>= 1.1.7)
  • GoogleAPIClientForREST/Core (1.3.10):
    • GTMSessionFetcher (>= 1.1.7)
  • GoogleAPIClientForREST/Drive (1.3.10):
    • GoogleAPIClientForREST/Core
    • GTMSessionFetcher (>= 1.1.7)
  • GoogleAPIClientForREST/Oauth2 (1.3.10):
    • GoogleAPIClientForREST/Core
    • GTMSessionFetcher (>= 1.1.7)
  • GTMAppAuth (1.0.0):
    • AppAuth/Core (~> 1.0)
    • GTMSessionFetcher (~> 1.1)
  • GTMSessionFetcher (1.2.2):
    • GTMSessionFetcher/Full (= 1.2.2)
  • GTMSessionFetcher/Core (1.2.2)
  • GTMSessionFetcher/Full (1.2.2):
    • GTMSessionFetcher/Core (= 1.2.2)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting OIDURLQueryComponent.m at line 117 and the OIDTokenRequest.m call at line 297, then trace the token refresh path shown in the crash log. Reproduce the request on iOS 12 or 13 with the listed AppAuth and Google API dependencies. Done means the reported NSInvalidArgumentException no longer occurs, though the issue does not define the expected behavior or a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c
Domain
authentication, mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.