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
I'm getting a crash in libmagic when using this library with multiple goroutimes. I suspect the reason is because this library keeps a single global handle that is used for all libmagic calls. A quick google search tells me that libmagic handles cannot be shared across threads.
Perhaps a better way to deal with this would be to wrap the libmagic handle as an opaque object that is passed back to the caller from Open(). Close() would also need a receiver or take an opaque handle as an argument.
The text was updated successfully, but these errors were encountered:
I worked around it by wrapping my calls to TypeByBuffer in a mutex. Adding that to the library is another possible option, though it limits throughput.
I'm getting a crash in libmagic when using this library with multiple goroutimes. I suspect the reason is because this library keeps a single global handle that is used for all libmagic calls. A quick google search tells me that libmagic handles cannot be shared across threads.
Perhaps a better way to deal with this would be to wrap the libmagic handle as an opaque object that is passed back to the caller from Open(). Close() would also need a receiver or take an opaque handle as an argument.
The text was updated successfully, but these errors were encountered: