Skip to content

Incorrect time calculation in scheduler on 32 bit systems #29

@wisd0me

Description

@wisd0me

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions