Bug 1421337

Summary: GCC 7 error in compile fuse-encfs
Product: [Fedora] Fedora Reporter: Vasiliy Glazov <vascom2>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: davejohansen, jakub, jwakely, law, mpolacek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-21 06:35:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vasiliy Glazov 2017-02-11 07:09:00 UTC
Description of problem:
During F26 MassRebuild I has an GCC error

/usr/include/c++/7/bits/shared_ptr_base.h: In instantiation of 'std::__shared_ptr<_Tp, _Lp>::__shared_ptr(_Yp*, _Deleter) [with _Yp = encfs::NullKey; _Deleter = encfs::NullDestructor; <template-parameter-2-3> = void; _Tp = encfs::AbstractCipherKey; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]':
/usr/include/c++/7/bits/shared_ptr.h:147:37:   required from 'std::shared_ptr<_Tp>::shared_ptr(_Yp*, _Deleter) [with _Yp = encfs::NullKey; _Deleter = encfs::NullDestructor; <template-parameter-2-3> = void; _Tp = encfs::AbstractCipherKey]'
/builddir/build/BUILD/encfs-1.9.1/encfs/NullCipher.cpp:65:76:   required from here
/usr/include/c++/7/bits/shared_ptr_base.h:1088:4: error: static assertion failed: deleter expression d(p) is well-formed
    static_assert(__is_callable<_Deleter(_Yp*)>::value,
    ^~~~~~~~~~~~~

Version-Release number of selected component (if applicable):
Full build log https://kojipkgs.fedoraproject.org//work/tasks/4785/17724785/build.log
GCC 7.0.1-0.6.fc26
All logs https://koji.fedoraproject.org/koji/taskinfo?taskID=17724785

How reproducible:
Always

Steps to Reproduce:
1.Just build fuse-encfs

May it be bug in GCC?

Comment 1 Jonathan Wakely 2017-02-11 20:12:15 UTC
Yes, it's a GCC 7 bug, I've created an upstream bug to track it and will fix it tomorrow.

As a workaround until the fix is in rawhide:

--- encfs-1.9.1/encfs/NullCipher.cpp.orig       2017-02-11 20:11:15.792159253 +0000
+++ encfs-1.9.1/encfs/NullCipher.cpp    2017-02-11 20:11:20.893130796 +0000
@@ -60,7 +60,7 @@
   ~NullDestructor() {}
 
   NullDestructor &operator=(const NullDestructor &) { return *this; }
-  void operator()(NullKey *&) {}
+  void operator()(NullKey *) {}
 };
 std::shared_ptr<AbstractCipherKey> gNullKey(new NullKey(), NullDestructor());
 

(There's no reason at all for that code to use a reference, it's a bit weird, which is why nobody noticed this bug before.)

Comment 2 Jonathan Wakely 2017-02-11 21:12:08 UTC
Upstream GCC is fixed now.

Comment 3 Vasiliy Glazov 2017-02-15 07:18:40 UTC
Can you update gcc in rawhide with this fix?