Opened 15 years ago
Closed 14 years ago
#1588 closed Bugs (duplicate)
[program_options] crashes if value part missing in external configuration file
Reported by: | Owned by: | Vladimir Prus | |
---|---|---|---|
Milestone: | To Be Determined | Component: | program_options |
Version: | Boost 1.34.1 | Severity: | Showstopper |
Keywords: | Cc: |
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 a std::exception (not a boost::program_options::invalid_option_value). e.what() just outputs "!". The exception is arising in kernel32.dll apparently.
Sorry, here is that config file snippet with wiki formatting:
log_fname_info = info.log
log_fname_problems = problems.log
log_fname_status = status.log
#log_fname_verbose =