Skip to content

Commit

Permalink
Enable buffering for parsing agent output (bnc#854809).
Browse files Browse the repository at this point in the history
Apparently reading 1 character at a time forces the flex scanner to
spend quadratic time on each token, in yy_get_previous_state.
For one sudoers file we had large tokens, one of them 380KB, taking 14
minutes to parse.

In hindsight, buffering should be enabled by default, turning it off for
specific cases of interactive use.
  • Loading branch information
mvidner committed Sep 8, 2014
1 parent 7d656b8 commit b76f4c4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions liby2/src/Y2ProgramComponent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ void Y2ProgramComponent::launchExternalProgram (char **argv)

// Prepare parser
parser.setInput(from_external[0], argv[0]); // set parser input to child output
parser.setBuffered();
}


Expand Down

0 comments on commit b76f4c4

Please sign in to comment.