Skip to content

addTimer() accepts values that it doesn't support, freezes StremSelectLoop::run() #168

Description

@arnaud-lb

When addTimer() receives a $interval parameter that's high enough, a float value is passed to usleep(). The function will reject the value, and return immediately, causing a busy loop.

StremSelectLoop currently does not support intervals higher than PHP_INT_MAX/1000000. This limitation itself is not harmful, however it freezes any program that accidentally sets an interval higher than this.

Activity

  1. changed the title [-]addTimer() accepts values that it doesn't support, causes buzy loop in StremSelectLoop::run()[/-] [+]addTimer() accepts values that it doesn't support, freezes StremSelectLoop::run()[/+] on Jun 24, 2018
  2. clue commented on Jun 25, 2018

    @clue
    Member

    @arnaud-lb Thank you for reporting!

    Unfortunately, I'm currently unable to reproduce the problem you're seeing.

    A similar issue has been fixed via #132 a while back and my tests confirm that this should be fixed (the PR also uses a timer interval of PHP_INT_MAX).

    Is the problem you're seeing reproducible? Can you show a gist that highlights this issue?

  3. clue commented on Jun 28, 2018

    @clue
    Member

    I'm closing this for now as it hasn't received any new input and I believe this has been answered. Please come back with more details if this problem persists and we can reopen this 👍

  4. arnaud-lb commented on Jun 28, 2018

    @arnaud-lb
    Author

    Thanks, I confirm that #132 fixed the problem.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions