Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional failing tests for broken Boost.Test UTF command-line argument parsing. #19

Conversation

jurko-gospodnetic
Copy link
Contributor

This pull request is related to pull request #18, providing additional failing tests for broken Boost.Test UTF command-line argument parsing.

The tests illustrate different problems with how UTF command-line argument processing handles spaces embedded in those arguments.

Hope this helps.

Best regards,
Jurko Gospodnetić

Currently implemented tests are still far from a complete test suite but they do
represent a good starting point for adding related tests in the future.
The bug is triggered by passing a command-line argument containing a leading
space character or by passing an empty leading command-line argument with an
additional argument after it.

Several of the newly added tests currently only check whether the test crashes
and not the command-line arguments left over after UTF processing. This is so
because the current UTF implementation does not seem to handle arguments with
embedded spaces correctly and that seems like a separate issue.
For every space character embedded in passed command-line arguments, except one
at the beginning of the first argument and one at the end of the last argument,
UTF attempts to write data into the original argv array one element passed the
original array's end. That means that two such spaces cause it to write passed
the extra trailing 0 element guaranteed by the ANSI C standard and thus risk
undefined behaviour.
These tests fail since UTF seems to split all the received command-line
arguments on any embedded spaces. This causes the arguments to be presented
incorrectly to user code as well as argv buffer overruns which may cause
undefined behaviour in testing applications.

These changes remove the need for marking certain tests in this test module with
the '<UNDESIREABLE RESULT boostorg#1>' tag.

Conflicts:
	test/test_cla_parsing.cpp
Current UTF implementation seems to eat up trailing empty string arguments
instead of passing them on to the user code test module initialization function.
@rogeeff
Copy link
Contributor

rogeeff commented Sep 7, 2015

please review local/new_cla branch and see if it address all your concerns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants