{"action":"created","issue":{"url":"https://api.github.com/repos/namhyung/uftrace/issues/512","repository_url":"https://api.github.com/repos/namhyung/uftrace","labels_url":"https://api.github.com/repos/namhyung/uftrace/issues/512/labels{/name}","comments_url":"https://api.github.com/repos/namhyung/uftrace/issues/512/comments","events_url":"https://api.github.com/repos/namhyung/uftrace/issues/512/events","html_url":"https://github.com/namhyung/uftrace/issues/512","id":361364878,"node_id":"MDU6SXNzdWUzNjEzNjQ4Nzg=","number":512,"title":"Error from uftrace while capturing multi-threaded application","user":{"login":"AmeyaVS","id":6262562,"node_id":"MDQ6VXNlcjYyNjI1NjI=","avatar_url":"https://avatars0.githubusercontent.com/u/6262562?v=4","gravatar_id":"","url":"https://api.github.com/users/AmeyaVS","html_url":"https://github.com/AmeyaVS","followers_url":"https://api.github.com/users/AmeyaVS/followers","following_url":"https://api.github.com/users/AmeyaVS/following{/other_user}","gists_url":"https://api.github.com/users/AmeyaVS/gists{/gist_id}","starred_url":"https://api.github.com/users/AmeyaVS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmeyaVS/subscriptions","organizations_url":"https://api.github.com/users/AmeyaVS/orgs","repos_url":"https://api.github.com/users/AmeyaVS/repos","events_url":"https://api.github.com/users/AmeyaVS/events{/privacy}","received_events_url":"https://api.github.com/users/AmeyaVS/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-09-18T15:35:27Z","updated_at":"2018-09-20T07:49:34Z","closed_at":null,"author_association":"NONE","body":"While capturing a trace from a multi-threaded application, I have received the following error from uftrace:\r\n\r\n```sh\r\nmcount: /home/ameya/apps/src/uftrace/libmcount/plthook.c:877:plthook_exit\r\n ERROR: <3> invalid dynsym idx: -269488145\r\n```\r\nAfter debugging the application directly through gdb, I found that the uftrace missed some trace events.\r\n\r\nFollowing is the scenario:\r\n1. Application creates `pthreads` with the attributes `PTHREAD_CREATE_DETACHED`.\r\n2. Which would be blocked immediately by a pthread condition variable.\r\n3. The Entry-point of the function for the thread is captured in the trace event.\r\n4. But since the thread is never really allowed to execute using the pthread_condition variable as a blocker\r\n5. No exit event is ever captured since the application force exits and the threads are killed.\r\n\r\n**Note**:\r\nI have attached the script which reproduces the issue.\r\n* Following lines in the script are important once the library is built and installed:\r\n  * line:**102 to 129**\r\n\r\n**Disclaimer**:\r\n* I am not very good at `bash` scripting : P\r\n* You have been **Warned to review the script before executing it!!!**\r\n\r\n**Prerequisites**\r\n* `cmake`\r\n* `wget`\r\n* `perl`\r\n* **Internet connection**: Downloads the library and its regression test suite.\r\n\r\n[systemc-build.txt](https://github.com/namhyung/uftrace/files/2393415/systemc-build.txt)\r\n"},"comment":{"url":"https://api.github.com/repos/namhyung/uftrace/issues/comments/423077972","html_url":"https://github.com/namhyung/uftrace/issues/512#issuecomment-423077972","issue_url":"https://api.github.com/repos/namhyung/uftrace/issues/512","id":423077972,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzA3Nzk3Mg==","user":{"login":"namhyung","id":48503,"node_id":"MDQ6VXNlcjQ4NTAz","avatar_url":"https://avatars0.githubusercontent.com/u/48503?v=4","gravatar_id":"","url":"https://api.github.com/users/namhyung","html_url":"https://github.com/namhyung","followers_url":"https://api.github.com/users/namhyung/followers","following_url":"https://api.github.com/users/namhyung/following{/other_user}","gists_url":"https://api.github.com/users/namhyung/gists{/gist_id}","starred_url":"https://api.github.com/users/namhyung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/namhyung/subscriptions","organizations_url":"https://api.github.com/users/namhyung/orgs","repos_url":"https://api.github.com/users/namhyung/repos","events_url":"https://api.github.com/users/namhyung/events{/privacy}","received_events_url":"https://api.github.com/users/namhyung/received_events","type":"User","site_admin":false},"created_at":"2018-09-20T07:49:34Z","updated_at":"2018-09-20T07:49:34Z","author_association":"OWNER","body":"As you can see from the `uftrace info` it runs pretty recent versions.  I'm running ArchLinux with kernel 4.16, glibc 2.27 and GCC 8.1.  But maybe Ubuntu has some custom settings..\r\n"}}
{"actor":{"display_login":"namhyung"}}