{"action":"created","issue":{"url":"https://api.github.com/repos/xbmc/xbmc/issues/11225","repository_url":"https://api.github.com/repos/xbmc/xbmc","labels_url":"https://api.github.com/repos/xbmc/xbmc/issues/11225/labels{/name}","comments_url":"https://api.github.com/repos/xbmc/xbmc/issues/11225/comments","events_url":"https://api.github.com/repos/xbmc/xbmc/issues/11225/events","html_url":"https://github.com/xbmc/xbmc/pull/11225","id":196621045,"number":11225,"title":"[PVR] Fix crashes on pvr manager deinit/reinit - part 2","user":{"login":"ksooo","id":3226626,"avatar_url":"https://avatars.githubusercontent.com/u/3226626?v=3","gravatar_id":"","url":"https://api.github.com/users/ksooo","html_url":"https://github.com/ksooo","followers_url":"https://api.github.com/users/ksooo/followers","following_url":"https://api.github.com/users/ksooo/following{/other_user}","gists_url":"https://api.github.com/users/ksooo/gists{/gist_id}","starred_url":"https://api.github.com/users/ksooo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksooo/subscriptions","organizations_url":"https://api.github.com/users/ksooo/orgs","repos_url":"https://api.github.com/users/ksooo/repos","events_url":"https://api.github.com/users/ksooo/events{/privacy}","received_events_url":"https://api.github.com/users/ksooo/received_events","type":"User","site_admin":false},"labels":[{"id":84780369,"url":"https://api.github.com/repos/xbmc/xbmc/labels/Backport-Needed","name":"Backport-Needed","color":"5319e7","default":false},{"id":1659186,"url":"https://api.github.com/repos/xbmc/xbmc/labels/Fix","name":"Fix","color":"0b02e1","default":false},{"id":15146247,"url":"https://api.github.com/repos/xbmc/xbmc/labels/PVR","name":"PVR","color":"009800","default":false},{"id":400751192,"url":"https://api.github.com/repos/xbmc/xbmc/labels/v18%20L***","name":"v18 L***","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/xbmc/xbmc/milestones/95","html_url":"https://github.com/xbmc/xbmc/milestone/95","labels_url":"https://api.github.com/repos/xbmc/xbmc/milestones/95/labels","id":2166828,"number":95,"title":"L 18.0-alpha1","description":"","creator":{"login":"MartijnKaijser","id":907436,"avatar_url":"https://avatars.githubusercontent.com/u/907436?v=3","gravatar_id":"","url":"https://api.github.com/users/MartijnKaijser","html_url":"https://github.com/MartijnKaijser","followers_url":"https://api.github.com/users/MartijnKaijser/followers","following_url":"https://api.github.com/users/MartijnKaijser/following{/other_user}","gists_url":"https://api.github.com/users/MartijnKaijser/gists{/gist_id}","starred_url":"https://api.github.com/users/MartijnKaijser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartijnKaijser/subscriptions","organizations_url":"https://api.github.com/users/MartijnKaijser/orgs","repos_url":"https://api.github.com/users/MartijnKaijser/repos","events_url":"https://api.github.com/users/MartijnKaijser/events{/privacy}","received_events_url":"https://api.github.com/users/MartijnKaijser/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":127,"state":"open","created_at":"2016-11-30T16:58:49Z","updated_at":"2016-12-21T23:07:26Z","due_on":"2017-01-31T08:00:00Z","closed_at":null},"comments":19,"created_at":"2016-12-20T09:13:24Z","updated_at":"2016-12-22T06:57:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/xbmc/xbmc/pulls/11225","html_url":"https://github.com/xbmc/xbmc/pull/11225","diff_url":"https://github.com/xbmc/xbmc/pull/11225.diff","patch_url":"https://github.com/xbmc/xbmc/pull/11225.patch"},"body":"This is a followup to #11143 \r\n\r\nNow, that first chunk of fixes is in master/Krypton, next (and hopefully the last) wave of followup issues arrives. First wave of fixes was definitely okay, but formerly, we did not get that far... ;-)\r\n\r\nCrashes with stacks very similar to the following were reported on the forum (http://forum.kodi.tv/showthread.php?tid=298461&pid=2481973#pid2481973) and by @peak3d:\r\n\r\n<pre>\r\nProgram terminated with signal SIGSEGV, Segmentation fault.\r\n#0  0x006c98f8 in CDatabase::InitSettings (this=this@entry=0x5c12c500, dbSettings=...) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.0-devel-debug/kodi-17.0-beta7-7581c4a/xbmc/dbwrappers/Database.cpp:404\r\n[Current thread is 1 (Thread 0x56e233a0 (LWP 831))]\r\n\r\nThread 52 (Thread 0x66f023a0 (LWP 815)):\r\n...\r\n#29 0x007d0d28 in PVR::CPVRRecordings::CPVRRecordings (this=0x721141e8) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.0-devel-debug/kodi-17.0-beta7-7581c4a/xbmc/pvr/recordings/PVRRecordings.cpp:51\r\n=> PVR::CPVRManager::ResetProperties called PVR::CPVRManager::Clear() which deleted m_database and has set it to nullptr!\r\n#30 0x007fb938 in PVR::CPVRManager::ResetProperties (this=this@entry=0x2ec7f50) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.0-devel-debug/kodi-17.0-beta7-7581c4a/xbmc/pvr/PVRManager.cpp:281\r\n#31 0x007fbb18 in PVR::CPVRManager::Start (this=0x2ec7f50) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.0-devel-debug/kodi-17.0-beta7-7581c4a/xbmc/pvr/PVRManager.cpp:322\r\n#32 0x007f0cf0 in PVR::CPVRClients::ConnectionStateChange (this=<optimized out>, client=0x721bd4d0, strConnectionString=..., newState=PVR_CONNECTION_STATE_CONNECTED, strMessage=...) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.0-devel-debug/kodi-17.0-beta7-7581c4a/xbmc/pvr/addons/PVRClients.cpp:1543\r\n#33 0x007fa1fc in PVR::CPVRClientConnectionJob::DoWork (this=0x5c2cd480) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.0-devel-debug/kodi-17.0-beta7-7581c4a/xbmc/pvr/PVRManager.cpp:1884\r\n#34 0x005b6ffc in CJobWorker::Process (this=0x4798500) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.0-devel-debug/kodi-17.0-beta7-7581c4a/xbmc/utils/JobManager.cpp:69\r\n#35 0x005f65c4 in CThread::Action (this=0x4798500) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.0-devel-debug/kodi-17.0-beta7-7581c4a/xbmc/threads/Thread.cpp:221\r\n#36 0x005f6ca8 in CThread::staticThread (data=0x4798500) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.0-devel-debug/kodi-17.0-beta7-7581c4a/xbmc/threads/Thread.cpp:131\r\n#37 0x76f0ff40 in start_thread (arg=0x66f023a0) at pthread_create.c:335\r\n#38 0x7532be18 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:86 from /usr/lib/libc.so.6\r\nBacktrace stopped: previous frame identical to this frame (corrupt stack?)\r\n\r\nThread 1 (Thread 0x56e233a0 (LWP 831)):\r\n#0  0x006c98f8 in CDatabase::InitSettings (this=this@entry=0x5c12c500, dbSettings=...) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.0-devel-debug/kodi-17.0-beta7-7581c4a/xbmc/dbwrappers/Database.cpp:404\r\n=> m_database access is not protected by pvr mgr lock => ptr value may get null or invalid at any time (like happened in this case because thread 52 deleted m_database concurrently).\r\n#1  0x006cab64 in CDatabase::Open (this=0x5c12c500, settings=...) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.0-devel-debug/kodi-17.0-beta7-7581c4a/xbmc/dbwrappers/Database.cpp:370\r\n#2  0x007fbc94 in PVR::CPVRManager::Process (this=0x2ec7f50) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.0-devel-debug/kodi-17.0-beta7-7581c4a/xbmc/pvr/PVRManager.cpp:429\r\n#3  0x005f65c4 in CThread::Action (this=0x2ec7f58) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.0-devel-debug/kodi-17.0-beta7-7581c4a/xbmc/threads/Thread.cpp:221\r\n#4  0x005f6ca8 in CThread::staticThread (data=0x2ec7f58) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.0-devel-debug/kodi-17.0-beta7-7581c4a/xbmc/threads/Thread.cpp:131\r\n#5  0x76f0ff40 in start_thread (arg=0x56e233a0) at pthread_create.c:335\r\n#6  0x7532be18 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:86 from /usr/lib/libc.so.6\r\nBacktrace stopped: previous frame identical to this frame (corrupt stack?)\r\n</pre>\r\n\r\n@Jalle19 mind doing the code review.\r\n@MilhouseVH could you please include this into your build?\r\n"},"comment":{"url":"https://api.github.com/repos/xbmc/xbmc/issues/comments/268732228","html_url":"https://github.com/xbmc/xbmc/pull/11225#issuecomment-268732228","issue_url":"https://api.github.com/repos/xbmc/xbmc/issues/11225","id":268732228,"user":{"login":"janbar","id":2353635,"avatar_url":"https://avatars.githubusercontent.com/u/2353635?v=3","gravatar_id":"","url":"https://api.github.com/users/janbar","html_url":"https://github.com/janbar","followers_url":"https://api.github.com/users/janbar/followers","following_url":"https://api.github.com/users/janbar/following{/other_user}","gists_url":"https://api.github.com/users/janbar/gists{/gist_id}","starred_url":"https://api.github.com/users/janbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janbar/subscriptions","organizations_url":"https://api.github.com/users/janbar/orgs","repos_url":"https://api.github.com/users/janbar/repos","events_url":"https://api.github.com/users/janbar/events{/privacy}","received_events_url":"https://api.github.com/users/janbar/received_events","type":"User","site_admin":false},"created_at":"2016-12-22T06:57:58Z","updated_at":"2016-12-22T06:57:58Z","body":"Thanks, I try it"}}
{"actor":{"display_login":"janbar"}}