Comments (3)
Are you sure it's not the second assertion? I.e. assert(sizeof(usbmux_packet_t) == 16);
I'm working on a new version of peertalk where I fixed an issue pertaining to this, namely that depending on compiler version and settings, the actual size of a struct might be larger than what's needed (usually an optimization to align it to words.) This might cause sizeof
to report not the logical size, but the effective size of the struct.
Can you repro the crash? If so, run the app through lldb (e.g. lldb /path/to/your.app/Contents/MacOS/your
) and see where it actually aborts from an assertion. It's also possible you've got a stack overflow issue in which case the stack trace might be incorrect.
BTW, the fix to the struct size is this:
typedef struct usbmux_packet {
...
} __attribute__((__packed__)) usbmux_packet_t;
from peertalk.
The second assert should crash on the first call, as sizeof(usbmux_packet_t)
is known at compile time (and might be even optimized out). We are getting the traces through Crashlytics, and the issue repeats quite frequently.
I tried to replicate the call sequence to check for any unexpected value of payloadLength
causing the crash, but couldn't. But note that nowhere is checked that the received upacket_len
is bigger than sizeof(usbmux_packet_t)
, so a corrupt/unexpected packet of zero or less than 16 size would cause payloadLength
to have a value near to UINT32_MAX
(adding back 16 in usbmux_packet_alloc
will cause this to allocate undersized packets).
from peertalk.
b3090d7 makes some changes that should help in preventing getting into these situations. usbmux_packet
s are only used during negotiation with the USB mux hub, but isn't used for user communication (i.e. PTChannel doesn't use these packets and doesn't have these limitations.)
from peertalk.
Related Issues (20)
- How to connect multi devices?
- using peertalk with with python binding HOT 2
- Cocoapods Not Updated HOT 2
- Mention in documentation that frame type must be >= 100? HOT 1
- visit website provided by http-server HOT 1
- Cannot initialize a variable of type 'PTExampleTextFrame *' (aka '_PTExampleTextFrame *') with an rvalue of type 'void *' HOT 1
- Tag master with a new version HOT 3
- Connect Ios App with Ubuntu OS HOT 6
- How to speed up data transferring?
- PTUSBHub failed to initialize: Error HOT 4
- Using PeerTalk without the protocol and channel component?
- Does this app require two-way communication? Can I only listen to data input? HOT 1
- run with usbmuxd HOT 1
- how can I transform files by Peertalk HOT 1
- Use too much memory HOT 1
- PeerTalk with Arduino HOT 5
- Can I use Peertalk to send message between iPhone and iPad?
- Status of the library HOT 1
- send/receive with apple lightning - USB(OTG) to Arduino device HOT 5
- issues with grafting to ios8 Failed to connect to device #22: Error Domain=PTUSBHubError Code=3 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from peertalk.