Opened 7 years ago

Closed 7 years ago

#11475 closed Bugs (fixed)

qi real parser- valgrind error

Reported by: oswin.krause@… Owned by: Joel de Guzman
Milestone: To Be Determined Component: spirit
Version: Boost 1.59.0 Severity: Problem
Keywords: valgrind Cc:

Description

I tested boost 1.59 rc1 today and got a regression in my software. my csv parser reported 4 wrong values (of approximately 200)

i reduced the problem somewhat to

#include <boost/spirit/include/qi.hpp>
#include <vector>
#include <string>
#include <iostream>
using namespace boost::spirit::qi;
int main(){
	std::cout<<BOOST_LIB_VERSION<<std::endl;
	std::string str="1.0,119,80,35,0,29.0,0.263,29,1";
	std::vector<double> fileContents;
	phrase_parse(
		str.begin(),str.end(),
			double_ % ',',
		space , fileContents
	);

	for(std::size_t j = 0; j != 9; ++j)
		std::cout<<fileContents[j]<<" "<<std::flush;

}

problems vanish in debug mode, g++ finds a warning and valgrind finds a conditioned jump based on unitialised memory. see attached the outputs for comparison

Change History (2)

comment:1 by oswin.krause@…, 7 years ago

Sorry for the duplicate ticket. I have got troubles uploading the files, Track rejects it as spam as it is including blacklisted patterns...help?

comment:2 by Joel de Guzman, 7 years ago

Resolution: fixed
Status: newclosed

This is fixed now: https://github.com/boostorg/spirit/pull/141. I'll close this ticket. Please reopen if you see the problem still.

Note: See TracTickets for help on using tickets.