Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 880578 Details for
Bug 1082455
gdbus-codegen generates crasher code when GLIB_VERSION_MAX_ALLOWED
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Backport upstream patch to fix broken gdbus-codegen generated code
0001-Backport-upstream-patch-to-fix-broken-gdbus-codegen-.patch (text/plain), 9.38 KB, created by
Stef Walter
on 2014-03-31 06:30:55 UTC
(
hide
)
Description:
Backport upstream patch to fix broken gdbus-codegen generated code
Filename:
MIME Type:
Creator:
Stef Walter
Created:
2014-03-31 06:30:55 UTC
Size:
9.38 KB
patch
obsolete
>From 1ffadc5dc49139b8834b04a5cd30ecf1d5557347 Mon Sep 17 00:00:00 2001 >From: Stef Walter <stefw@redhat.com> >Date: Mon, 31 Mar 2014 08:28:45 +0200 >Subject: [PATCH] Backport upstream patch to fix broken gdbus-codegen generated > code > >Resolves: rhbz#1082455 >--- > glib2.spec | 8 +- > ...eak-gdbus-codegen-with-max-version-710133.patch | 133 +++++++++++++++++++++ > 2 files changed, 140 insertions(+), 1 deletion(-) > create mode 100644 unbreak-gdbus-codegen-with-max-version-710133.patch > >diff --git a/glib2.spec b/glib2.spec >index b409481..51e8492 100644 >--- a/glib2.spec >+++ b/glib2.spec >@@ -3,7 +3,7 @@ > Summary: A library of handy utility functions > Name: glib2 > Version: 2.38.2 >-Release: 2%{?dist} >+Release: 3%{?dist} > License: LGPLv2+ > Group: System Environment/Libraries > URL: http://www.gtk.org >@@ -11,6 +11,7 @@ URL: http://www.gtk.org > Source: http://download.gnome.org/sources/glib/2.38/glib-%{version}.tar.xz > > Patch0: 0001-GDBusObjectManagerClient-keep-the-manager-alive-whil.patch >+Patch1: unbreak-gdbus-codegen-with-max-version-710133.patch > > BuildRequires: pkgconfig > BuildRequires: gettext >@@ -79,6 +80,7 @@ the functionality of the installed glib2 package. > %setup -q -n glib-%{version} > > %patch0 -p1 >+%patch1 -p1 > > # Workaround wrong gtk-doc.make timestamp > # https://bugzilla.gnome.org/show_bug.cgi?id=700350 >@@ -209,6 +211,10 @@ gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules > %{_datadir}/installed-tests > > %changelog >+* Mon Mar 31 2014 Stef Walter <stefw@redhat.com> - 2.38.2-3 >+- Unbreak gdbus-codegen used with GLIB_VERSION_MAX_ALLOWED >+- Resolves: rhbz#1082455 >+ > * Wed Nov 27 2013 Rui Matos <rmatos@redhat.com> - 2.38.2-2 > - Add upstream patch for https://bugzilla.gnome.org/show_bug.cgi?id=719402 > - Resolves: rhbz#1035423 - Use after free causes critical warnings in g-s-d, potential crasher >diff --git a/unbreak-gdbus-codegen-with-max-version-710133.patch b/unbreak-gdbus-codegen-with-max-version-710133.patch >new file mode 100644 >index 0000000..02697a2 >--- /dev/null >+++ b/unbreak-gdbus-codegen-with-max-version-710133.patch >@@ -0,0 +1,133 @@ >+commit 1b08980b48df4bcf973d3e308780dfdb3a62e9fa >+Author: Emmanuele Bassi <ebassi@gnome.org> >+Date: Mon Oct 14 19:30:21 2013 +0100 >+ >+ gdbus-codegen: Take into consideration MAX_ALLOWED for private data >+ >+ The G_ADD_PRIVATE() macro, and the auto-generated get_instance_private() >+ internal function, should be used conditionally depending on the maximum >+ allowed version of GLib, as defined by the GLIB_VERSION_MAX_ALLOWED >+ pre-processor symbol. >+ >+ This allows generating code that can be compiled in projects that wish >+ to use an older API version of GLib through the use of the >+ GLIB_VERSION_MAX_ALLOWED symbol. >+ >+ https://bugzilla.gnome.org/show_bug.cgi?id=710133 >+ >+diff --git a/gio/gdbus-2.0/codegen/codegen.py b/gio/gdbus-2.0/codegen/codegen.py >+index 3a3af43..1789cb3 100644 >+--- a/gio/gdbus-2.0/codegen/codegen.py >++++ b/gio/gdbus-2.0/codegen/codegen.py >+@@ -1570,7 +1570,9 @@ class CodeGenerator: >+ self.c.write('static void %s_proxy_iface_init (%sIface *iface);\n' >+ '\n'%(i.name_lower, i.camel_name)) >+ self.c.write('G_DEFINE_TYPE_WITH_CODE (%sProxy, %s_proxy, G_TYPE_DBUS_PROXY,\n'%(i.camel_name, i.name_lower)) >++ self.c.write('#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38\n') >+ self.c.write(' G_ADD_PRIVATE (%sProxy)\n'%(i.camel_name)) >++ self.c.write('#endif\n') >+ self.c.write(' G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_proxy_iface_init));\n\n'%(i.ns_upper, i.name_upper, i.name_lower)) >+ >+ # finalize >+@@ -1795,12 +1797,17 @@ class CodeGenerator: >+ self.c.write('static void\n' >+ '%s_proxy_init (%sProxy *proxy)\n' >+ '{\n' >++ '#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38\n' >+ ' proxy->priv = %s_proxy_get_instance_private (proxy);\n' >++ '#else\n' >++ ' proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, %sTYPE_%s_PROXY, %sProxyPrivate);\n' >++ '#endif\n\n' >+ ' g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), %s_interface_info ());\n' >+ '}\n' >+ '\n' >+ %(i.name_lower, i.camel_name, >+ i.name_lower, >++ i.ns_upper, i.name_upper, i.camel_name, >+ i.name_lower)) >+ self.c.write('static void\n' >+ '%s_proxy_class_init (%sProxyClass *klass)\n' >+@@ -1819,8 +1826,10 @@ class CodeGenerator: >+ '\n'%(i.name_lower, i.camel_name, >+ i.name_lower, i.name_lower, i.name_lower, i.name_lower, i.name_lower)) >+ if len(i.properties) > 0: >+- self.c.write('\n' >+- ' %s_override_properties (gobject_class, 1);\n'%(i.name_lower)) >++ self.c.write(' %s_override_properties (gobject_class, 1);\n\n'%(i.name_lower)) >++ self.c.write('#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38\n' >++ ' g_type_class_add_private (klass, sizeof (%sProxyPrivate));\n' >++ '#endif\n'%(i.camel_name)) >+ self.c.write('}\n' >+ '\n') >+ >+@@ -2339,7 +2348,9 @@ class CodeGenerator: >+ %(i.name_lower, i.camel_name)) >+ >+ self.c.write('G_DEFINE_TYPE_WITH_CODE (%sSkeleton, %s_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,\n'%(i.camel_name, i.name_lower)) >++ self.c.write('#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38\n') >+ self.c.write(' G_ADD_PRIVATE (%sSkeleton)\n'%(i.camel_name)) >++ self.c.write('#endif\n') >+ self.c.write(' G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_skeleton_iface_init));\n\n'%(i.ns_upper, i.name_upper, i.name_lower)) >+ >+ # finalize >+@@ -2533,9 +2544,14 @@ class CodeGenerator: >+ self.c.write('static void\n' >+ '%s_skeleton_init (%sSkeleton *skeleton)\n' >+ '{\n' >++ '#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38\n' >+ ' skeleton->priv = %s_skeleton_get_instance_private (skeleton);\n' >++ '#else\n' >++ ' skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, %sTYPE_%s_SKELETON, %sSkeletonPrivate);\n' >++ '#endif\n\n' >+ %(i.name_lower, i.camel_name, >+- i.name_lower)) >++ i.name_lower, >++ i.ns_upper, i.name_upper, i.camel_name)) >+ self.c.write(' g_mutex_init (&skeleton->priv->lock);\n') >+ self.c.write(' skeleton->priv->context = g_main_context_ref_thread_default ();\n') >+ if len(i.properties) > 0: >+@@ -2587,6 +2603,12 @@ class CodeGenerator: >+ self.c.write(' skeleton_class->get_properties = %s_skeleton_dbus_interface_get_properties;\n'%(i.name_lower)) >+ self.c.write(' skeleton_class->flush = %s_skeleton_dbus_interface_flush;\n'%(i.name_lower)) >+ self.c.write(' skeleton_class->get_vtable = %s_skeleton_dbus_interface_get_vtable;\n'%(i.name_lower)) >++ >++ self.c.write('\n' >++ '#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38\n' >++ ' g_type_class_add_private (klass, sizeof (%sSkeletonPrivate));\n' >++ '#endif\n'%(i.camel_name)) >++ >+ self.c.write('}\n' >+ '\n') >+ >+@@ -3370,4 +3392,5 @@ class CodeGenerator: >+ if self.generate_objmanager: >+ self.generate_object() >+ self.generate_object_manager_client() >++ >+ self.generate_outro() >+diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am >+index e1ef22a..758ac17 100644 >+--- a/gio/tests/Makefile.am >++++ b/gio/tests/Makefile.am >+@@ -350,6 +350,7 @@ test_programs += \ >+ gdbus-proxy-threads \ >+ gdbus-proxy-well-known-name \ >+ gdbus-test-codegen \ >++ gdbus-test-codegen-old \ >+ gdbus-threading \ >+ gmenumodel \ >+ $(NULL) >+@@ -373,9 +374,12 @@ gdbus_proxy_SOURCES = $(gdbus_sessionbus_sources) gdbus-pro >+ gdbus_proxy_threads_SOURCES = $(gdbus_sessionbus_sources) gdbus-proxy-threads.c >+ gdbus_proxy_well_known_name_SOURCES = $(gdbus_sessionbus_sources) gdbus-proxy-well-known-name.c >+ gdbus_test_codegen_SOURCES = $(gdbus_sessionbus_sources) gdbus-test-codegen.c >++nodist_gdbus_test_codegen_SOURCES = gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h >++gdbus_test_codegen_old_SOURCES = $(gdbus_sessionbus_sources) gdbus-test-codegen.c >++nodist_gdbus_test_codegen_old_SOURCES = gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h >++gdbus_test_codegen_old_CPPFLAGS = $(AM_CPPFLAGS) -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36 >+ gdbus_threading_SOURCES = $(gdbus_sessionbus_sources) gdbus-threading.c >+ gmenumodel_SOURCES = $(gdbus_sessionbus_sources) gmenumodel.c >+-nodist_gdbus_test_codegen_SOURCES = gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h >+ >+ gdbus-test-codegen.o: gdbus-test-codegen-generated.h >+ gdbus-test-codegen-generated.h gdbus-test-codegen-generated.c: test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen >-- >1.8.5.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1082455
: 880578