You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Maybe the .success case is already causing the data accumulator to be deallocated but another continuation is still running ?
Or maybe some other race condition is occuring, not sure unfortunately :/
Some examplary stack trace:
First Example
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:
Second Example
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)
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 toEXC_BAD_ACCESS
orSIGABRT
. 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:
First Example
In the stack trace it can also be the seen where from the
DataAccumulator
this comes from:Second Example
Third example
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 !
The text was updated successfully, but these errors were encountered: