lime icon indicating copy to clipboard operation
lime copied to clipboard

CURL is freezing the application

Open barisyild opened this issue 5 months ago • 0 comments

I found a bug that froze the application. https://github.com/openfl/lime/blob/1c8ecd30eab3f2b5840a9f8abf3887d8be35aa2d/project/src/net/curl/CURLBindings.cpp#L2506 in this line, curl_multi_perform some times takes too many times due to curl_getaddrinfo. If you resize the window (or collect gc) while the application is in mutex lock, the application freezes until curl_multi_perform is completed!

Reproduce:

  1. Change this class like this. image
  2. Make http request from OpenFL (or Lime?) with HxCPP target.
  3. Resize window (or collect GC).
  4. See result, in this example the app will freeze forever, normally the app freezes until getaddr happens.

Here is real world callstack grabbed from testflight user: Main Thread: image

Curl Thread: image

Another example of main thread for garbage collection problem: image

I also tried on Windows, iOS and confirmed the problem.

barisyild avatar Mar 16 '24 00:03 barisyild