Re: Fedora mass rebuild 2017

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 15/02/17 12:32 +0000, Jonathan Wakely wrote:
On 15/02/17 11:30 +0000, Jonathan Wakely wrote:
On 14/02/17 21:42 -0500, Orcan Ogetbil wrote:
On 7 February 2017 at 16:32, Marek Polacek  wrote:
libffado-2.3.0-1.fc26.src.rpm
sflphone-1.4.1-20.fc26.src.rpm
      error: no matching function for call to ...
      Invalid code.

I am 99% sure that these 2 errors are due to a bug in dbus-c++. Is the
new compiler attempting to compile (or verify) code in template
classes even if they are not initialized?

Yes, exactly. Previously GCC was fairly forgiving about broken
template code and would check almost nothing until the template was
instantiated. In more recent releases parts of the template which
don't depend on the template arguments get checked earlier. Clang has
been doing this for some time, but it's a more recent change for GCC.

I suspect that there is
broken code in the Threading class.

The standard says such code is ill-formed, but that no diagnostic is
required i.e. the compiler is allowed to diagnose the problem, but not
required to (because it could be expensive or difficult to check for
some compilers). So the code was always broken, but now GCC tells you
about it.




log:
-----
usr/include/dbus-c++-1/dbus-c++/dispatcher.h:262:5: error: no matching
function for call to '_init_threading(DBus::Mutex* (&)(), void
(&)(DBus::Mutex*), void (&)(DBus::Mutex*), void (&)(DBus::Mutex*),
DBus::CondVar* (&)(), void (&)(DBus::CondVar*), void
(&)(DBus::CondVar*, DBus::Mutex*), bool (&)(DBus::CondVar*,
DBus::Mutex*, int), void (&)(DBus::CondVar*), void
(&)(DBus::CondVar*))'
  );
  ^
/usr/include/dbus-c++-1/dbus-c++/dispatcher.h:247:13: note: candidate:
void DBus::_init_threading()
void DXXAPI _init_threading();
          ^~~~~~~~~~~~~~~
/usr/include/dbus-c++-1/dbus-c++/dispatcher.h:247:13: note:
candidate expects 0 arguments, 10 provided
/usr/include/dbus-c++-1/dbus-c++/dispatcher.h:249:13: note: candidate:
void DBus::_init_threading(DBus::MutexNewFn, DBus::MutexFreeFn,
DBus::MutexLockFn, DBus::MutexUnlockFn, DBus::CondVarNewFn,
DBus::CondVarFreeFn, DBus::CondVarWaitFn, DBus::CondVarWaitTimeoutFn,
DBus::CondVarWakeOneFn, DBus::CondVarWakeAllFn) <near match>
void DXXAPI _init_threading(
          ^~~~~~~~~~~~~~~
/usr/include/dbus-c++-1/dbus-c++/dispatcher.h:249:13: note:
conversion of argument 3 would be ill-formed:
-----

see:
http://dbus-cplusplus.sourceforge.net/dispatcher_8h_source.html

The types MutexLockFn and MutexFreeFn depend on a macro:

#ifndef DBUS_HAS_RECURSIVE_MUTEX
typedef bool (*MutexFreeFn)(Mutex *mx);
typedef bool (*MutexLockFn)(Mutex *mx);
#else
typedef void (*MutexFreeFn)(Mutex *mx);
typedef void (*MutexLockFn)(Mutex *mx);
#endif//DBUS_HAS_RECURSIVE_MUTEX

But the type of the functions passed to _init_threading is always the
same:

static void mutex_free(Mutex *mx)
{
  delete mx;
}

static void mutex_lock(Mutex *mx)
{
  mx->lock();
}

That certainly looks suspicious.

More than suspicious. The DBus API docs at
https://dbus.freedesktop.org/doc/api/html/group__DBusThreads.html
seem to say that the MutexFreeFn should always return void (for the
recursive and non-recursive versions) but it depends on
DBUS_HAS_RECURSIVE_MUTEX here. MutexUnlockFn should depend on
DBUS_HAS_RECURSIVE_MUTEX, but is always the same type here.

Worse, the functions in the C++ API return bool, but the functions in
the C API return dbus_bool_t which is a typedef for dbus_uint32_t, so
the types don't match and calling them is undefined.

It looks like dbus-c++ is abandoned though, the upstream repo was at
gitorious.org which is gone.

Nothing in dbus-c++ or libffado or sflphone uses the broken code in
dbus-c++ so it looks like it can just be commented out. See the
attached patch, which I'm testing now.

diff --git a/dbus-c++-threading.patch b/dbus-c++-threading.patch
new file mode 100644
index 0000000..c4fafef
--- /dev/null
+++ b/dbus-c++-threading.patch
@@ -0,0 +1,45 @@
+--- libdbus-c++-0.9.0/include/dbus-c++/dispatcher.h.threading	2017-02-15 13:40:53.796004263 +0000
++++ libdbus-c++-0.9.0/include/dbus-c++/dispatcher.h	2017-02-15 13:40:46.907000493 +0000
+@@ -188,6 +188,7 @@
+ /* classes for multithreading support
+ */
+ 
++#if 0
+ class DXXAPI Mutex
+ {
+ public:
+@@ -243,9 +244,11 @@
+ typedef bool (*CondVarWaitTimeoutFn)(CondVar *cv, Mutex *mx, int timeout);
+ typedef void (*CondVarWakeOneFn)(CondVar *cv);
+ typedef void (*CondVarWakeAllFn)(CondVar *cv);
++#endif
+ 
+ void DXXAPI _init_threading();
+ 
++#if 0
+ void DXXAPI _init_threading(
+   MutexNewFn, MutexFreeFn, MutexLockFn, MutexUnlockFn,
+   CondVarNewFn, CondVarFreeFn, CondVarWaitFn, CondVarWaitTimeoutFn, CondVarWakeOneFn, CondVarWakeAllFn
+@@ -312,6 +315,7 @@
+     cv->wake_all();
+   }
+ };
++#endif
+ 
+ } /* namespace DBus */
+ 
+--- libdbus-c++-0.9.0/src/dispatcher.cpp.threading	2017-02-15 13:48:22.627249868 +0000
++++ libdbus-c++-0.9.0/src/dispatcher.cpp	2017-02-15 13:48:29.164253445 +0000
+@@ -253,6 +253,7 @@
+ #endif//DBUS_HAS_THREADS_INIT_DEFAULT
+ }
+ 
++#if 0
+ void DBus::_init_threading(
+   MutexNewFn m1,
+   MutexFreeFn m2,
+@@ -318,3 +319,4 @@
+ #endif//DBUS_HAS_RECURSIVE_MUTEX
+   dbus_threads_init(&functions);
+ }
++#endif
diff --git a/dbus-c++.spec b/dbus-c++.spec
index 21903f4..c7e83cf 100644
--- a/dbus-c++.spec
+++ b/dbus-c++.spec
@@ -1,6 +1,6 @@
 Name:          dbus-c++
 Version:       0.9.0
-Release:       12%{?dist}
+Release:       13%{?dist}
 Summary:       Native C++ bindings for D-Bus
 
 Group:         System Environment/Libraries
@@ -13,6 +13,8 @@ Patch2: dbus-c++-linkfix.patch
 # Fix collision between macro bind_property in dbus-c++/interface.h and method
 # bind_property in glibmm/binding.h
 Patch3: dbus-c++-macro_collision.patch
+# Remove broken classes for multithreading support
+Patch4: dbus-c++-threading.patch
 
 BuildRequires: dbus-devel
 BuildRequires: glib2-devel
@@ -56,6 +58,7 @@ sed -i 's/libtoolize --force --copy/libtoolize -if --copy/' bootstrap
 %patch1 -p1 -b .gcc47
 %patch2 -p1 -b .linkfix
 %patch3 -p1 -b .collision
+%patch4 -p1 -b .threading
 
 %build
 ./autogen.sh
@@ -93,6 +96,9 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
 %{_libdir}/pkgconfig/*
 
 %changelog
+* Wed Feb 15 2017 Jonathan Wakely <jwakely@xxxxxxxxxx> - 0.9.0-13
+- Remove broken multi-threading support that doesn't build with GCC 7
+
 * Fri Feb 10 2017 Fedora Release Engineering <releng@xxxxxxxxxxxxxxxxx> - 0.9.0-12
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
 
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux