FS#74046 - ncdu 2.1-1: Error: illegal hardware instruction (core dumped)

Attached to Project: Community Packages
Opened by naicamine (naicamine) - Monday, 07 March 2022, 05:01 GMT
Last edited by Andreas Schleifer (Segaja) - Wednesday, 09 March 2022, 18:21 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Andreas Schleifer (Segaja)
Levente Polyak (anthraxx)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Description:
illegal hardware instruction (core dumped) ncdu

Additional info:
* package version= 2.1-1

Steps to reproduce:

When I updated to the new version using sudo pacman -Syu I got this error immeidately after running ncdu.
It was working fine before.
This task depends upon

Closed by  Andreas Schleifer (Segaja)
Wednesday, 09 March 2022, 18:21 GMT
Reason for closing:  Fixed
Additional comments about closing:  
https://archlinux.org/packages/community /x86_64/ncdu/ has been updated to 2.1-2 which fixes the crash.
Comment by Koshika Surasena (koshikas) - Monday, 07 March 2022, 11:08 GMT
contents of the coredump is as follows;

systemd-coredump[5639]: Process 5637 (ncdu) of user 1000 dumped core. │
│ │
│ Module linux-vdso.so.1 with build-id c92da1914b8d8df59d1e5784659d5e3│
│ Module ld-linux-x86-64.so.2 with build-id c09c6f50f6bcec73c64a0b4be7│
│ Module libc.so.6 with build-id 85766e9d8458b16e9c7ce6e07c712c02b8471│
│ Module libncursesw.so.6 with build-id 1f873ddb2c32ab39d0b7d8646d0368│
│ Module ncdu without build-id. │
│ Stack trace of thread 5637: │
│ #0 0x000000000022658e floorl (ncdu + 0x2658e) │
│ #1 0x000000000021d5b0 floorl (ncdu + 0x1d5b0) │
│ #2 0x00000000002127cc floorl (ncdu + 0x127cc) │
│ ELF object binary architecture: AMD x86-64 │
Comment by loqs (loqs) - Monday, 07 March 2022, 21:17 GMT
zig's default target is native. Changing it using -DZIG_TARGET_TRIPLE=$CARCH-linux-gnu should resolve the issue.
Unfortunately zig is currently failing check when I try and build it. This is independent of making the above change and or updating pkgver to 0.9.1.
Comment by Oliver Bandel (oriba) - Tuesday, 08 March 2022, 00:44 GMT
"Illegal instruction (core dumped)" here too.
Comment by Oliver Bandel (oriba) - Tuesday, 08 March 2022, 01:12 GMT
Looking at the coredump with gdb: nothing to see from the backtrace (no debug infos).

Building new with ABS gives a working ncdu.

Using gdb then with the coredump and the new build (which might be misleading), gives:

[...]
Reading symbols from /usr/bin/ncdu...

warning: exec file is newer than core file.
[New LWP 8214]
Core was generated by `ncdu'.
Program terminated with signal SIGILL, Illegal instruction.
#0 0x000000000022658e in std.mem.copy (dest=..., source=...) at /usr/lib/zig/std/mem.zig:221
221 dest[i] = s;
(gdb) bt
#0 0x000000000022658e in std.mem.copy (dest=..., source=...) at /usr/lib/zig/std/mem.zig:221
#1 std.sort.sort (items=...) at /usr/lib/zig/std/sort.zig:328
#2 0x000000000021d5b0 in std.mem.copy (dest=..., source=...) at /usr/lib/zig/std/mem.zig:220
#3 std.mem.Allocator.dupeZ (m=..., allocator=...) at /usr/lib/zig/std/mem/Allocator.zig:505
#4 scan.scan () at scan.zig:566
#5 0x0000000000000000 in ?? ()
(gdb)
Comment by Oliver Bandel (oriba) - Tuesday, 08 March 2022, 01:25 GMT
ncdu2 is so ugly.
Even with colors off not displaying correctly.

Looking for a replacement...
Comment by Andreas Schleifer (Segaja) - Wednesday, 09 March 2022, 00:02 GMT
https://archlinux.org/packages/community/x86_64/ncdu/ has been updated to 2.1-2 which fixes the crash.
Comment by Koshika Surasena (koshikas) - Wednesday, 09 March 2022, 10:29 GMT
it is ugly, however previous cosmetics could be had with these switches in its config file(.config/ncdu/config)

# change graph char
--graph-style hash

# colorless
--color off

Loading...