Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 786459

Summary: sys-fs/cryfs: fails to compile against gcc11 (error: use of deleted function >‘cpputils::Data::Data(const cpputils::Data&)’)
Product: Gentoo Linux Reporter: Marco Scardovi (scardracs) <mscardovi>
Component: Current packagesAssignee: Nick <nickAristocrates>
Status: RESOLVED FIXED    
Severity: normal CC: admnd, ao, b.buschinski, captaincrutches, kdvgent, kilgorephotoshop, leonchik1976, m.debruijne, mscardovi, proxy-maint, sam, silvio.gerli
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=789366
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 732706    
Attachments: emerge log
emerge --info '=sys-fs/cryfs-0.10.2::gentoo'
patch

Description Marco Scardovi (scardracs) 2021-04-28 14:38:59 UTC
When you run an update of cryfs it will always fail at steps 106/188 and 107/188, no matter if you use O2/O3 and/or -j1 or another value

Reproducible: Always

Steps to Reproduce:
1. sudo emerge -av1 sys-fs/cryfs
Actual Results:  
Fails

Expected Results:  
Upgrade
Comment 1 Marco Scardovi (scardracs) 2021-04-28 14:40:41 UTC
Created attachment 703257 [details]
emerge log
Comment 2 Marco Scardovi (scardracs) 2021-04-28 14:41:21 UTC
(In reply to Marco Scardovi from comment #1)
> Created attachment 703257 [details]
> emerge --info

Sorry, emerge log
Comment 3 Marco Scardovi (scardracs) 2021-04-28 14:43:29 UTC
Created attachment 703260 [details]
emerge --info '=sys-fs/cryfs-0.10.2::gentoo'
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-04-28 19:48:39 UTC
>../src/blobstore/implementations/onblocks/parallelaccessdatatreestore/../datatreestor>e/../datanodestore/DataNodeView.h:86:33: error: use of deleted function >‘cpputils::Data::Data(const cpputils::Data&)’
>   86 |     cpputils::Data serialized = _serialize(layout, formatVersion, depth, >size, std::move(data));
Comment 5 Marco Scardovi (scardracs) 2021-04-29 04:44:00 UTC
Side note: changing optimization's flags is useless as it is forcing O3 by default
Comment 6 Drew W 2021-04-29 08:04:30 UTC
Adding USE="custom-optimization" will force this package to use what you've set in make.conf, but that doesn't fix this issue. Compiling sys-fs/cryfs with clang seems to resolve this specific issue, though I can't say that won't introduce other issues down the line.
Comment 7 Marco Scardovi (scardracs) 2021-04-29 08:30:54 UTC
(In reply to Drew W from comment #6)
> Adding USE="custom-optimization" will force this package to use what you've
> set in make.conf, but that doesn't fix this issue. Compiling sys-fs/cryfs
> with clang seems to resolve this specific issue, though I can't say that
> won't introduce other issues down the line.

I can understand that thing if a program is known to breaks setting an higher O flag but forcing an higher flag than the one suggested by gcc shouldn't be normal, in my mind
Comment 8 Joshua Reed 2021-04-30 03:26:49 UTC
(In reply to Drew W from comment #6)
> Adding USE="custom-optimization" will force this package to use what you've
> set in make.conf, but that doesn't fix this issue. Compiling sys-fs/cryfs
> with clang seems to resolve this specific issue, though I can't say that
> won't introduce other issues down the line.

I can confirm compiling this package with clang resolved the issue for me too.
Comment 9 Stephan Hartmann (RETIRED) gentoo-dev 2021-04-30 13:33:02 UTC
Looks like a simple name clash to me:

...
error: macro "_serialize" passed 5 arguments, but takes just 0
...
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/serializeintrin.h:37: note: macro "_serialize" defined here
   37 | #define _serialize()    __builtin_ia32_serialize ()
...

So GCC-11 has defined macro _serialize() now. Just adding namespace to _serialize inside DataNodeView.h should solve this, e.g. DataNodeView::_serialize().
Comment 10 Stephan Hartmann (RETIRED) gentoo-dev 2021-04-30 15:17:55 UTC
Created attachment 704547 [details, diff]
patch

Adding namespace is not enough, because _serialize is a macro in gcc. Attached patch fixes cryfs, but I guess it would be better to rename _serialize in cryfs.
Comment 11 Ferry 2021-05-03 18:55:20 UTC
Had the same issue, was failing at 113/188 here though.

Put the patch file in /etc/portage/patches/sys-fs/cryfs-0.10.2/cryfs.patch

Builds fine now. Thanks
Comment 12 Barry Schwartz 2021-05-05 13:10:15 UTC
(In reply to Stephan Hartmann from comment #10)
> Created attachment 704547 [details, diff] [details, diff]
> patch
> 
> Adding namespace is not enough, because _serialize is a macro in gcc.
> Attached patch fixes cryfs, but I guess it would be better to rename
> _serialize in cryfs.

IMO it is generally a bad idea to begin the name of an identifier with an underscore, unless you are writing system headers. I stick the underscore at the end, instead.

(I don’t know C++, but the C standard would reserve ‘_serialize’ for use as a file scope identifier. So not so bad. But I’d still call it ‘serialize_’.)
Comment 13 Barry Schwartz 2021-05-05 13:11:48 UTC
(In reply to Barry Schwartz from comment #12)
> (In reply to Stephan Hartmann from comment #10)
> > Created attachment 704547 [details, diff] [details, diff] [details, diff]
> > patch
> > 
> > Adding namespace is not enough, because _serialize is a macro in gcc.
> > Attached patch fixes cryfs, but I guess it would be better to rename
> > _serialize in cryfs.
> 
> IMO it is generally a bad idea to begin the name of an identifier with an
> underscore, unless you are writing system headers. I stick the underscore at
> the end, instead.
> 
> (I don’t know C++, but the C standard would reserve ‘_serialize’ for use as
> a file scope identifier. So not so bad. But I’d still call it ‘serialize_’.)

I forgot to say that the patch works for me, too.
Comment 14 Stephan Hartmann (RETIRED) gentoo-dev 2021-05-05 20:48:24 UTC
*** Bug 788403 has been marked as a duplicate of this bug. ***
Comment 15 Adrien Dessemond 2021-05-08 12:14:19 UTC
Same here. For your reference:

https://github.com/cryfs/cryfs/issues/389
Comment 16 Larry the Git Cow gentoo-dev 2021-05-10 10:54:39 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d938ca65dc367476475ef148fd20cb2cf1472f7

commit 3d938ca65dc367476475ef148fd20cb2cf1472f7
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-05-10 10:46:20 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-05-10 10:46:48 +0000

    sys-fs/cryfs: add GCC 11 patch
    
    (And fix the paths from PR which I hadn't staged...)
    
    Closes: https://bugs.gentoo.org/786459
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-fs/cryfs/cryfs-0.10.3.ebuild            |   7 +-
 sys-fs/cryfs/files/cryfs-0.10.3-gcc11.patch | 271 ++++++++++++++++++++++++++++
 2 files changed, 276 insertions(+), 2 deletions(-)