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
{{ message }}
Repository navigation
Regression 1.3.3 => 1.4.0: Deadlock when using TarInputStream.GetNextEntry() in WPF application #786
This is part of a large WPF application (.NET Framework 4.8), I have to build a small reproduction. I just want to mention this issue in case someone has the same problem.
Expected behavior
TarInputStream.GetNextEntry() should not deadlock when used on the main thread.
changed the title [-]Regression 1.3.3 => 1.4.0: Deadlock when using TarInputStream.Files() in WPF application[/-][+]Regression 1.3.3 => 1.4.0: Deadlock when using TarInputStream.GetNextEntry() in WPF application[/+]on Oct 18, 2022
I took a look at TarInputStream and TarBuffer, but I don't have a good idea how one can separate the sync and async parts (after all, it's "just" the Read* methods which are async), so both sync & async can be provided, without copying the code surrounding the async calls.
I will think about it from time to time and will report any progress if I come up with something.
Activity
[-]Regression 1.3.3 => 1.4.0: Deadlock when using TarInputStream.Files() in WPF application[/-][+]Regression 1.3.3 => 1.4.0: Deadlock when using TarInputStream.GetNextEntry() in WPF application[/+]flensrocker commentedon Oct 18, 2022
It happens when I wrap the
TarInputStreamwith anGZipStream.See this small reproduction sample: https://github.com/flensrocker/SharpZipLibDeadLock
When I downgrade SharpZipLib to 1.3.3 it won't lock.
piksel commentedon Oct 19, 2022
Thanks for a thorough report! I will investigate this further...
flensrocker commentedon Oct 19, 2022
I took a look at
TarInputStreamandTarBuffer, but I don't have a good idea how one can separate the sync and async parts (after all, it's "just" theRead*methods which are async), so both sync & async can be provided, without copying the code surrounding the async calls.I will think about it from time to time and will report any progress if I come up with something.
flensrocker commentedon Oct 19, 2022
Adding
.ConfigureAwait(false)to everyawaitseems to fix my issue.After all it's a "best practice" for general purpose libraries, see https://devblogs.microsoft.com/dotnet/configureawait-faq/