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

Fixed -[PTUSBHUB scheduleReadPacketWithCallback:] crash #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fixed -[PTUSBHUB scheduleReadPacketWithCallback:] crash #44

wants to merge 1 commit into from

Conversation

jdjennin
Copy link

@jdjennin jdjennin commented Aug 9, 2017

I added code and commented out a faulty assertion to handle a mysterious crash that resulted from disconnecting devices from a macOS client. I had several crash reports that share this backtrace, and I finally reproduced it while connected to Xcode and found that buffer_size == 0 and done == true when a device disconnects. We get into this block of code where assert(buffer_size == sizeof(ref_upacket.size)), and the macOS client crashes. This assertion doesn't seem necessary. If there's no data and no error and GCD says we're done, then this is really just a no-op, and we should just return from the block rather than crash.

@jdjennin
Copy link
Author

jdjennin commented Aug 9, 2017

Re: #34

@rsms rsms self-requested a review December 9, 2017 03:26
Copy link
Owner

@rsms rsms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome!
Could you adjust the indentation to match the existing source file please? (2 SPACEs) Makes the diff easier to read and makes the code fit in with the rest of the project.

miokato added a commit to miokato/peertalk that referenced this pull request Jan 30, 2021
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.

2 participants