Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple definition of `HIST_isError' compiling against linux-5.16.1-gentoo kernel #12988

Closed
thehaven opened this issue Jan 19, 2022 · 15 comments · Fixed by #13209
Closed

multiple definition of `HIST_isError' compiling against linux-5.16.1-gentoo kernel #12988

thehaven opened this issue Jan 19, 2022 · 15 comments · Fixed by #13209
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)
Projects

Comments

@thehaven
Copy link

System information

Type Version/Name
Distribution Name Gentoo
Distribution Version Gentoo Base System release 2.8
Kernel Version linux-5.16.1-gentoo
Architecture x86_64
OpenZFS Version HEAD

Describe the problem you're observing

Compiling zfs HEAD inline against linux-5.16.1-gentoo gives the following build fail on make:

... SNIP ...
  AR      fs/zfs/zfs/built-in.a
  AR      fs/zfs/built-in.a
  AR      net/netfilter/built-in.a
  AR      fs/built-in.a
  AR      net/built-in.a
  AR      drivers/md/built-in.a
  AR      drivers/built-in.a
  GEN     .version
  CHK     include/generated/compile.h
  LD      vmlinux.o
ld: lib/zstd/compress/hist.o: in function `ERR_isError':
/usr/src/linux/lib/zstd/compress/../common/error_private.h:45: multiple definition of `HIST_isError'; fs/zfs/zstd/lib/zstd.o:/usr/src/linux/fs/zfs/zstd/lib/zstd.c:8103: first defined here
make: *** [Makefile:1161: vmlinux] Error 1

Describe how to reproduce the problem

ZFS build script located at:

@thehaven thehaven added the Type: Defect Incorrect behavior (e.g. crash, hang) label Jan 19, 2022
@rincebrain
Copy link
Contributor

5.16 is known to have a number of failures with even git tip, though this one is new and different. I would suggest using an older kernel until that changes.

@RinCat
Copy link

RinCat commented Mar 12, 2022

This one can also be reproduced in zfs-2.1.3 with 5.16 linux kernel.

ld.lld: error: duplicate symbol: HIST_isError
>>> defined at zstd.c:810 (fs/zfs/zstd/lib/zstd.c:810)
>>>            zfs/zstd/lib/zstd.o:(HIST_isError) in archive fs/built-in.a
>>> defined at error_private.h:45 (lib/zstd/compress/../common/error_private.h:45)
>>>            zstd/compress/hist.o:(.text+0x0) in archive lib/built-in.a
make: *** [Makefile:1161: vmlinux] Error 1

@rincebrain
Copy link
Contributor

rincebrain commented Mar 12, 2022 via email

@rincebrain
Copy link
Contributor

rincebrain commented Mar 12, 2022 via email

@RinCat
Copy link

RinCat commented Mar 12, 2022

System information

Type Version/Name
Distribution Name Gentoo
Distribution Version default/linux/amd64/17.1
Kernel Version 5.16.14
Architecture x86_64
OpenZFS Version 2.1.3
Clang Version 13.0.1

Using Clang + ld.lld, kernel + zfs builtin.

@nabijaczleweli
Copy link
Contributor

nabijaczleweli commented Mar 13, 2022

As a quick-fix, I have an inkling the following diff might Just Fix this:

diff --git a/module/zstd/include/zstd_compat_wrapper.h b/module/zstd/include/zstd_compat_wrapper.h
index c39dfa2db..422556806 100644
--- a/module/zstd/include/zstd_compat_wrapper.h
+++ b/module/zstd/include/zstd_compat_wrapper.h
@@ -473,3 +473,4 @@
 #define	repStartValue zfs_repStartValue
 #define	FSE_isError zfs_FSE_isError
 #define	HUF_isError zfs_HUF_isError
+#define	HIST_isError zfs_HIST_isError

@rincebrain
Copy link
Contributor

Probably.

I made a branch that adds all the outstanding symbols I saw, not just that one, but haven't had a chance to test it builtin on 5.16 yet.

@nabijaczleweli
Copy link
Contributor

nabijaczleweli commented Mar 13, 2022

Christ. There's gotta be a better way to at least enforce this.

After coming up with that way, I think that patch, as written, is a slight overreaction, since most of those are local; the globals I get on my system (but it should be the same everywhere) from the vanilla objects are:

nabijaczleweli@tarta:~/store/code/zfs/module/zstd$ objdump -t $vanilla_objs  | awk '/file format/ {print} $2 == "g" && !/ zfs_/'
lib/common/entropy_common.o:     file format elf64-x86-64
lib/common/error_private.o:     file format elf64-x86-64
lib/common/fse_decompress.o:     file format elf64-x86-64
lib/common/pool.o:     file format elf64-x86-64
lib/common/zstd_common.o:     file format elf64-x86-64
lib/compress/fse_compress.o:     file format elf64-x86-64
lib/compress/hist.o:     file format elf64-x86-64
0000000000000290 g     F .text  000000000000000f HIST_isError
lib/compress/huf_compress.o:     file format elf64-x86-64
lib/compress/zstd_compress_literals.o:     file format elf64-x86-64
lib/compress/zstd_compress_sequences.o:     file format elf64-x86-64
lib/compress/zstd_compress_superblock.o:     file format elf64-x86-64
lib/compress/zstd_compress.o:     file format elf64-x86-64
lib/compress/zstd_double_fast.o:     file format elf64-x86-64
lib/compress/zstd_fast.o:     file format elf64-x86-64
lib/compress/zstd_lazy.o:     file format elf64-x86-64
lib/compress/zstd_ldm.o:     file format elf64-x86-64
lib/compress/zstd_opt.o:     file format elf64-x86-64
lib/decompress/huf_decompress.o:     file format elf64-x86-64
lib/decompress/zstd_ddict.o:     file format elf64-x86-64
lib/decompress/zstd_decompress.o:     file format elf64-x86-64
lib/decompress/zstd_decompress_block.o:     file format elf64-x86-64

(There's a few more from the rest of zzstd.ko, but I don't think we care.)
This matches OP's linker error that would spew all duplicate symbols are the same time (I think?).

nabijaczleweli added a commit to nabijaczleweli/zfs that referenced this issue Mar 13, 2022
Closes: openzfs#12988
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
nabijaczleweli added a commit to nabijaczleweli/zfs that referenced this issue Mar 13, 2022
Closes: openzfs#12988
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
nabijaczleweli added a commit to nabijaczleweli/zfs that referenced this issue Mar 13, 2022
Closes: openzfs#12988
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
nabijaczleweli added a commit to nabijaczleweli/zfs that referenced this issue Mar 13, 2022
Closes: openzfs#12988
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
@dmb1372
Copy link

dmb1372 commented Mar 13, 2022

System information

Type Version/Name
Distribution Name Ubuntu
Distribution Version 20.04.4 LTS / Focal Fossa
Kernel Version 5.16.14
Architecture x86_64
OpenZFS Version 2.1.3

Same issue with compiling ZFS with built-in. Will likely apply fix in PR #13209 shortly, and rebuild ZFS and kernel, as have been waiting for OpenZFS 2.1.3 to release for Linux 5.16 support specifically.

nabijaczleweli added a commit to nabijaczleweli/zfs that referenced this issue Mar 14, 2022
Closes: openzfs#12988
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
behlendorf pushed a commit that referenced this issue Mar 15, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12988 
Closes #13209
@maxz
Copy link
Contributor

maxz commented Mar 24, 2022

This issue still persists with version 2.1.4 of OpenZFS and version 5.17.0 of the kernel when building the module in-tree.

ld: lib/zstd/compress/hist.o: in function `HIST_isError':
hist.c:(.text+0x230): multiple definition of `HIST_isError'; fs/zfs/zstd/lib/zstd.o:zstd.c:(.text+0x2fe00): first defined here
make: *** [Makefile:1155: vmlinux] Error 1

@rincebrain
Copy link
Contributor

2.1.x didn't cherrypick that, AFAICS, so that's not surprising.

Something for 2.1.5, I suppose.

@maxz
Copy link
Contributor

maxz commented Mar 24, 2022

Ah, yes, then it indeed is no surprise. Thanks.

@thesamesam
Copy link
Contributor

thesamesam commented Mar 24, 2022

This looks simple enough that I can cherry pick it into Gentoo, at least once it's in the staging branch. Not sure I want to sit there and do it manually 😉

@rincebrain
Copy link
Contributor

rincebrain commented Mar 24, 2022

No, I'm blind, it landed in 2.1.2.

That's fascinating.

e: sorry, no, I'm just reading too fast, similar symbol, I was right the first time.

veggiemike pushed a commit to veggiemike/zfs that referenced this issue May 15, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988
Closes openzfs#13209
(cherry picked from commit 6ef0019)
veggiemike pushed a commit to veggiemike/zfs that referenced this issue May 16, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988
Closes openzfs#13209
(cherry picked from commit 6ef0019)
behlendorf pushed a commit that referenced this issue May 16, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12988
Closes #13209
(cherry picked from commit 6ef0019)
nicman23 pushed a commit to nicman23/zfs that referenced this issue Aug 22, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988 
Closes openzfs#13209
nicman23 pushed a commit to nicman23/zfs that referenced this issue Aug 22, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988 
Closes openzfs#13209
lundman pushed a commit to openzfsonwindows/openzfs that referenced this issue Sep 2, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988 
Closes openzfs#13209
beren12 pushed a commit to beren12/zfs that referenced this issue Sep 19, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988 
Closes openzfs#13209
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988 
Closes openzfs#13209
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988 
Closes openzfs#13209
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988 
Closes openzfs#13209
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988 
Closes openzfs#13209
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988 
Closes openzfs#13209
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988 
Closes openzfs#13209
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988 
Closes openzfs#13209
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988 
Closes openzfs#13209
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988 
Closes openzfs#13209
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988 
Closes openzfs#13209
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988 
Closes openzfs#13209
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988 
Closes openzfs#13209
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988 
Closes openzfs#13209
@rincebrain
Copy link
Contributor

rincebrain commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
Linux
Awaiting triage
Development

Successfully merging a pull request may close this issue.

7 participants