{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/5918","repository_url":"https://api.github.com/repos/dotnet/coreclr","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/5918/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/5918/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/5918/events","html_url":"https://github.com/dotnet/coreclr/issues/5918","id":161682341,"number":5918,"title":"[ARM/Linux] Assert Failure (\"Unrecognized ETW root kind\") when using CoreCLRProfiler","user":{"login":"sam-baravy","id":19685728,"avatar_url":"https://avatars.githubusercontent.com/u/19685728?v=3","gravatar_id":"","url":"https://api.github.com/users/sam-baravy","html_url":"https://github.com/sam-baravy","followers_url":"https://api.github.com/users/sam-baravy/followers","following_url":"https://api.github.com/users/sam-baravy/following{/other_user}","gists_url":"https://api.github.com/users/sam-baravy/gists{/gist_id}","starred_url":"https://api.github.com/users/sam-baravy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sam-baravy/subscriptions","organizations_url":"https://api.github.com/users/sam-baravy/orgs","repos_url":"https://api.github.com/users/sam-baravy/repos","events_url":"https://api.github.com/users/sam-baravy/events{/privacy}","received_events_url":"https://api.github.com/users/sam-baravy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-22T13:26:39Z","updated_at":"2016-06-22T13:33:08Z","closed_at":null,"body":"Corerun crashes when I try to use CoreCLRProfiler (https://github.com/david-mitchell/CoreCLRProfiler.git) on arm-softfp:\r\n\r\n> GarbageCollectionStarted\r\n> ObjectsAllocatedByClass\r\n> \r\n> Assert failure(PID 27673 [0x00006c19], Thread: 27673 [0x6c19]): !\"Unrecognized ETW root kind\"\r\n>     File: /home/i.baravy/work/repo/coreclr/src/vm/eetoprofinterfaceimpl.cpp Line: 1641\r\n>     Image: /opt/home/i.baravy/work/repo/coreclr/bin/Product/Linux.arm-softfp.Debug/corerun\r\n> \r\n> **** MessageBox invoked, title 'corerun - Assert Failure (PID 27673, Thread 27673/0x6c19)' ****\r\n>   !\"Unrecognized ETW root kind\"\r\n> \r\n> /home/i.baravy/work/repo/coreclr/src/vm/eetoprofinterfaceimpl.cpp, Line: 1641\r\n> \r\n> Abort - Kill program\r\n> Retry - Debug\r\n> Ignore - Keep running\r\n> \r\n> \r\n> Image:\r\n> /opt/home/i.baravy/work/repo/coreclr/bin/Product/Linux.arm-softfp.Debug/corerun\r\n> \r\n> ********\r\n> \r\n> Aborted (core dumped)\r\n\r\n\r\n\r\nSteps to reproduce:\r\n\r\n1. Clone CoreCLR to Ubuntu 14.04.4 LTS\r\n\r\n2. Install dependencies:\r\n`$ sudo apt-get install cmake llvm-3.6 clang-3.6 lldb-3.6 lldb-3.6-dev libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev libcurl4-openssl-dev libssl-dev uuid-dev`\r\n`$ sudo apt-get install qemu qemu-user-static binfmt-support debootstrap`\r\n`$ sudo apt-get install binutils-aarch64-linux-gnu`\r\n\r\n3. Prepare rootfs:\r\n`$ sudo ./cross/build-rootfs.sh arm-softfp`\r\n\r\n4. Cross-build CoreCLR:\r\n`$ ./build.sh arm-softfp clean cross skiptests`\r\n\r\n5. Clone CoreCLRProfiler demo profiler:\r\n`$ git clone https://github.com/david-mitchell/CoreCLRProfiler.git`\r\n`$ cd CoreCLRProfiler`\r\n  \r\n6. Add profiling of GC:\r\n`$ git diff`\r\n`diff --git a/profiler.cpp b/profiler.cpp`\r\n`index 081d613..8970e6f 100644`\r\n`--- a/profiler.cpp`\r\n`+++ b/profiler.cpp`\r\n`@@ -51,7 +51,7 @@ HRESULT STDMETHODCALLTYPE Profiler::Initialize(IUnknown *pICorProfilerInfoUnk)`\r\n`HRESULT hr = pICorProfilerInfoUnk->QueryInterface(IID_ICorProfilerInfo3, (void **) &info);`\r\n`if (hr == S_OK && info != NULL)`\r\n`{`\r\n`- info->SetEventMask(COR_PRF_MONITOR_JIT_COMPILATION | COR_PRF_MONITOR_ASSEMBLY_LOADS | COR_PRF_MONITOR_CLASS_LOADS);`\r\n`+ info->SetEventMask(COR_PRF_MONITOR_JIT_COMPILATION | COR_PRF_MONITOR_ASSEMBLY_LOADS | COR_PRF_MONITOR_CLASS_LOADS | COR_PRF_MONITOR_GC);`\r\n` `\r\n`info->Release();`\r\n`info = NULL;`\r\n \r\n7. Create cross-build script: [make-arm.sh](https://github.com/dotnet/coreclr/files/327964/make-arm.sh.txt)\r\n \r\n8. Build:\r\n`$ CORECLR_ARCH=arm-softfp ./make-arm.sh`\r\n \r\n9. Copy _profiler.so_ to the target coreclr directory.\r\n\r\n10. Build the attached test program [sqrt.cs](https://github.com/dotnet/coreclr/files/327815/sqrt.cs.txt) and copy it to the target.\r\n\r\n11. Run on target:\r\n`$ CORECLR_PROFILER={912E73AF-F51D-4E80-894D-F4E9E6DD7C2E} CORECLR_ENABLE_PROFILING=1 CORECLR_PROFILER_PATH=./profiler.so  ./corerun sqrt.exe`\r\n \r\n12. Result:\r\n`Assert failure(PID 27673 [0x00006c19], Thread: 27673 [0x6c19]): !\"Unrecognized ETW root kind\"`\r\n`    File: /home/i.baravy/work/repo/coreclr/src/vm/eetoprofinterfaceimpl.cpp Line: 1641`\r\n\r\n.  \r\n\r\n.  \r\n\r\nThe issue is caused by following code:\r\n```\r\nsrc/vm/eetoprofinterfaceimpl.cpp: 1636\r\n    switch(dwEtwRootKind)\r\n    {    \r\n    default:\r\n        // If a new ETW root kind is added, create a profapi root kind as well, and add\r\n        // the appropriate case below\r\n        _ASSERTE(!\"Unrecognized ETW root kind\");\r\n```\r\n\r\n```\r\nsrc/gc/gc.h: 230\r\n#ifdef FEATURE_EVENT_TRACE\r\n        dwEtwRootKind = kEtwGCRootKindOther;\r\n#endif // FEATURE_EVENT_TRACE\r\n```\r\n```\r\nsrc/pal/CMakeLists.txt: 5\r\nif(CLR_CMAKE_PLATFORM_LINUX AND CLR_CMAKE_PLATFORM_ARCH_AMD64)\r\n  set(FEATURE_EVENT_TRACE 1)\r\nendif()\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/227744486","html_url":"https://github.com/dotnet/coreclr/issues/5918#issuecomment-227744486","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/5918","id":227744486,"user":{"login":"sam-baravy","id":19685728,"avatar_url":"https://avatars.githubusercontent.com/u/19685728?v=3","gravatar_id":"","url":"https://api.github.com/users/sam-baravy","html_url":"https://github.com/sam-baravy","followers_url":"https://api.github.com/users/sam-baravy/followers","following_url":"https://api.github.com/users/sam-baravy/following{/other_user}","gists_url":"https://api.github.com/users/sam-baravy/gists{/gist_id}","starred_url":"https://api.github.com/users/sam-baravy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sam-baravy/subscriptions","organizations_url":"https://api.github.com/users/sam-baravy/orgs","repos_url":"https://api.github.com/users/sam-baravy/repos","events_url":"https://api.github.com/users/sam-baravy/events{/privacy}","received_events_url":"https://api.github.com/users/sam-baravy/received_events","type":"User","site_admin":false},"created_at":"2016-06-22T13:33:07Z","updated_at":"2016-06-22T13:33:07Z","body":"@Dmitri-Botcharnikov "}}
{"actor":{"display_login":"sam-baravy"}}