From nobody@FreeBSD.org  Thu Feb 12 14:56:19 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CD1D41065670
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 12 Feb 2009 14:56:19 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id A17F68FC13
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 12 Feb 2009 14:56:19 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CEuJ4F032073
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 12 Feb 2009 14:56:19 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n1CEuJ3F032071;
	Thu, 12 Feb 2009 14:56:19 GMT
	(envelope-from nobody)
Message-Id: <200902121456.n1CEuJ3F032071@www.freebsd.org>
Date: Thu, 12 Feb 2009 14:56:19 GMT
From: Andriy Pylypenko <bamby@sippysoft.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Crash on import py-xmlrpc in python 2.5
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         131609
>Category:       ports
>Synopsis:       Crash on import net/py-xmlrpc in python 2.5
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    perky
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 12 15:00:15 UTC 2009
>Closed-Date:    Wed Mar 18 06:25:20 UTC 2009
>Last-Modified:  Wed Mar 18 06:25:20 UTC 2009
>Originator:     Andriy Pylypenko
>Release:        FreeBSD 6.x, 7.x
>Organization:
Sippysoft Inc
>Environment:
Not machine specific
>Description:
There is a bug in the py-xmlrpc module which leads to crash of the interpreter. In the module the PyObject_NEW()/PyMem_DEL() are used while the PyObject_NEW()/PyObject_DEL() pair must be used. This bug is well known actually and very old. But the project looks to be abandoned so the fix has not been incorporated into the source code yet. Here is this bug report and fix at the project's tracker.

http://sourceforge.net/tracker/index.php?func=detail&aid=1734819&group_id=23992&atid=380301

>How-To-Repeat:
Install the module under Python 2.5 or higher and try to import it.
>Fix:
PyMem_DEL() calls must be replaced with PyObject_DEL() calls.

Patch attached with submission follows:

--- src/rpcBase64.c.orig	2003-04-21 18:39:15.000000000 +0300
+++ src/rpcBase64.c	2008-10-15 10:36:44.000000000 +0300
@@ -239,7 +239,7 @@
 	if (bp->value) {
 		Py_DECREF(bp->value);
 	}
-	PyMem_DEL(bp);
+	PyObject_DEL(bp);
 }
 
 
--- src/rpcClient.c.orig	2003-04-21 18:39:15.000000000 +0300
+++ src/rpcClient.c	2008-10-15 10:36:44.000000000 +0300
@@ -179,7 +179,7 @@
 	cp->url = NULL;
 	Py_DECREF(cp->src);
 	Py_DECREF(cp->disp);
-	PyMem_DEL(cp);
+	PyObject_DEL(cp);
 }
 
 
--- src/rpcDate.c.orig	2003-04-21 18:39:15.000000000 +0300
+++ src/rpcDate.c	2008-10-15 10:36:44.000000000 +0300
@@ -75,7 +75,7 @@
 	if (dp->value) {
 		Py_DECREF(dp->value);
 	}
-	PyMem_DEL(dp);
+	PyObject_DEL(dp);
 }
 
 
--- src/rpcDispatch.c.orig	2003-04-21 18:39:15.000000000 +0300
+++ src/rpcDispatch.c	2008-10-15 10:36:44.000000000 +0300
@@ -68,7 +68,7 @@
 		rpcDispClear(dp);
 		free(dp->srcs);
 	}
-	PyMem_DEL(dp);
+	PyObject_DEL(dp);
 }
 
 
--- src/rpcSource.c.orig	2003-04-21 18:39:15.000000000 +0300
+++ src/rpcSource.c	2008-10-15 10:36:44.000000000 +0300
@@ -61,7 +61,7 @@
 	if (srcp->onErr and srcp->onErrType == ONERR_TYPE_PY) {
 		Py_DECREF((PyObject *)srcp->onErr);
 	}
-	PyMem_DEL(srcp);
+	PyObject_DEL(srcp);
 }
 
 


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->perky 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Feb 13 13:10:45 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=131609 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/131609: commit references a PR
Date: Fri, 27 Feb 2009 01:35:40 +0000 (UTC)

 sobomax     2009-02-27 01:35:30 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net/py-xmlrpc        Makefile 
   Added files:
     net/py-xmlrpc/files  patch-src_rpcBase64.c 
                          patch-src_rpcBoolean.c 
                          patch-src_rpcClient.c patch-src_rpcDate.c 
                          patch-src_rpcDispatch.c 
                          patch-src_rpcSource.c 
   Log:
   Fix python interpreter crash caused by the incorrect use of PyMem_DEL()
   instead of PyObject_DEL().
   
   PR:             ports/131609
   Submitted by:   Andriy Pylypenko <bamby@sippysoft.com>
   Approved by:    MAINTAINER's timeout
   
   Revision  Changes    Path
   1.15      +1 -0      ports/net/py-xmlrpc/Makefile
   1.1       +14 -0     ports/net/py-xmlrpc/files/patch-src_rpcBase64.c (new)
   1.1       +14 -0     ports/net/py-xmlrpc/files/patch-src_rpcBoolean.c (new)
   1.1       +14 -0     ports/net/py-xmlrpc/files/patch-src_rpcClient.c (new)
   1.1       +14 -0     ports/net/py-xmlrpc/files/patch-src_rpcDate.c (new)
   1.1       +14 -0     ports/net/py-xmlrpc/files/patch-src_rpcDispatch.c (new)
   1.1       +14 -0     ports/net/py-xmlrpc/files/patch-src_rpcSource.c (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Wed Mar 18 06:25:04 UTC 2009 
State-Changed-Why:  
committed 2009-02-27. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=131609 
>Unformatted:
