Skip Menu |

This queue is for tickets about the Inline-Python CPAN distribution.

Report information
The Basics
Id: 48081
Status: resolved
Priority: 0/
Queue: Inline-Python

People
Owner: Nobody in particular
Requestors: matt.mulsow [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.29
Fixed in: (no value)



Subject: Invalid ref count on objects from Python class instances
The following code: require Inline::Python; Inline::Python::py_eval('class Foo: pass'); Inline::Python::py_eval('Foo()', 0); Causes the warning message: Attempt to free unreferenced scalar: SV 0x8048c0, Perl interpreter: 0x800000. It seems that the Py2Pl function does not correctly set the ref count on objects from Python class instances. I am using Inline Python 0.29 with Perl 5.10.0 and Python 2.6.2. I have seen the problem on Linux, Mac OS X, and Windows.
Subject: Re: [rt.cpan.org #48081] Invalid ref count on objects from Python class instances
Date: Wed, 22 Jul 2009 17:05:26 +0200
To: bug-Inline-Python [...] rt.cpan.org
From: Stefan Seifert <nine [...] detonation.org>
On Wednesday 22 July 2009 16:43:33 Matt Mulsow via RT wrote: Show quoted text
> Inline::Python::py_eval('Foo()', 0); > > Causes the warning message: > > Attempt to free unreferenced scalar: SV 0x8048c0, Perl interpreter: > 0x800000. > > It seems that the Py2Pl function does not correctly set the ref count on > objects from Python class instances.
Py2Pl should be correct. But py_eval is likely to be buggy. Inline::Python::py_call_function('__main__', 'Foo'); does work as expected as is tested by t/19testref.t. I personally never used py_eval, so it's likely to contain ref counting bugs. I'll try to fix it. Until then, you could just use py_call_function. Thanks for the perfect report!
Download signature.asc
application/pgp-signature 197b

Message body not shown because it is not plain text.

fixed in Inline::Python 0.39