Open RossComputerGuy opened 2 months ago
Can you provide some more context on what you're trying to do and what NixOS option you set?
I assume you're talking about the extraUtils
in nixos/modules/system/boot/stage-1.nix
, but that's a derivation providing some additional utilities to be present in the stage1. It's not executed in stage1 itself, but during the build, and invoking udevadm
in there cannot work (as the build is sandboxed).
But maybe I'm mis-guessing things, so please provide some context on what you're trying accomplish (the bigger picture), and how (config).
Config: https://github.com/RossComputerGuy/nixpkgs-llvm-ws/blob/master/nixos/default.nix
During stage 1 init, several segfaults occur. Adding the trace option, the udevadm command appears to segfault repeatedly. Running udevadm on the host from the extra init derivation also crashes but the udevadm command in systemd appears to work. I think this is happening because strip ran on the binary twice. This issue only occurs with an LLVM built NixOS system.
Here's a disassembly of the program https://termbin.com/g0um
Tried using gdb.
Reading symbols from /nix/store/cb9140939brgj80d7dxgzyx7pi49my34-extra-utils/bin/udevadm...
(No debugging symbols found in /nix/store/cb9140939brgj80d7dxgzyx7pi49my34-extra-utils/bin/udevadm)
(gdb) run
Starting program: /nix/store/cb9140939brgj80d7dxgzyx7pi49my34-extra-utils/bin/udevadm
During startup program terminated with signal SIGSEGV, Segmentation fault.
(gdb) info registers
The program has no registers now.
(gdb) disassemble
No frame selected.
(gdb) disassemble main
No symbol table is loaded. Use the "file" command.
(gdb) disassemble __libc_start_main
Dump of assembler code for function __libc_start_main@plt:
0x0000000000078a90 <+0>: adrp x16, 0xa9000
0x0000000000078a94 <+4>: ldr x17, [x16, #2424]
0x0000000000078a98 <+8>: add x16, x16, #0x978
0x0000000000078a9c <+12>: br x17
End of assembler dump.
(gdb) disassemble
Seems something did change which caused this segfualt: https://termbin.com/5612
I'm not sure this is something specific to the way we package systemd in nixpkgs, more like a LLVM-related issue… So might not be the right person to ask about this.
Testing with this overlay if it fixes the issue:
systemd.override {
stdenv = stdenv.override {
cc = stdenv.cc.override {
inherit (gnuStdenv.cc) bintools;
};
};
}
Describe the bug
Inside of the extra-utils derivation,
udevadm
fails to execute. Outside of extra-utils,udevadm
can execute. This issue occurs with and without any arguments. Strace reveals theexec
syscall fails.Dumping the binary with
llvm-readelf -d
shows this:Steps To Reproduce
Steps to reproduce the behavior:
systemd.package = pkgs.pkgsLLVM.systemd;
andboot.initrd.systemd.package = pkgs.pkgsLLVM.systemd;
.Expected behavior
NixOS init stage 1 should complete
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Notify maintainers
@flokli @Kloenk
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a :+1: reaction to issues you find important.