Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem to read .mat file when terminating a process #4

Open
kouroshD opened this issue Dec 17, 2019 · 2 comments
Open

Problem to read .mat file when terminating a process #4

kouroshD opened this issue Dec 17, 2019 · 2 comments

Comments

@kouroshD
Copy link

Hi,
I start using MatLogger in one of my projects.
When I terminate the process (ctrl+c) that uses matlogger, sometimes I get the following message before the process terminates:

libc++abi.dylib: terminating with uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument

And in this case, I cannot read generated .mat file inside the matlab (even if its size is not 0 kb!)
And I suspect it is related t MatLogger, since before I did not have this error, and MatLogger is using mutex.
However, in other cases I have the following prints inside the terminal:

XBot::MatAppender::~MatAppender()
Flusher thread exiting.. Written 0.0 MB
Flushed all data for file 'myData.mat'

So, I wanted to know what is the correct way to close the logger, and finally call its destructor.
Do I need to flush the available data in YARP::RFModule::close method by calling flush_available_data()method? or I should use reset() method ?

Thank you.

@alaurenzi
Copy link
Collaborator

Hi, I am reading this with huge delay but... if you are still interested, you could provide me

  • a backtrace obtained with gdb running a Debug build of MatLogger
  • possibly, a minimum working example that I can compile and that shows (even sporadically) the issue

I know the latter could be a problem, but the first could really help

@kouroshD
Copy link
Author

No problem with the delay :)
Unfortunately, I could not log the gdb output, since it was not supporting the latest version of macOS, and I did not try it recently. This problem was happening some times, not always, so I think it was related to memory management.
After I added the following line in the code, https://github.com/robotology/walking-teleoperation/blob/75169f6ecd71feb8a71f2428e23ac0eae18d0345/modules/Oculus_module/src/OculusModule.cpp#L426, I did not face the problem anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants