Skip to content

Commit

Permalink
Fixed segfault on returning Perl objects from Python space
Browse files Browse the repository at this point in the history
Updated docs to reflect new co-maintainership and new known bugs


git-svn-id: svn+ssh://linux/var/lib/svn/Inline-Python@2 735a7244-8e04-11dd-afe3-e3a3f23f2e30
  • Loading branch information
nine committed Sep 29, 2008
1 parent 83b7391 commit dee009f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
5 changes: 5 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Revision history for Perl extension Inline::Python.

0.23 Mon Sep 29 11:50:00 CEST 2008 (Stefan Seifert)
- fixed segfault when returing perl objects from python functions and methods
- fixed uninitialized member variables of perl subs
- updated documentation to reflect new co-maintainer

0.22 Sun Jan 9 22:29:54 PST 2005
[Bug reported by David Dyck]
- removed some declarations after statements
Expand Down
22 changes: 20 additions & 2 deletions Python.pod
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,9 @@ exactly what Inline::Python itself does.
This is an ALPHA release of Inline::Python. Further testing and
expanded support for other operating systems and platforms will be a
focus for future releases. It has been tested on RedHat Linux 6.2 with
a variety of different Perl and Python configurations. Previous versions
of Inline::Python working on Windows and Cygwin -- this version has never been
a variety of different Perl and Python configurations. It also seems to be
running pretty well on openSUSE 10.3 and 11.0. Previous versions of
Inline::Python working on Windows and Cygwin -- this version has never been
tested there. I strongly suspect it will require patching. Please send me
patches.

Expand Down Expand Up @@ -657,6 +658,21 @@ related to C<mymodule> or C<B> is imported, unless some Python code
explicitly copies variables from the mymodule namespace into the global
namespace before Perl binds to it.

=item 2

Inline::Python currently leaks a lot of memory. Basically all parameters to
py_call_function and py_call_method, their return values in void context and
Python objects passed into perl space. There are probably more leaks hidden
somewhere. That's not much of a problem for single run scripts, but has to be
kept in mind when using in long running daemons or mod_perl environments.

The upcoming 0.24 should fix most of these leaks, and will be released as soon
as the odd segfaults get fixed that surfaced instead. (some code like
destructors obviously was never run before).

I am very interested in reports of segfaults, leaks other than the ones
described and of course testcases.

=back

=head1 AUTHOR
Expand All @@ -670,6 +686,8 @@ suggestions throughout the development of Inline::Python.
Eric Wilhelm provided support for 'new-style' classes in version 0.21. Many
thanks, Eric!

Stefan Seifert <[email protected]> fixed some bugs and is current co-maintainer.

=head1 COPYRIGHT

Copyright (c) 2001, Neil Watkiss.
Expand Down
8 changes: 6 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ INFORMATION:
The Inline::Python mailing list is [email protected]. Send mail to
[email protected] to subscribe.

Please send questions and comments to "Neil Watkiss" <[email protected]>
Please send questions and comments to "Stefan Seifert" <[email protected]>

Copyright (c) 2000, Neil Watkiss. All Rights Reserved. This module is free software.
It may be used, redistributed and/or modified under the same terms as Perl itself.

(see http://www.perl.com/perl/misc/Artistic.html)

Copyright (c) 2000, Neil Watkiss. All Rights Reserved.
7 changes: 6 additions & 1 deletion perlmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ static void
PerlObj_dealloc(PerlObj_object *self) {
Py_XDECREF(self->pkg);

if (self->obj) SvREFCNT_dec(self->obj);
if (self->obj) sv_2mortal(self->obj); // mortal instead of DECREF. Object might be return value

PyMem_DEL(self);
}
Expand Down Expand Up @@ -301,6 +301,11 @@ newPerlSub_object(PyObject *package, PyObject *sub, SV *cv) {
self->pkg = package;
self->full = PyString_FromString(str);
}
else {
self->sub = NULL;
self->pkg = NULL;
self->full = NULL;
}

/* we don't have to check for errors because we shouldn't have been
* created unless perl_get_cv worked once.
Expand Down

0 comments on commit dee009f

Please sign in to comment.