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

RealtimeSynchronize block "clock_nanosleep" error on Linux #357

Closed
bernhard-thiele opened this issue May 19, 2022 · 0 comments
Closed

RealtimeSynchronize block "clock_nanosleep" error on Linux #357

bernhard-thiele opened this issue May 19, 2022 · 0 comments
Assignees
Labels
Milestone

Comments

@bernhard-thiele
Copy link
Collaborator

bernhard-thiele commented May 19, 2022

Sporadically there is an error when using Blocks.OperatingSystem.RealtimeSynchronize on Linux. The simulation exits with the message MDDRealtimeSynchronize.h: clock_nanosleep(..) failed.

The reason for this is that

ret = clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &t_abs, NULL);

fails due to an invalid t_abs (negative t_abs.tv_nsec). The cause is further up in
ret = timespec_subtract(&t_elapsed, &t_now, &rtSync->t_last);

where it was overlooked that timespec_subtract(...) may modify its third argument for perfomring a carry.

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

No branches or pull requests

1 participant