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

Incorrect time calculation in scheduler on 32 bit systems #29

Open
wisd0me opened this issue Sep 2, 2014 · 1 comment
Open

Incorrect time calculation in scheduler on 32 bit systems #29

wisd0me opened this issue Sep 2, 2014 · 1 comment

Comments

@wisd0me
Copy link

wisd0me commented Sep 2, 2014

There is a bug in integer addition in _lthread_usec_now(): signed long time_t overflows. The return statement must look like this:

/* _lthread_usec_now(): */
    return (uint64_t) t1.tv_sec * 1000000 + t1.tv_usec;

Bug shows itself as follows - after some point in time lthread functions with timeouts start trashing the cpu, in my case it was lthread_read(). I've found this after I was unable to recover seconds from sched->birth on my 32bit box.

@wisd0me
Copy link
Author

wisd0me commented Nov 26, 2014

I must notice, that to confirm & fix this bug, only a few things required:

  1. gdb
  2. 32 bit box
  3. change one line of code

Which of them is causing the trouble?

@wisd0me wisd0me mentioned this issue Dec 15, 2014
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

1 participant