thread.newThread lib/webapi.lua
filesystem.newFileData lib/webapi.lua
filesystem.newFile lib/webapi.lua
love(78342,0x70000473f000) malloc: *** error for object 0x7fa822e31210: double free
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
The first three lines are logged by my allocation tracker and shows that love.thread.newThread was called by the webapi library prior to the crash. This is the small webapi lib used to make the async https calls. https://github.com/Ulydev/wapi/blob/master/webapi.lua
Can this be related to misusing LOVE threads or does it look like an issue with luasec? How can I narrow down the issue?
I couldn't get a test case working because getting love2d import luasec is such a pain, but I dumbed down webapi.lua to use a single thread and queue up the request. I suspect that luasec (or openssl itself) is not thread-safe, Google kinda confirms this https://github.com/brunoos/luasec/issues/66. Thanks for the help, I'm moving on.