[PATCH] pytalloc and pidl changes for refcounting and incorrect msDS-IntID handling

Stefan Metzmacher metze at samba.org
Tue Feb 16 13:28:05 UTC 2016


Am 16.02.2016 um 04:25 schrieb Andrew Bartlett:
> On Wed, 2016-01-06 at 13:10 +1300, Andrew Bartlett wrote:
>>  
>> Thanks.  I also have had a failure that indicates our python
>> reference
>> counting issue may be biting us again.  I'm looking into that.
>>
>> Andrew Bartlett
> 
> The attached patches appear to address the segfaults by sorting out our
> reference handling - we need to track both the talloc context of the
> Samba object and the reference handle used by python.
> 
> I even have tests to show we are handling the references correctly!

Thanks!

There's one unused tmp_ctx variable you just create and free...

> This all seems fairly sane, until you realise that pytalloc.h is a
> PUBLIC header.  I've tried some things to fix that, but none of it is
> easy, or even practical, so I'm posting this to the list to seek
> advice.  
> 
> Is it reasonable to make an ABI break on pytalloc.h without changing
> the talloc major version?
> 

I think the goal should be to remove *every* PyObject_HEAD from any header
file! That means all internal object state is private and instead of ugly
macros like pytalloc_get_mem_ctx(), pytalloc_get_ptr(),
PyCredentials_AsCliCredentials()
and many others need to be real functions.

For objects derived from "talloc.Object", we should provide a
pytalloc_Ready() as wrapper to PyType_Ready(), that fills in the required
magic to the PyTypeObject.

In order to prevent ABI problems we can think of adding new functions
and keep (and deprecate) the broken once. Maybe we can provide the abstract
class as something like "talloc.BaseObject".

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160216/2f112b5a/signature.sig>


More information about the samba-technical mailing list