Subject: Re: [Boost-bugs] [Boost C++ Libraries] #1587: [program_options] crashes if value part missing in external configuration file
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-05-16 19:09:25
#1587: [program_options] crashes if value part missing in external configuration
file
-------------------------------+--------------------------------------------
Reporter: darren_at_[hidden] | Owner: vladimir_prus
Type: Bugs | Status: new
Milestone: To Be Determined | Component: program_options
Version: Boost 1.34.1 | Severity: Showstopper
Resolution: | Keywords:
-------------------------------+--------------------------------------------
Old description:
> NOTE: boost::program_options has a serious bug, so it"ll crash if the
> value part of a setting is missing.
> E.g. the below snippet at the end of my settings.ini file crashes if I
> uncomment the last line.
> -------------
> log_fname_info = info.log
> log_fname_problems = problems.log
> log_fname_status = status.log
> #log_fname_verbose =
> -------------
>
> I want to use a blank setting to mean "no verbose log file" in the above
> code. I"ve flagged it "showstopper" for this reason.
>
> It crashes on windows XP, in both debug and release versions, and normal
> and static link builds. Not tested on linux yet.
>
> Specifically, it seems to be happening in po.store(), and (on windows at
> least) it is caught as an "other exception" in the below code. e.what()
> just outputs "!". The exception is arising in kernel32.dll apparently.
> {{{
> try{
> po::store(po::parse_config_file(config_file,config_options),
> config_map);
> }catch(boost::program_options::invalid_option_value e){
> std::cerr<<"invalid_option_value exception thrown parsing config
> file:"<<e.what()<<"\n";
> return -2;
> }catch(std::exception e){
> std::cerr<<"Other exception thrown parsing config
> file:"<<e.what()<<"\n!";
> return -2;
> }
> }}}
New description:
NOTE: boost::program_options has a serious bug, so it'll crash if the
value part of a setting is missing.
E.g. the below snippet at the end of my settings.ini file crashes if I
uncomment the last line.
-------------
log_fname_info = info.log
log_fname_problems = problems.log
log_fname_status = status.log
#log_fname_verbose =
-------------
I want to use a blank setting to mean "no verbose log file" in the above
code. I've flagged it showstopper for this reason.
It crashes on windows XP, in both debug and release versions, and normal
and static link builds. Not tested on linux yet.
Specifically, it seems to be happening in po.store(), and (on windows at
least) it is caught as an 'other exception' in the below code. e.what()
just outputs '!'. The exception is arising in kernel32.dll apparently.
{{{
try{
po::store(po::parse_config_file(config_file,config_options),
config_map);
}catch(boost::program_options::invalid_option_value e){
std::cerr<<"invalid_option_value exception thrown parsing config
file:"<<e.what()<<"\n";
return -2;
}catch(std::exception e){
std::cerr<<"Other exception thrown parsing config
file:"<<e.what()<<"\n!";
return -2;
}
}}}
--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1587#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:57 UTC