profiling: ..../ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x00000000)

With XCode7, after selecting "Text" from the project menu, I am getting a bunch of these messages:


profiling: /ProjectRoot/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x00000010)

profiling: /ProjectRoot/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x00000002)

profiling: /ProjectRoot/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x2b90598d)

profiling: /ProjectRoot/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x0000005f)

......... many, many, more.....


Delettig the *.gcda files form the project directory has no effect (they re-appear after the tests are completed).

Turning code coverage off has no effect

Replies

I have this same issue. Any workarounds?

Has Anyone found a solution for this? I can't manage to run my tests on Xcode7

I am able to run Unit tests on Xcode7 successfully but I see similar error being logged...

I had to turn off Instrument Program Flow to get our unit tests working again. This effective breaks our test coverage reports. Seems like an Xcode 7 bug that they hopefully fix in the next update.

http://stackoverflow.com/questions/22519530/dozens-of-profilinginvalid-arc-tag-when-running-code-coverage-in-xcode-5

Xcode 7 GM is out, and this behavior hasn't changed, so I took a deeper look. The issue, I believe is that code coverage of the test app target is conflicting with code coverage of the main target.


Assuming you don't actually care about code coverage of your test target these settings stop the errors for me, with no need for extra scripts or deleting files:


In your main target (be it a framework, or an app) set:

Enable Code Coverage Support to YES

Generage Legacy Test Coverage Files to YES

Instrument Program Flow to YES

For my purposes I only did this for Debug builds, but your needs may vary.


Then in your Tests target set:

Enable Code Coverage Support to NO

Generage Legacy Test Coverage Files to NO

Instrument Program Flow to NO


This has resolved the error messages, and still allowed the code coverage files to be created appropriately.

This didn't actually help me, still experiencing this issue.


I have a 'framework' target... disabled coverage for all my test targets and if I don't disable coverage for the framework target, I still get a lot of console spam in the form of


profiling: /Users/user/Folder/my_xcode_project/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x00005d73)
profiling: /Users/user/Folder/my_xcode_project/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x0000005d)
profiling: /Users/user/Folder/my_xcode_project/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x20644144)
profiling: /Users/user/Folder/my_xcode_project/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x41657461)
profiling: /Users/user/Folder/my_xcode_project/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x73746573)
profiling: /Users/user/Folder/my_xcode_project/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x0000005d)
profiling: /Users/user/Folder/my_xcode_project/ObjectiveC.gcda: cannot merge previous run count: corrupt object tag (0x00000000)
profiling: /Users/user/Folder/my_xcode_project/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x34345f5f)
profiling: /Users/user/Folder/my_xcode_project/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x65707061)
profiling: /Users/user/Folder/my_xcode_project/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x4941524d)
profiling: /Users/user/Folder/my_xcode_project/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x6f737365)
profiling: /Users/user/Folder/my_xcode_project/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x20644144)
profiling: /Users/user/Folder/my_xcode_project/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x0000000c)
profiling: /Users/user/Folder/my_xcode_project/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x00005d73)
profiling: /Users/user/Folder/my_xcode_project/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x0000005d)

Got the same "ObjectiveC.gcno: cannot merge" issue, and was unable to fix it either.


I tried AndyJohns's solution, which allowed me to stop having the "cannot merge previous GCDA file" errors… but then I don't have any "*.gcda" files generated anymore (but only "*.gcno" files). And thus when I run "slather" or "gcovr" then, the coverage is zero for all my source code (whereas it was non-zero under Xcode 6), so that doesn't really solve the problem.


Any idea?


PS: Tested with Xcode 7 final too, with same results


---


EDIT : In fact my projects have always been configured to have TEST_HOST="" so I don't launch the app target when running my Unit Tests (and instead include the ".m" files I want to test in my Unit Test target).

So this means that I have to activate the coverage build settings on my Unit Test target, not my App target (probably why I didn't have any gcda files when only set to YES on my app target?).


But then even if I set those 3 build settings to NO for the App Target (and YES for the Unit Test target), I get those "ObjectiveC.gcno: cannot merge" back again.


If I migrate to TEST_HOST = the app and apply AndyJohns solution, it seems to work locally, but I can't really do hosted tests in practice because it doesn't work on a headless Jenkins-CI server.

I'm also seeing multiple messages like this


profiling: /Users/developex/repos/CodeComfort/rep/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x6375646f)


when I choose 'Quit' in my app (but not if the App is stopped from within Xcode).


I'm not running any Tests and 'Generate Profiling Code' is set to off in both the project and target, for both debug and release.


Anybody got any ideas on what to do?

I have spent some time trying to figure out how to get rid of those ugly and annoying messages:


profiling: /Users/appfactory/Desktop/WORK/App/trunk/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (0x00000000)


It seemed like an Xcode 7 issue that was not fixed in the current Xcode 7.1 beta 2.


The problem is caused by failing to merge the existing .gcda coverage files with the current results.


What I tried:

Remove those .gcda files with RunScript - does not work in my case

echo "Delete .gcda files"echo "${OBJECT_FILE_DIR_normal}/${CURRENT_ARCH}"

Attention: the ObjectiveC.gcda file may be at a different location!

Set the following build settings to YES - also not helping

Enable Code Coverage Support to YES Generate Legacy Test Coverage Files to YES Instrument Program Flow to YES

The solution in my case:

Set the following build settings for the main target

Enable Code Coverage Support to YES

Generate Legacy Test Coverage Files to YES

Instrument Program Flow to NO


Set the following build settings for the test target (and any other targets)

Enable Code Coverage Support to NO

Generate Legacy Test Coverage Files to NO

Instrument Program Flow to NO



Hope it helps!

Hi apphipster,

I have Xcode workspace with main app and several static libs.

I did as you say in "3.The solution in my case" but I got next errors for my static library which I use in project:

Undefined symbols for architecture i386: "_llvm_gcda_emit_arcs", "_llvm_gcda_emit_function", "_llvm_gcda_end_file", "_llvm_gcda_start_file", "_llvm_gcda_summary_info"

Do you have any ideas how to fix it?

Thank you