The code from #2433039 (https://sourceforge.net/tracker/?func=detail&aid=2433039&group_id=72276&atid=533973) running in multiple threads results in segfaults or lockups. See attached file.
The problem appears to be in writeFunction callback modifying caml_local_roots without acquiring runtime lock first. writeFunction.diff fixes this problem. Most probably other callbacks need the same fix as well.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The problem appears to be in writeFunction callback modifying caml_local_roots without acquiring runtime lock first. writeFunction.diff fixes this problem. Most probably other callbacks need the same fix as well.
apply the same fix to all callbacks
callback.diff applies the same fix to all callbacks. Not tested.
Fixed some other bugs and added curl multi wrappers. Git repo at http://repo.or.cz/w/ocurl.git
Thank you very much for the bug report and the patch. I have committed your changes in callback.diff.
Some more subtle crash bugs found :
http://repo.or.cz/w/ocurl.git/commitdiff/fc2449d91f2c46f45d8e2cbe9bf0cff0c16e0744
http://repo.or.cz/w/ocurl.git/commitdiff/e4bcc045482f81514d749a9a8e7f54a90df1d06b
(the above two should be applied together cause fc2449 is partially broken)
http://repo.or.cz/w/ocurl.git/commitdiff/c2d4182cfc1a3a8737cdade62941c7f9561c14a4
http://repo.or.cz/w/ocurl.git/commitdiff/2633e1e4cb6435d4d0f353fcfbf547ea16a14fa8
Thank you very much once again. I have hopefully fixed all the issues you identified in your patches.