{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/3182","repository_url":"https://api.github.com/repos/dotnet/coreclr","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/3182/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/3182/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/3182/events","html_url":"https://github.com/dotnet/coreclr/issues/3182","id":133688671,"number":3182,"title":"libcoreclr.so incurs segmentation faults with glibc 2.21","user":{"login":"myungjoo","id":1109011,"avatar_url":"https://avatars.githubusercontent.com/u/1109011?v=3","gravatar_id":"","url":"https://api.github.com/users/myungjoo","html_url":"https://github.com/myungjoo","followers_url":"https://api.github.com/users/myungjoo/followers","following_url":"https://api.github.com/users/myungjoo/following{/other_user}","gists_url":"https://api.github.com/users/myungjoo/gists{/gist_id}","starred_url":"https://api.github.com/users/myungjoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myungjoo/subscriptions","organizations_url":"https://api.github.com/users/myungjoo/orgs","repos_url":"https://api.github.com/users/myungjoo/repos","events_url":"https://api.github.com/users/myungjoo/events{/privacy}","received_events_url":"https://api.github.com/users/myungjoo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/coreclr/labels/ARM","name":"ARM","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/dotnet/coreclr/milestones/5","html_url":"https://github.com/dotnet/coreclr/milestones/Future","labels_url":"https://api.github.com/repos/dotnet/coreclr/milestones/5/labels","id":1328081,"number":5,"title":"Future","description":"Milestone tracking the issues that have been triaged for after 1.0.0-rtm","creator":{"login":"joshfree","id":1302850,"avatar_url":"https://avatars.githubusercontent.com/u/1302850?v=3","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":378,"closed_issues":66,"state":"open","created_at":"2015-09-29T00:26:07Z","updated_at":"2016-03-23T06:23:01Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2016-02-15T11:19:03Z","updated_at":"2016-03-23T12:38:05Z","closed_at":null,"body":"Environment: Linux / ARMv7l (please disregard the date/time.)\r\nI'm based on cb1effac01239c3af46a1d3917fb60f70b18b757.\r\n\r\n```\r\nsh-4.3# ./corerun hello.exe\r\nSegmentation fault\r\nsh-4.3# uname -a\r\nLinux localhost 3.10.65 #1-Tizen SMP PREEMPT Fri Dec 18 09:50:37 UTC 2015 armv7l GNU/Linux\r\nsh-4.3# \r\nsh-4.3# gdb ./corerun -c /tmp/core_corerun.1691\r\nGNU gdb (GDB) 7.8.1\r\n...\r\nUsing host libthread_db library \"/lib/libthread_db.so.1\".\r\nCore was generated by `./corerun hello.exe'.\r\nProgram terminated with signal SIGSEGV, Segmentation fault.\r\n#0  0xb6f1d900 in __GI___tls_get_addr (ti=0xb6c5e7e2) at dl-tls.c:833\r\n833\t  void *p = dtv[GET_ADDR_MODULE].pointer.val;\r\n(gdb) bt\r\n#0  0xb6f1d900 in __GI___tls_get_addr (ti=0xb6c5e7e2) at dl-tls.c:833\r\n#1  0xb68ee2ce in ClassLoader::LoadTypeHandleForTypeKey_Body(TypeKey*, TypeHandle, ClassLoadLevel) () from /usr/bin/dotnet/libcoreclr.so\r\n#2  0xb68eb5fa in ClassLoader::LoadTypeHandleForTypeKey(TypeKey*, TypeHandle, ClassLoadLevel, InstantiationContext const*) ()\r\n   from /usr/bin/dotnet/libcoreclr.so\r\n#3  0xb68ec402 in ClassLoader::LoadTypeDefThrowing(Module*, unsigned int, ClassLoader::NotFoundAction, ClassLoader::PermitUninstantiatedFlag, unsigned int, ClassLoadLevel, Instantiation*) () from /usr/bin/dotnet/libcoreclr.so\r\n#4  0xb68ea37a in ClassLoader::LoadTypeHandleThrowing(NameHandle*, ClassLoadLevel, Module*) () from /usr/bin/dotnet/libcoreclr.so\r\n#5  0xb68ea14a in ClassLoader::LoadTypeByNameThrowing(Assembly*, char const*, char const*, ClassLoader::NotFoundAction, ClassLoader::LoadTypesFlag, ClassLoadLevel) () from /usr/bin/dotnet/libcoreclr.so\r\n#6  0xb68d6df8 in MscorlibBinder::LookupClass(BinderClassID) ()\r\n   from /usr/bin/dotnet/libcoreclr.so\r\n#7  0xb68be3de in SystemDomain::LoadBaseSystemClasses() ()\r\n   from /usr/bin/dotnet/libcoreclr.so\r\n#8  0xb68be1c0 in SystemDomain::Init() () from /usr/bin/dotnet/libcoreclr.so\r\n#9  0xb683b968 in EEStartupHelper(tagCOINITEE) ()\r\n   from /usr/bin/dotnet/libcoreclr.so\r\n#10 0xb683add0 in EEStartup(tagCOINITEE) () from /usr/bin/dotnet/libcoreclr.so\r\n#11 0xb683acb6 in EnsureEEStarted(tagCOINITEE) ()\r\n   from /usr/bin/dotnet/libcoreclr.so\r\n#12 0xb67b8be0 in CorHost2::Start() () from /usr/bin/dotnet/libcoreclr.so\r\n#13 0xb67a6e62 in coreclr_initialize () from /usr/bin/dotnet/libcoreclr.so\r\n#14 0x00012634 in ExecuteManagedAssembly(char const*, char const*, char const*, int, char const**) ()\r\n#15 0x000119f2 in corerun(int, char const**) ()\r\n#16 0xb6c88776 in __libc_start_main (main=0x11c9d <main>, argc=2, \r\n    argv=0xbee9dbd4, init=<optimized out>, fini=0x12cd9 <__libc_csu_fini>, \r\n    rtld_fini=0xb6f1b755 <_dl_fini>, stack_end=0xbee9dbd4) at libc-start.c:289\r\n#17 0x0001172c in _start () at ../sysdeps/arm/start.S:124\r\n(gdb) print ti->ti_module\r\n$1 = 3249125062\r\n(gdb) print ti\r\n$2 = (tls_index *) 0xb6c5e7e2\r\n(gdb) print *ti\r\n$3 = {ti_module = 3249125062, ti_offset = 2025174660}\r\n(gdb) \r\n```\r\n\r\nti->ti_module is supposed to be a value near 0 (around 0 ... 16 or so).\r\nIt appears that ClassLoader::LoadTypeHandleForTypeKey_Body() is somehow screwing with the TLS in ARM/Linux..\r\n\r\nAny thoughts on this issue?\r\n\r\nThe disassembled libcoreclr.so nearby (in LoadTypeHandleForTypeKey_Body(). I and gdb couldn't find where it is in clsload.cpp although I have coreclr-debugsource and coreclr-debuginfo rpm packages installed):\r\n```\r\n   |+720>  str     r3, [sp, #96]   ; 0x60                                      |\r\n   |+722>  str     r1, [sp, #100]  ; 0x64                                      |\r\n   |+724>  mov     r4, r0                                                      |\r\n   |+726>  bl      0xb6b3af40 <NativeExceptionHolderBase::NativeExceptionHolder|\r\n   |+730>  ldr     r0, [sp, #24]                                               |\r\n   |+732>  str     r0, [sp, #72]   ; 0x48  \r\n   |+734>  mov     r0, r4                                                      |\r\n   |+736>  bl      0xb6b3af84 <NativeExceptionHolderBase::Push()>              |\r\n   |+740>  ldr.w   r0, [pc, #972]  ; 0xb68ee694 <_ZN11ClassLoader29LoadTypeHand|\r\n   |+744>  add     r0, pc                                                      |\r\n   |+746>  blx     0xb67a53ac <__tls_get_addr@plt>                             |\r\n   |+750>  ldr     r0, [r0, #0]   \r\n```\r\nThe call was made with +746 and the return address is +750.\r\nNote that r0 == ti (0xb6c5e7e2)\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/200329929","html_url":"https://github.com/dotnet/coreclr/issues/3182#issuecomment-200329929","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/3182","id":200329929,"user":{"login":"janvorli","id":10758568,"avatar_url":"https://avatars.githubusercontent.com/u/10758568?v=3","gravatar_id":"","url":"https://api.github.com/users/janvorli","html_url":"https://github.com/janvorli","followers_url":"https://api.github.com/users/janvorli/followers","following_url":"https://api.github.com/users/janvorli/following{/other_user}","gists_url":"https://api.github.com/users/janvorli/gists{/gist_id}","starred_url":"https://api.github.com/users/janvorli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janvorli/subscriptions","organizations_url":"https://api.github.com/users/janvorli/orgs","repos_url":"https://api.github.com/users/janvorli/repos","events_url":"https://api.github.com/users/janvorli/events{/privacy}","received_events_url":"https://api.github.com/users/janvorli/received_events","type":"User","site_admin":false},"created_at":"2016-03-23T12:38:05Z","updated_at":"2016-03-23T12:38:05Z","body":"The pipes are used in release build too, since you want to be able to debug managed code in those as well.\r\nAnd yes, the _DEBUG indicates debug build, without that symbol defined, it is a release build."}}