Opened 3 years ago

Last modified 3 years ago

#11420 new Bugs

program_options crash on run() on specific machine only in release mode

Reported by: Stephan Bertl <stephan@…> Owned by: Vladimir Prus
Milestone: To Be Determined Component: program_options
Version: Boost 1.58.0 Severity: Problem
Keywords: Cc:


It's a very strange error that occured. I have deployed the program on a machine where no Visual Studio is available.

Upon start it crashes instantly so I have created a dump with the task manager and analysed it in Visual Studio 2013.

>	test.exe!boost::program_options::basic_command_line_parser<char>::run() Line 107	C++

which resolves to

template<class charT>    
        // save the canonical prefixes which were used by this cmdline parser
        //    eventually inside the parsed results
        //    This will be handy to format recognisable options
        //    for diagnostic messages if everything blows up much later on
        parsed_options result(m_desc, detail::cmdline::get_canonical_option_prefix());
        result.options = detail::cmdline::run();

        // Presense of parsed_options -> wparsed_options conversion
        // does the trick.
        return basic_parsed_options<charT>(result);

in my program the crash occurs in the following line

po::store(po::command_line_parser(argc, argv).options(description).allow_unregistered().run(), vm);

The very strange thing is that argc is 0 and argv is 0x0000000000000000

It only happens in release mode and i cannot catch any exception

Attachments (0)

Change History (2)

comment:1 Changed 3 years ago by Vladimir Prus

Could it be that you're linking to debug version of the library? Windows is picky about much mismatches. Or your build is not 100% clean. Other than that, it's hard to guess that could be wrong.

comment:2 Changed 3 years ago by Stephan Bertl <stephan@…>

i have even removed the -gd libs from the stage folder, so there should be no mismatch...

Modify Ticket

Change Properties
Set your email in Preferences
as new The owner will remain Vladimir Prus.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.