[asterisk-bugs] [JIRA] (ASTERISK-21395) High CPU use due to invalid time limit passed to kevent() in pbx_spool.c:scanthread
Stuart Henderson (JIRA)
noreply at issues.asterisk.org
Tue Apr 9 09:10:01 CDT 2013
Stuart Henderson created ASTERISK-21395:
-------------------------------------------
Summary: High CPU use due to invalid time limit passed to kevent() in pbx_spool.c:scanthread
Key: ASTERISK-21395
URL: https://issues.asterisk.org/jira/browse/ASTERISK-21395
Project: Asterisk
Issue Type: Bug
Security Level: None
Components: Core/PBX
Affects Versions: 11.3.0
Environment: OpenBSD since switching to kernel backed threads (in 5.1)
Reporter: Stuart Henderson
scan_thread() (pbx_spool.c:754) passes an invalid time limit (INT_MAX) to kevent() if the directory list is empty. This results in high CPU use as the call fails with EINVAL (see line 613 of http://www.openbsd.org/cgi-bin/cvsweb/src/sys/kern/kern_time.c?annotate=1.77) and hits the "continue". So in the case where next == INT_MAX, NULL should be passed instead.
Obvious patch is in OpenBSD ports, I won't submit it here directly as I don't particularly want to sign a license disclaimer, but it wouldn't be a big surprise if anyone looking at this came up with an identical fix ;)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the asterisk-bugs
mailing list