-
Notifications
You must be signed in to change notification settings - Fork 74
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
parse_gcov_file: handle empty/no lnum #140
Conversation
Without this patch it would fail on the line `b'xembed_window_array_take:\n'`, trying to cast an empty string into an int. -: 46: #####: 47:DO_ARRAY(xembed_window_t, xembed_window, DO_NOTHING) ------------------ xembed_window_array_take: #####: 47:DO_ARRAY(xembed_window_t, xembed_window, DO_NOTHING) ------------------ xembed_window_array_splice: #####: 47:DO_ARRAY(xembed_window_t, xembed_window, DO_NOTHING) ------------------ xembed_window_array_grow: #####: 47:DO_ARRAY(xembed_window_t, xembed_window, DO_NOTHING) ------------------ -: 48: Using gcov (GCC) 8.2.1 20181127.
For/via eddyxu/cpp-coveralls#140; it fails locally, but not on Travis.
For/via eddyxu/cpp-coveralls#140; it fails locally, but not on Travis.
Does not appear to be a problem with "gcov (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609" (used on Travis with Ubuntu Xenial). |
According to #116 it can also happen with the older gcov version, so might be triggered by something else then. I am using |
For/via eddyxu/cpp-coveralls#140; it fails locally, but not on Travis.
@blueyed I'm not sure if I'm missing something - but I think we still have an issue in parsing this new gcov output? Originally I saw the issue as nonsense coverage data on a personal repo - but I can reproduce the issue by running the regressions tests I created (#147) using gcov version >= 8. Whilst the parser doesn't crash it gets confused and ends up with more "coverage" lines than actual lines in the file. As a result, all of the coverage is assigned to the wrong lines.
I believe the issue is that although this fix ensures the parser extracts the correct line number - we don't actually use it. Instead the coverage number is simply appended to a list (line ~280)? The result is that when coveralls proceses the file the gcov files produced by the test:
we end up with nonsense data:
|
Without this patch it would fail on the line
b'xembed_window_array_take:\n'
,trying to cast an empty string into an int.
Using gcov (GCC) 8.2.1 20181127.