Skip to content

Coverage fails with wrong number of lines #842

@Jonathan34

Description

@Jonathan34

Hi,

Following up on #840, i have changed my configuration to debug to see how optimization could affect the coverage.

I have deleted and recreated the project in SonarQube.
During the POST step in SonarQube, i have an exception:
`
2016-04-21T18:40:32.1475520Z 13:40:32.085 DEBUG - Saving '7' coverage measures for file 'C:\TFS\Builds\Agent404_01\1\s\Acidizing\View\AcidizingCoiledTubingView.cpp'
2016-04-21T18:40:32.1475520Z 13:40:32.085 ERROR - Saving cov measure 'coverage_line_hits_data' = 'null' failed
2016-04-21T18:40:32.1475520Z 13:40:32.085 ERROR - Obtained 'coverage_line_hits_data' = '8=0;9=0;10=0;11=0;14=0;15=0;16=0;31=0' failed
2016-04-21T18:40:32.1475520Z 13:40:32.085 ERROR - Ctype : 'UT_COVERAGE' Exception 'Can't create measure for line 31 for file 'C:/TFS/Builds/Agent404_01/1/s/aaa/View/MyClass.cpp' with 17 lines'
2016-04-21T18:40:32.1475520Z 13:40:32.100 INFO - Analysis report generated in C:\TFS\Builds\Agent404_01\1.sonarqube\out.sonar\batch-report

...

2016-04-21T18:40:33.0694300Z ##[error]ERROR: Error during Sonar runner execution
2016-04-21T18:40:33.0694300Z ##[error]org.sonar.runner.impl.RunnerException: Unable to execute Sonar
2016-04-21T18:40:33.0694300Z ##[error]at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
2016-04-21T18:40:33.0694300Z ##[error]at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
2016-04-21T18:40:33.0694300Z ##[error]at java.security.AccessController.doPrivileged(Native Method)
2016-04-21T18:40:33.0694300Z ##[error]at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
2016-04-21T18:40:33.0694300Z ##[error]at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
2016-04-21T18:40:33.0694300Z ##[error]at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
2016-04-21T18:40:33.0850573Z ##[error]at org.sonar.runner.api.Runner.execute(Runner.java:100)
2016-04-21T18:40:33.0850573Z ##[error]at org.sonar.runner.Main.executeTask(Main.java:70)
2016-04-21T18:40:33.0850573Z ##[error]at org.sonar.runner.Main.execute(Main.java:59)
2016-04-21T18:40:33.0850573Z ##[error]at org.sonar.runner.Main.main(Main.java:53)
2016-04-21T18:40:33.0850573Z ##[error]Caused by: java.lang.IllegalStateException: Can't create measure for line 31 for file 'C:/TFS/Builds/Agent404_01/1/s/aaa/View/MyClass.cpp' with 17 lines
2016-04-21T18:40:33.0850573Z ##[error]at org.sonar.batch.sensor.coverage.CoverageExclusions.validateMaxLine(CoverageExclusions.java:158)
2016-04-21T18:40:33.0850573Z ##[error]at org.sonar.batch.sensor.coverage.CoverageExclusions.validate(CoverageExclusions.java:129)
2016-04-21T18:40:33.1006797Z ##[error]at org.sonar.batch.deprecated.DeprecatedSensorContext.saveMeasure(DeprecatedSensorContext.java:204)
2016-04-21T18:40:33.1006797Z ##[error]at org.sonar.plugins.cxx.coverage.CxxCoverageSensor.saveMeasures(CxxCoverageSensor.java:173)
2016-04-21T18:40:33.1006797Z ##[error]at org.sonar.plugins.cxx.coverage.CxxCoverageSensor.analyse(CxxCoverageSensor.java:98)
2016-04-21T18:40:33.1006797Z ##[error]at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
2016-04-21T18:40:33.1006797Z ##[error]at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
2016-04-21T18:40:33.1006797Z ##[error]at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:102)
2016-04-21T18:40:33.1006797Z ##[error]at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:185)
2016-04-21T18:40:33.1163069Z ##[error]at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
2016-04-21T18:40:33.1163069Z ##[error]at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:120)
2016-04-21T18:40:33.1163069Z ##[error]at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:264)
2016-04-21T18:40:33.1163069Z ##[error]at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:259)
2016-04-21T18:40:33.1163069Z ##[error]at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:257)
2016-04-21T18:40:33.1163069Z ##[error]at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:249)
2016-04-21T18:40:33.1319340Z ##[error]at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
2016-04-21T18:40:33.1319340Z ##[error]at org.sonar.batch.scan.ProjectScanContainer.startComponents(ProjectScanContainer.java:127)
2016-04-21T18:40:33.1319340Z ##[error]at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:120)
2016-04-21T18:40:33.1319340Z ##[error]at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55)
2016-04-21T18:40:33.1475572Z ##[error]at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
2016-04-21T18:40:33.1475572Z ##[error]at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
2016-04-21T18:40:33.1475572Z ##[error]at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:120)
2016-04-21T18:40:33.1475572Z ##[error]at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122)
2016-04-21T18:40:33.1475572Z ##[error]at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
2016-04-21T18:40:33.1475572Z ##[error]at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:79)
2016-04-21T18:40:33.1631829Z ##[error]at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
2016-04-21T18:40:33.1631829Z ##[error]at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2016-04-21T18:40:33.1631829Z ##[error]at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2016-04-21T18:40:33.1631829Z ##[error]at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2016-04-21T18:40:33.1631829Z ##[error]at java.lang.reflect.Method.invoke(Unknown Source)
2016-04-21T18:40:33.1631829Z ##[error]at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
2016-04-21T18:40:33.1631829Z ##[error]... 9 more
2016-04-21T18:40:33.1631829Z ##[error]ERROR:
2016-04-21T18:40:33.1788054Z ##[error]ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
2016-04-21T18:40:33.2881901Z Process returned exit code 1
2016-04-21T18:40:33.2881901Z ##[error]The SonarQube Scanner did not complete successfully
2016-04-21T18:40:33.3038072Z 13:40:33.194 Creating a summary markdown file...
2016-04-21T18:40:33.3038072Z ##[error]Post-processing failed. Exit code: 1
2016-04-21T18:40:33.6171780Z ##[error]Unexpected exit code received from batch file: 1`

As I only changed the configuration from Release to Debug, i assume this is a bug...?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions