{"action":"created","issue":{"url":"https://api.github.com/repos/mavlink/mavros/issues/937","repository_url":"https://api.github.com/repos/mavlink/mavros","labels_url":"https://api.github.com/repos/mavlink/mavros/issues/937/labels{/name}","comments_url":"https://api.github.com/repos/mavlink/mavros/issues/937/comments","events_url":"https://api.github.com/repos/mavlink/mavros/issues/937/events","html_url":"https://github.com/mavlink/mavros/issues/937","id":294147429,"number":937,"title":"Bug: terminate called after throwing an instance of 'std::bad_weak_ptr'","user":{"login":"TSC21","id":5048656,"avatar_url":"https://avatars1.githubusercontent.com/u/5048656?v=4","gravatar_id":"","url":"https://api.github.com/users/TSC21","html_url":"https://github.com/TSC21","followers_url":"https://api.github.com/users/TSC21/followers","following_url":"https://api.github.com/users/TSC21/following{/other_user}","gists_url":"https://api.github.com/users/TSC21/gists{/gist_id}","starred_url":"https://api.github.com/users/TSC21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TSC21/subscriptions","organizations_url":"https://api.github.com/users/TSC21/orgs","repos_url":"https://api.github.com/users/TSC21/repos","events_url":"https://api.github.com/users/TSC21/events{/privacy}","received_events_url":"https://api.github.com/users/TSC21/received_events","type":"User","site_admin":false},"labels":[{"id":70643006,"url":"https://api.github.com/repos/mavlink/mavros/labels/bug","name":"bug","color":"fc2929","default":true},{"id":120290095,"url":"https://api.github.com/repos/mavlink/mavros/labels/build%20error","name":"build error","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2018-02-03T21:41:28Z","updated_at":"2018-05-10T15:28:18Z","closed_at":null,"author_association":"MEMBER","body":"This is an intermitent error that appears to crash the `mavros_node`. More than once happened in the PX4 Jenkins CI (example: http://ci.px4.io:8080/blue/organizations/jenkins/Firmware/detail/PR-8804/1/pipeline/). \r\n\r\nA more deep search for the usage of `std::weak_ptr` leads me to think that the `std::bad_weak_ptr` exception is triggered because the `weak_link` for the `mavconn` `diagnostic_update` object that was deleted (based on the `std::bad_weak_ptr` exception definition, `std::bad_weak_ptr is the type of the object thrown as exceptions by the constructors of std::shared_ptr that take std::weak_ptr as the argument, when the std::weak_ptr refers to an already deleted object`). I'm pointing to a possible gap in https://github.com/mavlink/mavros/blob/master/mavros/include/mavros/mavlink_diag.h.\r\n\r\nA possible solution will probably involve the exception catch and handling, besides adding a verification to `std::weak_ptr::expired` (http://en.cppreference.com/w/cpp/memory/weak_ptr/expired) in order to verify whether the managed object has already been deleted.\r\n\r\n@dagar FYI."},"comment":{"url":"https://api.github.com/repos/mavlink/mavros/issues/comments/388088897","html_url":"https://github.com/mavlink/mavros/issues/937#issuecomment-388088897","issue_url":"https://api.github.com/repos/mavlink/mavros/issues/937","id":388088897,"user":{"login":"mhkabir","id":5557676,"avatar_url":"https://avatars1.githubusercontent.com/u/5557676?v=4","gravatar_id":"","url":"https://api.github.com/users/mhkabir","html_url":"https://github.com/mhkabir","followers_url":"https://api.github.com/users/mhkabir/followers","following_url":"https://api.github.com/users/mhkabir/following{/other_user}","gists_url":"https://api.github.com/users/mhkabir/gists{/gist_id}","starred_url":"https://api.github.com/users/mhkabir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhkabir/subscriptions","organizations_url":"https://api.github.com/users/mhkabir/orgs","repos_url":"https://api.github.com/users/mhkabir/repos","events_url":"https://api.github.com/users/mhkabir/events{/privacy}","received_events_url":"https://api.github.com/users/mhkabir/received_events","type":"User","site_admin":false},"created_at":"2018-05-10T15:28:18Z","updated_at":"2018-05-10T15:28:18Z","author_association":"MEMBER","body":"Nope. "}}
{"actor":{"display_login":"mhkabir"}}