Rawtherapee: Build with libsigc++ 2.3.1 broken

Created on 11 Dec 2017  路  24Comments  路  Source: Beep6581/RawTherapee

Here's the log:

https://build.opensuse.org/public/build/home:rawtherapee/openSUSE_Leap_42.1/i586/rawtherapee-unstable/_log

I have no clue what's going wrong there. @Floessie Do you have an idea?

Most helpful comment

@mbajor Marcin, here's a patch that should work:

diff --git a/rtgui/exifpanel.cc b/rtgui/exifpanel.cc
index cd054e7a..16810680 100644
--- a/rtgui/exifpanel.cc
+++ b/rtgui/exifpanel.cc
@@ -46,11 +46,7 @@ ExifPanel::ExifPanel () : idata (nullptr)
     exifTreeModel = Gtk::TreeStore::create (exifColumns);
     exifTree->set_model (exifTreeModel);
     exifTree->set_grid_lines (Gtk::TREE_VIEW_GRID_LINES_NONE);
-    exifTree->set_row_separator_func (
-    [&] (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator & row)-> bool {
-        return row->get_value (exifColumns.isSeparator);
-    }
-    );
+    exifTree->set_row_separator_func (sigc::mem_fun(*this, &ExifPanel::rowSeperatorFunc));

     delicon = RTImage::createFromFile ("gtk-close.png");
     keepicon = RTImage::createFromFile ("gtk-apply.png");
@@ -540,6 +536,11 @@ void ExifPanel::showAlltoggled ()
     setImageData (idata);
 }

+bool ExifPanel::rowSeperatorFunc(const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator& iter)
+{
+    return iter->get_value(exifColumns.isSeparator);
+}
+
 void ExifPanel::editTag (Gtk::TreeModel::Children root, Glib::ustring name, Glib::ustring value)
 {

diff --git a/rtgui/exifpanel.h b/rtgui/exifpanel.h
index b9d76f25..5121eff4 100644
--- a/rtgui/exifpanel.h
+++ b/rtgui/exifpanel.h
@@ -93,6 +93,7 @@ private:
     void resetAllPressed();
     void addPressed();
     void showAlltoggled();
+    bool rowSeperatorFunc(const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator& iter);

 public:
     ExifPanel ();

@Hombre57

Was the problem forecastable ? It worked fine so far and TBH, I copy/pasted this code from a lambda forum.

No, not really. We lowered our requirements for libsigc++ to 2.3.1 when there were no such lambdas. And 2.3.1 doesn't seem to support lambdas with return values. This must have been introduced sometime later. So we couldn't catch that problem with our build systems, as we use newer libsigc++s.

@Beep6581 When we phase out libsigc++ 2.3.1 in the future, we should turn that place into a lambda again (but not with the catch-all [&] but [this]).

HTH,
Fl枚ssie

All 24 comments

@heckflosse Looking...

[   83s] /home/abuild/rpmbuild/BUILD/rawtherapee-unstable-5.3~git.20171211.280.g4cc78611/rtexif/rtexif.cc:1674:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
[   83s]      for (size_t i = 0; i < std::min<int>(maxcount, valuesize - ofs); i++) {

Wait, what? 馃槙

[  102s] /home/abuild/rpmbuild/BUILD/rawtherapee-unstable-5.3~git.20171211.280.g4cc78611/rtexif/canonattribs.cc: In constructor 'rtexif::CALensInterpreter::CALensInterpreter()':
[  102s] /home/abuild/rpmbuild/BUILD/rawtherapee-unstable-5.3~git.20171211.280.g4cc78611/rtexif/canonattribs.cc:556:5: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
[  102s]      CALensInterpreter ()

I'll have a look at this one in the next days.

[  189s] /home/abuild/rpmbuild/BUILD/rawtherapee-unstable-5.3~git.20171211.280.g4cc78611/rtengine/lcp.cc: In member function 'void rtengine::LCPProfile::calcParams(rtengine::LCPCorrectionMode, float, float, float, rtengine::LCPModelCommon*, rtengine::LCPModelCommon*, rtengine::LCPModelCommon*) const':
[  189s] /home/abuild/rpmbuild/BUILD/rawtherapee-unstable-5.3~git.20171211.280.g4cc78611/rtengine/lcp.cc:423:33: warning: 'meanErr' may be used uninitialized in this function [-Wmaybe-uninitialized]
[  189s]                                  && highMeanErr > meanErr

Here, too.

[  234s] /home/abuild/rpmbuild/BUILD/rawtherapee-unstable-5.3~git.20171211.280.g4cc78611/rtengine/procparams.cc: In member function 'int rtengine::procparams::ProcParams::save(const Glib::ustring&, const Glib::ustring&, bool, ParamsEdited*)':
[  234s] /home/abuild/rpmbuild/BUILD/rawtherapee-unstable-5.3~git.20171211.280.g4cc78611/rtengine/procparams.cc:2662:5: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
[  234s]  int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bool fnameAbsolute, ParamsEdited* pedited)

And here, too.

[  331s] /usr/include/sigc++-2.0/sigc++/functors/slot.h: In instantiation of 'static T_return sigc::internal::slot_call2<T_functor, T_return, T_arg1, T_arg2>::call_it(sigc::internal::slot_rep*, typename sigc::type_trait<T_arg3>::take, typename sigc::type_trait<T_arg4>::take) [with T_functor = ExifPanel::ExifPanel()::<lambda(const Glib::RefPtr<Gtk::TreeModel>&, const iterator&)>; T_return = bool; T_arg1 = const Glib::RefPtr<Gtk::TreeModel>&; T_arg2 = const Gtk::TreeIter&; typename sigc::type_trait<T_arg3>::take = const Glib::RefPtr<Gtk::TreeModel>&; typename sigc::type_trait<T_arg4>::take = const Gtk::TreeIter&]':
[  331s] /usr/include/sigc++-2.0/sigc++/functors/slot.h:180:37:   required from 'static void* (* sigc::internal::slot_call2<T_functor, T_return, T_arg1, T_arg2>::address())(void*) [with T_functor = ExifPanel::ExifPanel()::<lambda(const Glib::RefPtr<Gtk::TreeModel>&, const iterator&)>; T_return = bool; T_arg1 = const Glib::RefPtr<Gtk::TreeModel>&; T_arg2 = const Gtk::TreeIter&; sigc::internal::hook = void* (*)(void*)]'
[  331s] /usr/include/sigc++-2.0/sigc++/functors/slot.h:607:98:   required from 'sigc::slot2<T_return, T_arg1, T_arg2>::slot2(const T_functor&) [with T_functor = ExifPanel::ExifPanel()::<lambda(const Glib::RefPtr<Gtk::TreeModel>&, const iterator&)>; T_return = bool; T_arg1 = const Glib::RefPtr<Gtk::TreeModel>&; T_arg2 = const Gtk::TreeIter&]'
[  331s] /usr/include/sigc++-2.0/sigc++/functors/slot.h:1184:26:   required from 'sigc::slot<T_return, T_arg1, T_arg2, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::slot(const T_functor&) [with T_functor = ExifPanel::ExifPanel()::<lambda(const Glib::RefPtr<Gtk::TreeModel>&, const iterator&)>; T_return = bool; T_arg1 = const Glib::RefPtr<Gtk::TreeModel>&; T_arg2 = const Gtk::TreeIter&]'
[  331s] /home/abuild/rpmbuild/BUILD/rawtherapee-unstable-5.3~git.20171211.280.g4cc78611/rtgui/exifpanel.cc:53:5:   required from here
[  331s] /usr/include/sigc++-2.0/sigc++/functors/slot.h:173:25: error: void value not ignored as it ought to be
[  331s]                 (a_1, a_2);
[  331s]                          ^

I don't see a void result here, but later on the type deduction fails. Maybe we should be a bit more explicit about the lamba return type:

diff --git a/rtgui/exifpanel.cc b/rtgui/exifpanel.cc
index da2659a4..826b2dd7 100644
--- a/rtgui/exifpanel.cc
+++ b/rtgui/exifpanel.cc
@@ -47,7 +47,7 @@ ExifPanel::ExifPanel () : idata (nullptr)
     exifTree->set_model (exifTreeModel);
     exifTree->set_grid_lines (Gtk::TREE_VIEW_GRID_LINES_NONE);
     exifTree->set_row_separator_func (
-    [&] (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator & row) {
+    [this] (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator & row) -> bool {
         return row->get_value (exifColumns.isSeparator);
     }
     );

HTH,
Fl枚ssie

@Floessie Shall I commit your patch?

@Floessie

Wait, what? 馃槙

I saw this too. I can fix it using

std::min(static_cast<int>(maxcount), valuesize - ofs)

Shall I commit your patch?

Maybe @mbajor could test it first? It's a shot in the dark after all...

I saw this too. I can fix it using std::min(static_cast<int>(maxcount), valuesize - ofs)

But that's crazy. std::min() is supposed to be

template<class T>
const T& min(const T& a, const T& b);

What's wrong with this GCC 5.2? In the log file I saw a 4.8 getting installed as well, that could be the crux.

Best,
Fl枚ssie

[ 83s] /home/abuild/rpmbuild/BUILD/rawtherapee-unstable-5.3~git.20171211.280.g4cc78611/rtexif/rtexif.cc:1674:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
[ 83s] for (size_t i = 0; i < std::min<int>(maxcount, valuesize - ofs); i++) {

Wait, what? :confused:

@Floessie why are you confused? the code is comparing a size_t i (unsigned) to the result of std::min (signed)... seems a perfectly fine warning to me... Or maybe I misunderstdood your comment?

@agriggio Alberto, you opened my eyes! And now I see, it wasn't introduced by my advise. 馃槍

@heckflosse Both i586 and x86_64 builds fail with this error on openSUSE Leap 42.1
Tested with @Floessie patch. Error still occurs.

--- rtgui/exifpanel.cc.orig 2017-10-23 23:00:12.000000000 +0200
+++ rtgui/exifpanel.cc  2017-12-13 17:13:19.244091992 +0100
@@ -47,7 +47,7 @@
     exifTree->set_model (exifTreeModel);
     exifTree->set_grid_lines (Gtk::TREE_VIEW_GRID_LINES_NONE);
     exifTree->set_row_separator_func (
-    [&] (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator & row) {
+    [this] (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator & row) -> bool {
         return row->get_value (exifColumns.isSeparator);
     }
     );

openSUSE Leap 42.1 has been released in 2015 and I think we can abandon support it. @Beep6581 What you think?

End of life for 42.1 was in May 2017. It would be nice if this was fixable, but it's not something to worry about if its not.

@mbajor Thanks for testing. @Beep6581 Obviously row->get_value (exifColumns.isSeparator) doesn't return the expected bool in Marcin's case (but a void). Maybe we can work around it, but that will mean digging much deeper for me. Maybe @Hombre57 has a quick clue, what's going on.

@heckflosse @Floessie @mbajor The compiler doesn't seem to understand that Gtk::TreeModelColumn<bool> is a bool and then return void.

Should be fixed in commit b8ff7c4f7d9fca5b0b9c41d6f9e27e9bb5fa5de2 , could you confirm ?

Obviously

:rofl:

@Hombre57 Your change is basically the same that I tried (and failed with). I haven't looked into this row->get_value() thing yet, but there must be something odd with Marcin's compiler. Maybe we can work around it by using a classic callback?

@Beep6581

Obviously
馃ぃ

Reading template substitution errors is a PITA. C++17 C++20 concepts will cure that (hopefully).

@Hombre57 Error still exists in latest build 5.3~git.20171214.293.g1854147c
https://build.opensuse.org/public/build/home:rawtherapee/openSUSE_Leap_42.1/x86_64/rawtherapee-unstable/_log

Looking through the history of that line I found out, it was always implemented as a lambda.

@mbajor Is this a new error, or are you trying to build for openSUSE Leap 42.1 for the first time? I see, your latest build is x86_64, so it's not dependent on architecture but maybe on the GTK sigc++ version. If not building for 42.1 the first time, what was the GTK3 sigc++ version that used to work and what is the latest?

@Hombre57 Here's a related problem report.

sigc::slot cannot be constructed with functors returning a value, except with the functors defined in libsigc++.

Can you make sense of it?

@Floessie As I mentioned above the same error is on i586 and x86_64 openSUSE Leap 42.1.

It is not first build for openSUSE Leap 42.1.
Latest build with success is 5.3~git.20171009.9.g1fdc2d7b.
I'm not able to get latest success log so I don't know which version of GTK was used.

@Floessie I've created branch of OBS rev 26.
https://build.opensuse.org/package/show/home:marcinbajor:branches:home:rawtherapee/rawtherapee-unstable
This is latest OBS revision without errors for openSUSE Leap 42.1. This revision contains RT 5.3~git.20171009.9.g1fdc2d7b.

5.3~git.20171009.9.g1fdc2d7b builds with success on current build enviroment.
https://build.opensuse.org/public/build/home:marcinbajor:branches:home:rawtherapee/openSUSE_Leap_42.1/i586/rawtherapee-unstable/_log
https://build.opensuse.org/public/build/home:marcinbajor:branches:home:rawtherapee/openSUSE_Leap_42.1/x86_64/rawtherapee-unstable/_log

The same build enviroment is used for latest source of RT (but fails).

5.3~git.20171023.69.g8c328caf is next version which was built after 5.3~git.20171009.9.g1fdc2d7b and failed.

Meanwhile I've set up a VM and can reproduce the problem. A git bisect reveals ae19b6485a2078cb9e431089ce5f7680e1f3d265 as the problematic commit, which isn't a surprise. 馃槈

I think, I found a solution. Stay tuned, this machine isn't that fast...

@Floessie Was the problem forecastable ? It worked fine so far and TBH, I copy/pasted this code from a lambda forum.

@mbajor Marcin, here's a patch that should work:

diff --git a/rtgui/exifpanel.cc b/rtgui/exifpanel.cc
index cd054e7a..16810680 100644
--- a/rtgui/exifpanel.cc
+++ b/rtgui/exifpanel.cc
@@ -46,11 +46,7 @@ ExifPanel::ExifPanel () : idata (nullptr)
     exifTreeModel = Gtk::TreeStore::create (exifColumns);
     exifTree->set_model (exifTreeModel);
     exifTree->set_grid_lines (Gtk::TREE_VIEW_GRID_LINES_NONE);
-    exifTree->set_row_separator_func (
-    [&] (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator & row)-> bool {
-        return row->get_value (exifColumns.isSeparator);
-    }
-    );
+    exifTree->set_row_separator_func (sigc::mem_fun(*this, &ExifPanel::rowSeperatorFunc));

     delicon = RTImage::createFromFile ("gtk-close.png");
     keepicon = RTImage::createFromFile ("gtk-apply.png");
@@ -540,6 +536,11 @@ void ExifPanel::showAlltoggled ()
     setImageData (idata);
 }

+bool ExifPanel::rowSeperatorFunc(const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator& iter)
+{
+    return iter->get_value(exifColumns.isSeparator);
+}
+
 void ExifPanel::editTag (Gtk::TreeModel::Children root, Glib::ustring name, Glib::ustring value)
 {

diff --git a/rtgui/exifpanel.h b/rtgui/exifpanel.h
index b9d76f25..5121eff4 100644
--- a/rtgui/exifpanel.h
+++ b/rtgui/exifpanel.h
@@ -93,6 +93,7 @@ private:
     void resetAllPressed();
     void addPressed();
     void showAlltoggled();
+    bool rowSeperatorFunc(const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator& iter);

 public:
     ExifPanel ();

@Hombre57

Was the problem forecastable ? It worked fine so far and TBH, I copy/pasted this code from a lambda forum.

No, not really. We lowered our requirements for libsigc++ to 2.3.1 when there were no such lambdas. And 2.3.1 doesn't seem to support lambdas with return values. This must have been introduced sometime later. So we couldn't catch that problem with our build systems, as we use newer libsigc++s.

@Beep6581 When we phase out libsigc++ 2.3.1 in the future, we should turn that place into a lambda again (but not with the catch-all [&] but [this]).

HTH,
Fl枚ssie

@Floessie Fixed, thank you!

Fine, I'll push tonight.

Was this page helpful?
0 / 5 - 0 ratings