deephealthproject / eddl

European Distributed Deep Learning (EDDL) library. A general-purpose library initially developed to cover deep learning needs in healthcare use cases within the DeepHealth project.
https://deephealthproject.github.io/eddl/
MIT License
34 stars 10 forks source link

Error: unlock of unowned mutex #197

Closed MicheleCancilla closed 3 years ago

MicheleCancilla commented 3 years ago

I'm trying to execute the pipeline with Visual Studio 2017, but the application crashes with unlock of unowned mutex error.

The crash occurs in Tensor destructor when trying to unlock an already unlocked mutex: https://github.com/deephealthproject/eddl/blob/6a84eb9358c077a76ebe0a9bab99c452367e5259/src/tensor/tensor.cpp#L111

The mutex::unlock() reference says:

The mutex must be locked by the current thread of execution, otherwise, the behavior is undefined.

I think you could use std::unique_lock and std::lock_guard to manage semaphore for Tensor. I don't know if this error also happens with other compilers.

RParedesPalacios commented 3 years ago

Hi, yes this is related to the delete problems as well we are going to check that

salvacarrion commented 3 years ago

Fixed. #219