{"action":"created","issue":{"url":"https://api.github.com/repos/gperftools/gperftools/issues/947","repository_url":"https://api.github.com/repos/gperftools/gperftools","labels_url":"https://api.github.com/repos/gperftools/gperftools/issues/947/labels{/name}","comments_url":"https://api.github.com/repos/gperftools/gperftools/issues/947/comments","events_url":"https://api.github.com/repos/gperftools/gperftools/issues/947/events","html_url":"https://github.com/gperftools/gperftools/issues/947","id":283652616,"number":947,"title":"Frequent libunwind crashes","user":{"login":"krisschumi","id":759490,"avatar_url":"https://avatars1.githubusercontent.com/u/759490?v=4","gravatar_id":"","url":"https://api.github.com/users/krisschumi","html_url":"https://github.com/krisschumi","followers_url":"https://api.github.com/users/krisschumi/followers","following_url":"https://api.github.com/users/krisschumi/following{/other_user}","gists_url":"https://api.github.com/users/krisschumi/gists{/gist_id}","starred_url":"https://api.github.com/users/krisschumi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krisschumi/subscriptions","organizations_url":"https://api.github.com/users/krisschumi/orgs","repos_url":"https://api.github.com/users/krisschumi/repos","events_url":"https://api.github.com/users/krisschumi/events{/privacy}","received_events_url":"https://api.github.com/users/krisschumi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-20T18:18:35Z","updated_at":"2018-02-03T22:51:21Z","closed_at":null,"author_association":"NONE","body":"Hi Aliaksey,\r\n\r\nI am seeing frequent crashes in libunwind when I use the profiler on our program. I've edited the stack to remove references to our code and also the **stack below is reversed (upside down)**. Any clues as to what might be happening? I am running on a SLES 11 machine. Our program is multi-threaded and uses tcmalloc. I compiled our program, gperftools' cpu profiler and libunwind (using version 1.2.1) using gcc 4.2.2. I know our compiler is old, but it is for legacy reasons. We'll soon be moving to the latest compiler. Do you think the old compiler is a probable cause?\r\n\r\nAlso, I am planning to compile our program with -fno-omit-frame-pointer. How do I then configure the cpu profiler to do frame pointer based stack tracing instead of using libunwind?\r\n\r\nAny help is appreciated as we really need to get the profiler working.\r\n\r\n-SEGFAULT-Stack- (6) /lib64/libpthread.so.0(+0xf850) [0x7ffff79cb850]\r\n-SEGFAULT-Stack- (5) ProfileHandler::SignalHandler(int, siginfo*, void*)\r\n-SEGFAULT-Stack- (4) CpuProfiler::prof_handler(int, siginfo*, void*, void*)\r\n-SEGFAULT-Stack- (3) GetStackTraceWithContext(void**, int, int, void const*)\r\n-SEGFAULT-Stack- (2) libprofiler.so(+0x92cc) [0x7ffff68812cc]\r\n-SEGFAULT-Stack- (1) libunwind.so.8(_ULx86_64_step+0x22b) [0x7ffff6662bfb]\r\n-SEGFAULT-Stack- (0) libunwind.so.8(+0x3042) [0x7ffff6662042]\r\n\r\nThanks, Krishna"},"comment":{"url":"https://api.github.com/repos/gperftools/gperftools/issues/comments/362861986","html_url":"https://github.com/gperftools/gperftools/issues/947#issuecomment-362861986","issue_url":"https://api.github.com/repos/gperftools/gperftools/issues/947","id":362861986,"user":{"login":"alk","id":14850,"avatar_url":"https://avatars3.githubusercontent.com/u/14850?v=4","gravatar_id":"","url":"https://api.github.com/users/alk","html_url":"https://github.com/alk","followers_url":"https://api.github.com/users/alk/followers","following_url":"https://api.github.com/users/alk/following{/other_user}","gists_url":"https://api.github.com/users/alk/gists{/gist_id}","starred_url":"https://api.github.com/users/alk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alk/subscriptions","organizations_url":"https://api.github.com/users/alk/orgs","repos_url":"https://api.github.com/users/alk/repos","events_url":"https://api.github.com/users/alk/events{/privacy}","received_events_url":"https://api.github.com/users/alk/received_events","type":"User","site_admin":false},"created_at":"2018-02-03T22:51:21Z","updated_at":"2018-02-03T22:51:21Z","author_association":"CONTRIBUTOR","body":"Hi. It could be one the cases described in readme. Stack frame just above signal handler is some code in libpthread. It could be some asm function, perhaps pthread_mutex_lock or similar. If such asm function doesn't have proper exception unwinding annotations, libunwind may get confused. So specific trigger of the crash could be in libc (which is not under you control since you're dealing with super-old enterprise distro).\r\n\r\nLibunwind should not crash regardless. Since they have code to validate all reads. \r\n\r\nMy recommendation:\r\n\r\n* report this crash to libunwind people (and try very latest libunwind)\r\n\r\n* if you want to use frame pointers, it is as simple as either configuring with --disable-libunwind, or you can pass TCMALLOC_STACKTRACE_METHOD=x86 environment variable at run time.\r\n"}}
{"actor":{"display_login":"alk"}}