[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Freeipmi-devel] Re: ipmi-sensors abends when configuration file not spe
From: |
Albert Chu |
Subject: |
[Freeipmi-devel] Re: ipmi-sensors abends when configuration file not specified at all |
Date: |
Mon, 16 Aug 2010 13:40:06 -0700 |
Hi Dan,
On Mon, 2010-08-16 at 11:51 -0700, Dan Lukes wrote:
> On 08/16/10 19:55, Albert Chu:
> > This should already be handled.
>
> Where you think it is handled ?
In config_file_parse() there is eventually this line:
if (!filename)
filename = FREEIPMI_CONFIG_FILE_DEFAULT;
and then filename is passed to the library conffile_parse() function.
Al
> I found
>
> cmd_args->config_file = NULL;
> within _init_common_cmd_args (cmd_args)
>
> only.
>
> I found no other place called from ipmi-sensor that initialize
> config_file (not counting the command-line parser which doesn't apply
> when no --config-file option on command line)
>
> > What version of FreeIPMI are you running?
>
> 0.8.8
>
> > Perhaps your freeipmi.conf has some typo in it that triggers a
> > different bug?
>
> I have no freeipmi.conf at all. I'm fully satisfied with the defaults.
>
> If you will give me a hint where teh common.config_file is initialized
> to something else than NULL I will step the code in debugger and with
> some luck I will identify the place where the config_fiel is set back to
> NULL. Or, maybe, I will discover that code doesn't execute the line with
> initialization. But I can't found the line responsible for default
> initialization of config_file within ipmi-sensors's sources.
>
> Dan
>
>
> >> I hit the bug in the
> >>
> >> ipmi-sensors/src/ipmi-sensors-argp.c
> >>
> >> In the case the configuration file is not specified at all, the
> >>
> >> cmd_args->common.config_file == NULL
> >>
> >> Such situation is not handled correctly, the NULL is dereferenced and
> >> program abends.
> >>
> >> I suggest not to call config_file_parse() at all, when configration
> >> doesn't exist, e.g.:
> >>
> >> if (config_file_parse (cmd_args->common.config_file,
> >>
> >> should be changed to
> >>
> >> if (cmd_args->common.config_file != NULL&& config_file_parse
> >> (cmd_args->common.config_file,
> >>
> >> I tried it on my system and it helped.
> >>
> >> As alternative, such case can be handled inside of config_file_parse()
> >> function.
>
--
Albert Chu
address@hidden
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory