Opened 11 years ago

Closed 10 years ago

#6248 closed Patches (fixed)

multi_pass_iterator not flushed automatically by expectation operator

Reported by: Jeff Flinn <jflinn@…> Owned by: Hartmut Kaiser
Milestone: Boost 1.54.0 Component: spirit
Version: Boost 1.47.0 Severity: Problem
Keywords: multi_pass_iterator, flush_multi_pass Cc:

Description

Parsing a 2GB file, multi_pass_iterator throws std::bad_alloc when it tries to push_back the ~1.2GB'th item, even though expectation operator is used with a record based file whose max record length is ~200 chars. For example:

start %= header > *rec;

I also tried:

start %= header > flush_multi_pass *rec;

which resulted in no effect.

note: 1.47.0 required modifying flush_multi_pass.hpp to be the same as 1.48.0 impl to avoid compilation errors

Attachments (1)

iterator.hpp.patch (940 bytes ) - added by Antony Polukhin 10 years ago.

Download all attachments as: .zip

Change History (4)

by Antony Polukhin, 10 years ago

Attachment: iterator.hpp.patch added

comment:1 by Antony Polukhin, 10 years ago

Milestone: To Be DeterminedBoost 1.54.0
Type: BugsPatches

boost::spirit::lex::lexertl::iterator<Functor> class has no functions specializations in traits namespace, which makes it to choose the default methods that do nothing (instead of calling clear_queue).

Attached patch for boost/spirit/home/lex/lexer/lexertl/iterator.hpp that fixes it.

P.S.: boost::spirit::lex::lexertl::iterator<Functor> also has no swap specialisation, which may lead to use of ineffective std::swap.

Last edited 10 years ago by Antony Polukhin (previous) (diff)

comment:2 by Joel de Guzman, 10 years ago

Owner: changed from Joel de Guzman to Hartmut Kaiser

comment:3 by Hartmut Kaiser, 10 years ago

Resolution: fixed
Status: newclosed

(In [83461]) Fix #6248: multi_pass_iterator not flushed automatically by expectation operator

Note: See TracTickets for help on using tickets.