From nobody@FreeBSD.org  Thu Nov 22 16:39:56 2007
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 BE5A116A41A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 22 Nov 2007 16:39:56 +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 B0A1613C46A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 22 Nov 2007 16:39:56 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.1/8.14.1) with ESMTP id lAMGdrAt085113
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 22 Nov 2007 16:39:53 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.1/8.14.1/Submit) id lAMGdrco085112;
	Thu, 22 Nov 2007 16:39:53 GMT
	(envelope-from nobody)
Message-Id: <200711221639.lAMGdrco085112@www.freebsd.org>
Date: Thu, 22 Nov 2007 16:39:53 GMT
From: Henrik Gulbrandsen <henrik@gulbra.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] wxgtk26 + gtk20 incompatibility crashes audio/audacity
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: craig@yekse.gank.org

>Number:         118202
>Category:       ports
>Synopsis:       [patch] wxgtk26 + gtk20 incompatibility crashes audio/audacity
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    fjoe
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 22 16:40:01 UTC 2007
>Closed-Date:    Sat Nov 24 19:59:23 UTC 2007
>Last-Modified:  Sat Nov 24 20:10:01 UTC 2007
>Originator:     Henrik Gulbrandsen
>Release:        7.0-BETA3
>Organization:
>Environment:
FreeBSD Particle 7.0-BETA3 FreeBSD 7.0-BETA3 #0: Wed Nov 21 12:44:38 CET 2007
henrik@Particle:/usr/src/sys/i386/compile/GENERIC  i386

>Description:
The audio/audacity port segfaults in 7.0-BETA3. If the $HOME/.audacity file is
missing, this happens immediately at startup. It turns out that the wxWidgets
port (x11-toolkits/wxgtk26) is incompatible with a recent upgrade of the GTK+
port (x11-toolkits/gtk20) from 2.10.14 to 2.12.1, since GtkBorder objects can
no longer be released with g_free(). Attempting to do so anyway will instead
release a large block of internal data structures needed for memory allocation
in GLib, leading to extensive memory corruption and premature death.

Note that many programs using the wxgtk26 port are likely to be affected by this
bug in more or less subtle ways. The required patches are already included in
wx-2.8.x and are not needed for wx-2.4.x, so this is specific to wxgtk26.

>How-To-Repeat:
Memory corruption problems can be tricky to reproduce, but I would try removing
any pre-existing $HOME/.audacity file before starting audacity. The bug may also
depend on the actual GTK theme in use, so you might need some variation there.

>Fix:
The attached shell archive contains two single-line patches suitable for the
x11-toolkits/wxgtk26/files directory. With a lack of bad luck, that's it!


Patch attached with submission follows:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	patch-src-gtk-button.cpp
#	patch-src-gtk-window.cpp
#
echo x - patch-src-gtk-button.cpp
sed 's/^X//' >patch-src-gtk-button.cpp << 'END-of-patch-src-gtk-button.cpp'
X--- src/gtk/button.cpp.orig	2006-03-22 00:42:16.000000000 +0100
X+++ src/gtk/button.cpp	2007-11-22 14:00:47.000000000 +0100
X@@ -89,7 +89,7 @@
X             right_border += default_border->right;
X             top_border += default_border->top;
X             bottom_border += default_border->bottom;
X-            g_free( default_border );
X+            gtk_border_free( default_border );
X         }
X #else
X         left_border = 6;
END-of-patch-src-gtk-button.cpp
echo x - patch-src-gtk-window.cpp
sed 's/^X//' >patch-src-gtk-window.cpp << 'END-of-patch-src-gtk-window.cpp'
X--- src/gtk/window.cpp.orig	2006-03-22 00:42:17.000000000 +0100
X+++ src/gtk/window.cpp	2007-11-22 14:01:22.000000000 +0100
X@@ -3279,7 +3279,7 @@
X                 right_border += default_border->right;
X                 top_border += default_border->top;
X                 bottom_border += default_border->bottom;
X-                g_free( default_border );
X+                gtk_border_free( default_border );
X             }
X #else
X             left_border = 6;
END-of-patch-src-gtk-window.cpp
exit



>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Thu Nov 22 22:52:04 UTC 2007 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118202 
Responsible-Changed-From-To: freebsd-ports-bugs->fjoe 
Responsible-Changed-By: fjoe 
Responsible-Changed-When: Sat Nov 24 07:03:02 UTC 2007 
Responsible-Changed-Why:  
Mine. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118202 
State-Changed-From-To: feedback->closed 
State-Changed-By: fjoe 
State-Changed-When: Sat Nov 24 19:56:53 UTC 2007 
State-Changed-Why:  
Committed. Thank you for high quality problem report! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/118202: commit references a PR
Date: Sat, 24 Nov 2007 20:00:13 +0000 (UTC)

 fjoe        2007-11-24 19:58:44 UTC
 
   FreeBSD ports repository
 
   Modified files:
     x11-toolkits/wxgtk26 Makefile 
     x11-toolkits/wxgtk26-unicode Makefile 
   Added files:
     x11-toolkits/wxgtk26/files patch-src-gtk-button.cpp 
                                patch-src-gtk-window.cpp 
   Log:
   Fix coredump: use gtk_border_free() insead of g_free()
   for freeing border objects. The change exists in wxgtk 2.8 and later.
   
   PR:             118202
   Submitted by:   Henrik Gulbrandsen
   Approved by:    portmgr (linimon)
   
   Revision  Changes    Path
   1.12      +1 -1      ports/x11-toolkits/wxgtk26-unicode/Makefile
   1.38      +1 -1      ports/x11-toolkits/wxgtk26/Makefile
   1.1       +11 -0     ports/x11-toolkits/wxgtk26/files/patch-src-gtk-button.cpp (new)
   1.1       +11 -0     ports/x11-toolkits/wxgtk26/files/patch-src-gtk-window.cpp (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"
 
>Unformatted:
