NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.53k stars 13.71k forks source link

emacs 28.1 crash when get list packages #180537

Open stanislavsay opened 2 years ago

stanislavsay commented 2 years ago

Describe the bug

Emacs 28.1 crash when trying get list packages by command M-x list-packages. Error output:

Fatal error 4: Illegal instruction
Backtrace:
emacs[0x52d6a8]
emacs[0x421e47]
emacs[0x42234b]
emacs[0x52b8ad]
emacs[0x52b9a9]
/nix/store/scd5n7xsn0hh0lvhhnycr9gx0h8xfzsl-glibc-2.34-210/lib/libc.so.6(+0x3d0e0)[0x7f7d8bca20e0]
/nix/store/w05bz3m34qdkvjh5qyvq0a128ca75hc3-gnutls-3.7.3/lib/libgnutls.so.30(+0x14868a)[0x7f7d8c15b68a]
/nix/store/w05bz3m34qdkvjh5qyvq0a128ca75hc3-gnutls-3.7.3/lib/libgnutls.so.30(+0x13b882)[0x7f7d8c14e882]
/nix/store/xvnxppqj481201s8kn1disdsmniigaw1-nettle-3.7.3/lib/libnettle.so.8(nettle_hmac_set_key+0xdf)[0x7f7d8b27f4df]
/nix/store/w05bz3m34qdkvjh5qyvq0a128ca75hc3-gnutls-3.7.3/lib/libgnutls.so.30(+0x139b57)[0x7f7d8c14cb57]
/nix/store/w05bz3m34qdkvjh5qyvq0a128ca75hc3-gnutls-3.7.3/lib/libgnutls.so.30(+0x5aa53)[0x7f7d8c06da53]
/nix/store/w05bz3m34qdkvjh5qyvq0a128ca75hc3-gnutls-3.7.3/lib/libgnutls.so.30(gnutls_hmac_fast+0x5f)[0x7f7d8c08cc4f]
/nix/store/w05bz3m34qdkvjh5qyvq0a128ca75hc3-gnutls-3.7.3/lib/libgnutls.so.30(+0x8fd72)[0x7f7d8c0a2d72]
/nix/store/w05bz3m34qdkvjh5qyvq0a128ca75hc3-gnutls-3.7.3/lib/libgnutls.so.30(+0x4be6a)[0x7f7d8c05ee6a]
/nix/store/w05bz3m34qdkvjh5qyvq0a128ca75hc3-gnutls-3.7.3/lib/libgnutls.so.30(gnutls_handshake+0x19a)[0x7f7d8c060fca]
...
Illegal instruction (стек памяти сброшен на диск) emacs

Steps To Reproduce

I'm new user nixos. Fresh install nixos 22.05 Just add emacs in configuration.nix: environment.systemPackages = with pkgs; [ emacs ];

I'm try install with nix-env -iA nixos.emacs and add unstable channel, upgrade system and reinstall emacs - same error Running with strace nix-shell -p strace --run strace "emacs -nw" output:

/tmp/nix-shell-3886-0/rc: строка 3: 4623 Illegal instruction (стек памяти сброшен на диск) emacs

After added channel 21.11 for nixos and install from this emacs 27.2, emacs work corected.

Notify maintainers

@azahi, @adisbladis

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
this path will be fetched (0.06 MiB download, 0.30 MiB unpacked):
  /nix/store/p3d2d5i526vsmdwiwchbcswy57gz7ipv-bash-interactive-5.1-p16-dev
copying path '/nix/store/p3d2d5i526vsmdwiwchbcswy57gz7ipv-bash-interactive-5.1-p16-dev' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.52, NixOS, 22.11 (Raccoon), 22.11pre389776.71a4f0dc3d8`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.9.1`
 - channels(root): `"nixos, nixos21-21.11"`
 - channels(say): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
azahi commented 2 years ago

I've tried to go through this issue with @stanislavsay earlier today but I didn't manage to reproduce this issue on both nixpkgs-unstable and nixpkgs-22.05.

Could this be some kind of a faulty gnutls input? I'm pretty sure that's not related to native-comp, though since the PR #176780 that enables it by default for pkgs.emacs is not merged yet. It's also worth to mention that @stanislavsay installed NixOS on a QEMU VM. Albeit highly unlikely, but could this be the culprit?

stanislavsay commented 2 years ago

I confirm. The bug only reproduces when installing in QEMU, including when installing Arch in QEMU. When installed on a physical computer, there is no such problem. I use QEMU from Windows for personal reasons. I run it with the following parameters:


START /B qemu-system-x86_64 -m 2048 -net nic,model=virtio-net-pci -net user,hostfwd=tcp::10022-:22 -boot d -hda \Distros\NixOS\nixos.qcow2 -accel whpx,kernel-irqchip=off -vga qxl -usb -device usb-tablet -display default,show-cursor=on