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

Cppstats doesn't run properly in travis environment #11

Closed
matthid opened this issue Feb 6, 2015 · 2 comments
Closed

Cppstats doesn't run properly in travis environment #11

matthid opened this issue Feb 6, 2015 · 2 comments

Comments

@matthid
Copy link

matthid commented Feb 6, 2015

When running in travis I get:
$ /usr/bin/env cppstats --kind featurelocations --file /tmp/tmp4GFmR1.c /tmp/tmpgqa8Ef.csv

# starting 'featurelocations' preparations: tmp4GFmR1.c

# finished 'featurelocations' preparations: tmp4GFmR1.c

# starting 'featurelocations' analysis: tmppBq45v.xml

ERROR: cannot parse (/tmp/tmp72c_rI_cppstats_featurelocations/_cppstats_featurelocations/tmppBq45v.xml). Skipping this file.

# finished 'featurelocations' analysis: tmppBq45v.xml

The test-file I used was:

#if Test
// example
#else
// more
#endif

Any idea why that is happening? The already existing error handling code (https://github.com/clhunsen/cppstats/blob/master/analyses/featurelocations.py#L687) seems to be handling that situation wrong as I would expected a crash instead of creating an invalid .csv file. However I need the root cause so cppstats runs properly on travis.

You can see the error in https://travis-ci.org/matthid/codeface/builds/49739940#L4149
This makes the following unit test in codeface fail: https://github.com/matthid/codeface/blob/integration/codeface/test/unit/test_cppstats_works.py#L62

Any help/hint is appreciated.

@clhunsen
Copy link
Collaborator

clhunsen commented Feb 9, 2015

Thanks again for reporting. After some debugging, my best assumption for this error is a wrong src2srcml version. According to the TravisCI page, the system is a Ubuntu 12.04 64-bit, but the shipped version of srcML is for Ubuntu 14.04 64-bit.

Try downgrading the scrML binaries (in lib/srcml/linux) with appropriate versions from here. If the test fails again, we need to have a closer look by introducing more debugging code or, even better, by inspecting the temporary files that are written by cppstats in the file-based analysis.

Regarding the expected crash, I must say that the defensive handling comes from the multi-file analysis, but you are also right. This must be handled better. I opened issue #12 for that, any news about the issue will go there.

@matthid
Copy link
Author

matthid commented Feb 9, 2015

Yes this was in fact the issue, thanks for this hint.

@matthid matthid closed this as completed Feb 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants