Bug 412482

Summary: Patch to fix crashes involving piece holders
Product: [Applications] palapeli Reporter: Bernd Schmidt <bernds_cb1>
Component: generalAssignee: Stefan Majewsky <majewsky>
Status: REPORTED ---    
Severity: normal CC: aacid, kde-games-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: A patch to fix the problem

Description Bernd Schmidt 2019-09-30 14:03:22 UTC
Created attachment 122949 [details]
A patch to fix the problem

Palapeli sometimes crashes when using piece holders. What seems to happen is that two pieces in different scenes/views are merged, and the code trying to update the piece list for one of these scenes fails to remove the piece because it's not on the list. The piece then gets deleted (through a deleteLater call), but it's still in the list for another scene, and we get a use-after-free scenario.

I'm attaching a patch which seems to fix it - I've been unable to reproduce crashes after this.
Comment 1 Albert Astals Cid 2019-09-30 22:28:29 UTC
I don't think this is the correct fix, i think it's just masking that piece->logicalNeighbors() is giving wrong information and that's what we should aim at fixing in my opinion