mochidev / urlsessionbackport Goto Github PK
View Code? Open in Web Editor NEWBackward compatible async/await for URLSession!
License: MIT License
Backward compatible async/await for URLSession!
License: MIT License
This should prevent issues when most people are just using URLSession willy nilly without configuring their own.
First at all, thanks a lot for taking the time to create a library that backports the async/await versions of URLSession
to iOS 14.
I am currently implementing some feature based on URLSession.bytes(for:)
in my codebase. I still need to support iOS 14 and therefore found your library. In general the port works, but unfortunately not reliably. I often face crashes related to EXC_BAD_ACCESS
or SIGABRT
. When using an iOS 15 simulator, and therefore using the system provided methods the crash is not appearing,
I already tried to debug it a little, and it always crashes within the DataAccumulator
. But at random places. Sometimes when data is added to the internal buffer or sometimes when reading from it. But the place seems to be random. I assume that there are some race conditions when the data receival is ending.
Some examplary stack trace:
2022-06-20 21:03:10.358559+0200 URLSessionBackportTest[24786:502404] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed
URLSessionBackportTest(24786,0x700007ae8000) malloc: Incorrect checksum for freed object 0x7f807c40f288: probably modified after being freed.
Corrupt value: 0xffffffe00000000
URLSessionBackportTest(24786,0x700007ae8000) malloc: *** set a breakpoint in malloc_error_break to debug
URLSessionBackportTest(24786,0x700007ae8000) malloc: Incorrect checksum for freed object 0x7f807c40f288: probably modified after being freed.
Corrupt value: 0xffffffe00000000
CoreSimulator 802.6.1 - Device: iPhone 8 Plus (250B5764-5BFD-440B-A918-82B557B5A993) - Runtime: iOS 14.5 (18E182) - DeviceType: iPhone 8 Plus
(lldb)
In the stack trace it can also be the seen where from the DataAccumulator
this comes from:
2022-06-20 21:36:20.604135+0200 URLSessionBackportTest[26678:539387] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed
URLSessionBackportTest(26678,0x70000a1da000) malloc: Incorrect checksum for freed object 0x7fe7d9905d18: probably modified after being freed.
Corrupt value: 0x2ffffffe00000000
URLSessionBackportTest(26678,0x70000a1da000) malloc: *** set a breakpoint in malloc_error_break to debug
URLSessionBackportTest(26678,0x70000a1da000) malloc: Incorrect checksum for freed object 0x7fe7d9905d18: probably modified after being freed.
Corrupt value: 0x2ffffffe00000000
CoreSimulator 802.6.1 - Device: iPhone 8 Plus (250B5764-5BFD-440B-A918-82B557B5A993) - Runtime: iOS 14.5 (18E182) - DeviceType: iPhone 8 Plus
(lldb)
I have also created a test repository which loads some image and also contains the kind of code I use the library with: https://github.com/alexanderwe/URLSessionBackportTest
Any help with that is highly appreciated !
Needs more tests to compare the esoteric cases to each other. I'm thinking of duplicating many of the tests with non-backported implementations, so if something nitty gritty changes (URL Session changes the order in which delegate methods are called, for instance), we can catch them.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.