STINNER Victor added the comment:

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?

----------
nosy: +haypo
resolution:  -> fixed
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11048>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to