Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PLAT-7432] Fix crash in -[BSGURLSessionTracingProxy forwardInvocation:] #1208

Merged
merged 2 commits into from Oct 14, 2021

Conversation

nickdowell
Copy link
Contributor

Goal

Fix a crash in -[NSInvocation selector] when called from -[BSGURLSessionTracingProxy forwardInvocation:] for some (malformed?) invocations that have appear to have too few arguments.

NSInvalidArgumentException: -[NSInvocation getArgument:atIndex:]: index (1) out of bounds [-1, 0]

0  CoreFoundation   -[NSInvocation getArgument:atIndex:]
1  CoreFoundation   -[NSInvocation selector]
2  AppName          -[BSGURLSessionTracingProxy forwardInvocation:] (BSGURLSessionTracingProxy.m:51:32)

Changeset

The crash is avoided by simplifying the implementation of forwardInvocation: and removing the call to -[NSInvocation selector] - which is possible because BSGURLSessionTracingProxy now implements URLSession:task:didFinishCollectingMetrics:

Testing

Unit tests have been added to ensure the forwarding logic works as intended.

Unit tests now run on CI, which required some alteration of settings and code.

.buildkite/pipeline.yml Show resolved Hide resolved
.buildkite/pipeline.yml Show resolved Hide resolved
@github-actions
Copy link

Infer: No issues found 🎉

OCLint: No issues found 🎉

Bugsnag.framework binary size did not change - 1,255,032 bytes

Generated by 🚫 Danger

@kstenerud kstenerud self-requested a review October 14, 2021 13:00
@nickdowell nickdowell merged commit b784cb0 into next Oct 14, 2021
@nickdowell nickdowell deleted the nickdowell/fix-session-tracing-proxy-crash branch October 14, 2021 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants