Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 908047 - app-emulation/virtiofsd-1.5.1: fails to build with >=rust-1.70 (rustc: .../InstructionPrecedenceTracking.cpp:97: void llvm::InstructionPrecedenceTracking::validat...)
Summary: app-emulation/virtiofsd-1.5.1: fails to build with >=rust-1.70 (rustc: .../In...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michal Prívozník
URL:
Whiteboard:
Keywords:
: 913392 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-06-08 07:54 UTC by Toralf Förster
Modified: 2023-09-06 09:06 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,19.49 KB, text/plain)
2023-06-08 07:54 UTC, Toralf Förster
Details
app-emulation:virtiofsd-1.5.1:20230608-014058.log (app-emulation:virtiofsd-1.5.1:20230608-014058.log,89.37 KB, text/plain)
2023-06-08 07:55 UTC, Toralf Förster
Details
emerge-history.txt.xz (emerge-history.txt.xz,74.20 KB, application/x-xz)
2023-06-08 07:55 UTC, Toralf Förster
Details
environment (environment,79.52 KB, text/plain)
2023-06-08 07:55 UTC, Toralf Förster
Details
etc.clang.tar.xz (etc.clang.tar.xz,788 bytes, application/x-xz)
2023-06-08 07:55 UTC, Toralf Förster
Details
etc.portage.tar.xz (etc.portage.tar.xz,35.55 KB, application/x-xz)
2023-06-08 07:55 UTC, Toralf Förster
Details
temp.tar.xz (temp.tar.xz,24.85 KB, application/x-xz)
2023-06-08 07:55 UTC, Toralf Förster
Details
app-emulation/virtiofsd-1.6.1/temp/build.log (build.log,96.61 KB, text/x-log)
2023-07-13 08:12 UTC, amedeos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2023-06-08 07:54:58 UTC
too long lines were shrinked:

     Running `rustc --crate-name futures --edition=2018 /var/tmp/portage/app-emulation/virtiofsd-1.5.1/work/cargo_home/gentoo/futures-0.3.21/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C linke
     Running `rustc --crate-name libseccomp_sys --edition=2018 /var/tmp/portage/app-emulation/virtiofsd-1.5.1/work/cargo_home/gentoo/libseccomp-sys-0.2.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-lev
     Running `rustc --crate-name capng --edition=2018 /var/tmp/portage/app-emulation/virtiofsd-1.5.1/work/cargo_home/gentoo/capng-0.2.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C linker-plu
   Compiling virtiofsd v1.5.1 (/var/tmp/portage/app-emulation/virtiofsd-1.5.1/work/virtiofsd-v1.5.1)
     Running `rustc --crate-name virtiofsd --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C linker-plugin-lto -C metadata=54fa35c976570f46 -C extra-filename=-54fa35c976570f46 --out
     Running `rustc --crate-name virtiofsd --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C opt-level=3 -C lto -C metadata=13d0bde39de23f28 -C extra-filename=-13d0bde39de23f28 --out-dir /var/tmp/portage/
rustc: /var/tmp/portage/dev-lang/rust-1.70.0/work/rustc-1.70.0-src/src/llvm-project/llvm/lib/Analysis/InstructionPrecedenceTracking.cpp:97: void llvm::InstructionPrecedenceTracking::validate(const llvm::BasicBlock*) const: Assertion `It->second == nullptr && "Block is marked as having special instru
error: could not compile `virtiofsd` (bin "virtiofsd")


  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1-j5-20230602-204005

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-13 *
clang/llvm (if any):
clang version 16.0.5
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/16/bin
Configuration file: /etc/clang/clang.cfg
/usr/lib/llvm/16
16.0.5
Python 3.11.4
Available Ruby profiles:
  [1]   ruby31 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.69.0
  [2]   rust-1.70.0 *
The following VMs are available for generation-2:
1)	OpenJDK 17.0.6_p10 [openjdk-17]
2)	Eclipse Temurin JDK 17.0.6_p10 [openjdk-bin-17]
*)	Eclipse Temurin JDK 8.362_p09 [openjdk-bin-8]
Available Java Virtual Machines:
  [1]   openjdk-17 
  [2]   openjdk-bin-8  system-vm
  [3]   openjdk-bin-17 

php cli (if any):
go version go1.20.5 linux/amd64

  HEAD of ::gentoo
commit 5f7e8c6a3e0806872e30a4798a8ebef872bbe4db
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Wed Jun 7 22:32:04 2023 +0000

    2023-06-07 22:32:03 UTC

emerge -qpvO app-emulation/virtiofsd
[ebuild  N    ] app-emulation/virtiofsd-1.5.1  USE="-debug"
Comment 1 Toralf Förster gentoo-dev 2023-06-08 07:54:59 UTC
Created attachment 863531 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2023-06-08 07:55:00 UTC
Created attachment 863532 [details]
app-emulation:virtiofsd-1.5.1:20230608-014058.log
Comment 3 Toralf Förster gentoo-dev 2023-06-08 07:55:01 UTC
Created attachment 863533 [details]
emerge-history.txt.xz
Comment 4 Toralf Förster gentoo-dev 2023-06-08 07:55:03 UTC
Created attachment 863534 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2023-06-08 07:55:04 UTC
Created attachment 863535 [details]
etc.clang.tar.xz
Comment 6 Toralf Förster gentoo-dev 2023-06-08 07:55:05 UTC
Created attachment 863536 [details]
etc.portage.tar.xz
Comment 7 Toralf Förster gentoo-dev 2023-06-08 07:55:06 UTC
Created attachment 863537 [details]
temp.tar.xz
Comment 8 amedeos 2023-07-13 08:10:23 UTC
same issue on 1.6.1:

     Running `rustc --crate-name virtiofsd --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C opt-level=3 -C lto -C metadata=0f78cea97902091d -C extra-filename=-0f78cea97902091d --out-dir /dev/shm/portage/app-emulation/virtiofsd-1.6.1/work/virtiofsd-v1.6.1/target/release/deps -L dependency=/dev/shm/portage/app-emulation/virtiofsd-1.6.1/work/virtiofsd-v1.6.1/target/release/deps --extern bitflags=/dev/shm/portage/app-emulation/virtiofsd-1.6.1/work/virtiofsd-v1.6.1/target/release/deps/libbitflags-96f0feeca24d827f.rlib --extern capng=/dev/shm/portage/app-emulation/virtiofsd-1.6.1/work/virtiofsd-v1.6.1/target/release/deps/libcapng-4be3f84d1c5b54aa.rlib --extern env_logger=/dev/shm/portage/app-emulation/virtiofsd-1.6.1/work/virtiofsd-v1.6.1/target/release/deps/libenv_logger-0d9c52ba83a07c7a.rlib --extern futures=/dev/shm/portage/app-emulation/virtiofsd-1.6.1/work/virtiofsd-v1.6.1/target/release/deps/libfutures-6cbd4acfd8507ee4.rlib --extern libc=/dev/shm/portage/app-emulation/virtiofsd-1.6.1/work/virtiofsd-v1.6.1/target/release/deps/liblibc-b044a16ae3647b5b.rlib --extern libseccomp_sys=/dev/shm/portage/app-emulation/virtiofsd-1.6.1/work/virtiofsd-v1.6.1/target/release/deps/liblibseccomp_sys-457ae6e1d60c30a3.rlib --extern log=/dev/shm/portage/app-emulation/virtiofsd-1.6.1/work/virtiofsd-v1.6.1/target/release/deps/liblog-e092b0e35e95edbe.rlib --extern structopt=/dev/shm/portage/app-emulation/virtiofsd-1.6.1/work/virtiofsd-v1.6.1/target/release/deps/libstructopt-b3e1a843b5cfd598.rlib --extern syslog=/dev/shm/portage/app-emulation/virtiofsd-1.6.1/work/virtiofsd-v1.6.1/target/release/deps/libsyslog-bb6ec72c95605d00.rlib --extern vhost=/dev/shm/portage/app-emulation/virtiofsd-1.6.1/work/virtiofsd-v1.6.1/target/release/deps/libvhost-186f0de368620f3e.rlib --extern vhost_user_backend=/dev/shm/portage/app-emulation/virtiofsd-1.6.1/work/virtiofsd-v1.6.1/target/release/deps/libvhost_user_backend-109c9a8600bf1039.rlib --extern virtio_bindings=/dev/shm/portage/app-emulation/virtiofsd-1.6.1/work/virtiofsd-v1.6.1/target/release/deps/libvirtio_bindings-fc6a537af902f61f.rlib --extern virtio_queue=/dev/shm/portage/app-emulation/virtiofsd-1.6.1/work/virtiofsd-v1.6.1/target/release/deps/libvirtio_queue-a27b713ce32c31e0.rlib --extern virtiofsd=/dev/shm/portage/app-emulation/virtiofsd-1.6.1/work/virtiofsd-v1.6.1/target/release/deps/libvirtiofsd-95b20c1d1b921960.rlib --extern vm_memory=/dev/shm/portage/app-emulation/virtiofsd-1.6.1/work/virtiofsd-v1.6.1/target/release/deps/libvm_memory-5421d3176b3fc7ac.rlib --extern vmm_sys_util=/dev/shm/portage/app-emulation/virtiofsd-1.6.1/work/virtiofsd-v1.6.1/target/release/deps/libvmm_sys_util-556c90daff29e627.rlib`
rustc: /dev/shm/portage/dev-lang/rust-1.70.0/work/rustc-1.70.0-src/src/llvm-project/llvm/lib/Analysis/InstructionPrecedenceTracking.cpp:97: void llvm::InstructionPrecedenceTracking::validate(const llvm::BasicBlock*) const: Assertion `It->second == nullptr && "Block is marked as having special instructions but in fact it  has " "none!"' failed.
error: could not compile `virtiofsd` (bin "virtiofsd")
Comment 9 amedeos 2023-07-13 08:12:31 UTC
Created attachment 865446 [details]
app-emulation/virtiofsd-1.6.1/temp/build.log
Comment 10 Michal Prívozník 2023-07-20 19:26:22 UTC
I'm wondering whether this is a bug in virtiofsd or in fact rustc/llvm, given the hard failure (basically assertion inside llvm):

rustc: /dev/shm/portage/dev-lang/rust-1.70.0/work/rustc-1.70.0-src/src/llvm-project/llvm/lib/Analysis/InstructionPrecedenceTracking.cpp:97: void llvm::InstructionPrecedenceTracking::validate(const llvm::BasicBlock*) const: Assertion `It->second == nullptr && "Block is marked as having special instructions but in fact it  has " "none!"' failed.
Comment 11 r7l 2023-08-28 20:56:23 UTC
Having the same issue. Is there a known workaround?
Comment 12 amedeos 2023-08-29 09:21:36 UTC
(In reply to r7l from comment #11)
> Having the same issue. Is there a known workaround?

as I know no, this issue is still present on 1.6.x, maybe we need to wait for 1.7.x (upstream has already been released 1.7.2)
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-01 04:01:59 UTC
*** Bug 913392 has been marked as a duplicate of this bug. ***
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-01 04:03:02 UTC
dupe bug 913392 has a report of this w/ virtiofsd-1.6.1-r1 + rust-1.72 (!)

this needs an upstream Rust report
Comment 15 Nathan Zachary 2023-09-01 04:59:26 UTC
(In reply to Sam James from comment #14)
> dupe bug 913392 has a report of this w/ virtiofsd-1.6.1-r1 + rust-1.72 (!)
> 
> this needs an upstream Rust report

Should this be a bug report with Rust or is it limited to virtiofsd?
Comment 16 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-01 05:01:02 UTC
I think it's a bug in Rust for it to assert when building any Rust - even if it's invalid Rust code (it would give a real error in that case, but I don't think this Rust is invalid anyway).
Comment 17 Nathan Zachary 2023-09-01 05:08:23 UTC
It may actually be a bug in LLVM.  The only reference that I could find to it in the Rust issues is:

https://github.com/rust-lang/rust/issues/98076

which references an LLVM bug (that has already been closed).
Comment 18 Nathan Zachary 2023-09-01 05:12:08 UTC
Follow-on: it seems like the error is stemming from around line 97 of:
https://llvm.org/doxygen/InstructionPrecedenceTracking_8cpp_source.html
Comment 19 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-01 05:22:10 UTC
It may well be an LLVM bug fwiw but it's not really our problem to determine if Rust is passing something invalid to LLVM or if LLVM is doing something wrong - that's Rust upstream's job.

Yeah, I came across that one but the fix there seems to have landed in upstream LLVM long ago.

There's a chance it's fixed in Rust's bundled LLVM which has patches on top of LLVM - has anyone reproduced this using either rust-bin or rust[-system-llvm]?
Comment 20 amedeos 2023-09-01 06:35:18 UTC
(In reply to Sam James from comment #19)
> It may well be an LLVM bug fwiw but it's not really our problem to determine
> if Rust is passing something invalid to LLVM or if LLVM is doing something
> wrong - that's Rust upstream's job.
> 
> Yeah, I came across that one but the fix there seems to have landed in
> upstream LLVM long ago.
> 
> There's a chance it's fixed in Rust's bundled LLVM which has patches on top
> of LLVM - has anyone reproduced this using either rust-bin or
> rust[-system-llvm]?

but I've successfully built virtiofsd 1.7.2 with rust 1.71, maybe we can bump to that version?
Comment 21 Nathan Zachary 2023-09-01 17:01:14 UTC
Have you tried building virtiofsd-1.7.2 with rust 1.72.0?
Comment 22 Nathan Zachary 2023-09-01 20:16:35 UTC
Temporarily keywording the live package:

>>>
# cat /etc/portage/package.accept_keywords 
=app-emulation/virtiofsd-9999 **
>>>

allows it to build successfully with =dev-lang/rust-1.72.0.  As such, I think the proper solution here is to get =app-emulation/virtiofsd-1.7.2 bumped and into ~arch.
Comment 23 amedeos 2023-09-02 08:09:35 UTC
(In reply to Nathan Zachary from comment #21)
> Have you tried building virtiofsd-1.7.2 with rust 1.72.0?

yes, I've compiled it with rust 1.72

If you want I have published virtiofsd-1.7.2 ebuild on my overlay amedeos[0] (after gentoo repo bump to this, or greater version I'll remove it)

[0] https://github.com/amedeos/amedeos-overlay/blob/master/app-emulation/virtiofsd/virtiofsd-1.7.2.ebuild
Comment 24 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-02 08:11:13 UTC
(In reply to Nathan Zachary from comment #22)
> Temporarily keywording the live package:
> 
> >>>
> # cat /etc/portage/package.accept_keywords 
> =app-emulation/virtiofsd-9999 **
> >>>
> 
> allows it to build successfully with =dev-lang/rust-1.72.0.  As such, I
> think the proper solution here is to get =app-emulation/virtiofsd-1.7.2
> bumped and into ~arch.

Workaround, but yes.
Comment 25 Nathan Zachary 2023-09-05 16:28:40 UTC
1.8.0 was just released as well:
https://gitlab.com/virtio-fs/virtiofsd/-/releases/v1.8.0
Comment 26 Michal Prívozník 2023-09-06 08:51:44 UTC
Posted rebase for 1.8.0 here:

https://github.com/gentoo/gentoo/pull/32647
Comment 27 Larry the Git Cow gentoo-dev 2023-09-06 09:06:02 UTC
The bug has been closed via the following commit(s):

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

commit ea202c6f26e0e81ad8e5ba4c433d15e6692b4f8b
Author:     Michal Privoznik <michal.privoznik@gmail.com>
AuthorDate: 2023-09-06 08:08:57 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-09-06 09:05:44 +0000

    app-emulation/virtiofsd: Add 1.8.0
    
    Closes: https://bugs.gentoo.org/908047
    Signed-off-by: Michal Privoznik <michal.privoznik@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/32647
    Signed-off-by: Sam James <sam@gentoo.org>

 app-emulation/virtiofsd/Manifest               |  43 +++++++
 app-emulation/virtiofsd/virtiofsd-1.8.0.ebuild | 148 +++++++++++++++++++++++++
 2 files changed, 191 insertions(+)