[asterisk-bugs] [JIRA] (ASTERISK-23383) Wrong sense test on stat return code causes unchanged config check to break with include files.

Kinsey Moore (JIRA) noreply at issues.asterisk.org
Wed Mar 5 14:42:48 CST 2014


     [ https://issues.asterisk.org/jira/browse/ASTERISK-23383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kinsey Moore closed ASTERISK-23383.
-----------------------------------

    Resolution: Fixed

The fix to the stat test has been committed to 1.8, 11, 12, and trunk. Thanks for the report and for finding the issue!

> Wrong sense test on stat return code causes unchanged config check to break with include files.
> -----------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-23383
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-23383
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Core/Configuration
>    Affects Versions: SVN, 1.8.25.0
>         Environment: CentOS, although not really environment specific.
>            Reporter: David Woolley
>            Assignee: Kinsey Moore
>            Severity: Minor
>
> Whilst trying to understand why an old version (1.6.1.0) was not treating configuration files as unchanged during a reload if there were include files, we discovered the equivalent of the following code, which clearly has the wrong sense test on the result of stat.  This quote has been taken from the trunk version, but it has remained unchanged since the 1.8 branch version, and differs only in the use of direct assignments before that.
> In config_cache_attribute in main/config.c
> {code}
> if (!stat(configfile, &statbuf)) {
>        cfmstat_clear(cfmtime);
> } else {
>        cfmstat_save(cfmtime, &statbuf);
> }
> {code}
> Whilst I still haven't worked out why the including files cfmtime needs updating here at all, the test is clearly wrong, as it only uses the stat result when it is invalid!
> The main consequence of this, other than wasted processing, as the result of doing full reloads on unchanged files, is that queue statistics get reset on a null reload.  However we are also investigating a possible race in the queue statistics update, which may or may not still be current.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list