Bug 412482 - Patch to fix crashes involving piece holders
Summary: Patch to fix crashes involving piece holders
Status: REPORTED
Alias: None
Product: palapeli
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Stefan Majewsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-30 14:03 UTC by Bernd Schmidt
Modified: 2019-09-30 22:28 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
A patch to fix the problem (3.89 KB, patch)
2019-09-30 14:03 UTC, Bernd Schmidt
Details

Note You need to log in before you can comment on or make changes to this bug.
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