Author vstinner
Recipients Arach, Arfrever, belopolsky, berker.peksag, daniel.urban, marcin.bachry, python-dev, theller, vstinner
Date 2016-07-27.15:07:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1469632079.63.0.0048836143657.issue11048@psf.upfronthosting.co.za>
In-reply-to
Content
Sorry, I'm unable to reproduce the crash using the read-only filesystem. But an assertion confirmed me that the restype is not initialized which is an obvious bug.


ctypes-erofs-crash.diff: LGTM. By the way, the flags field is not initialized neither, but it's probably less important (at least for the destructor).


Alexander Belopolsky: "It would be nice to add a unit test to this patch."

I tried to write a short unit test triggering the bug, but it really depends on low-level implementation details for a very specific corner case. I would prefer to avoid such complex unit test and just fix the bug. We waited for an unit test the last 5 years, it's too late now :-)


"A nit-pick: it would be easier to verify that all CThunkObject fields are initialized if initialization was done in the same order as declaration:"

Right, I rewrote the patch as you suggested. I noticed that flags is not initialized neither (also fixed in my patch).


I pushed a fix.


Thanks marcin.bachry for the initial patch! Thanks Pavel Labushev for your bug report! ... but sorry for the very long delay :-( It looks like nobody reproduced the bug recently, maybe it was fixed in libffi in the meanwhile?
History
Date User Action Args
2016-07-27 15:07:59vstinnersetrecipients: + vstinner, theller, belopolsky, Arfrever, marcin.bachry, daniel.urban, Arach, python-dev, berker.peksag
2016-07-27 15:07:59vstinnersetmessageid: <1469632079.63.0.0048836143657.issue11048@psf.upfronthosting.co.za>
2016-07-27 15:07:59vstinnerlinkissue11048 messages
2016-07-27 15:07:59vstinnercreate