From nobody Mon Aug 26 18:10:13 2024 X-Original-To: ports-bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WszHB0p8Cz5TMZ3 for ; Mon, 26 Aug 2024 18:10:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WszH95pFZz48P3 for ; Mon, 26 Aug 2024 18:10:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695813; a=rsa-sha256; cv=none; b=L+27+FkYpESgIjP71uQiFXfq8rJcU13yuWtrYbS0QLCKPvTJjzy7guzN6wR7qRfcbc7Am2 Mg4PrYRsFjsAqDcS2MniYmpvoWgiNb73epcbvmLLenaqFj4UXkGvI5dgDdJZj4E8rMKp2C 2HRpfh7dXIO9z95aeOZ6SiYMokM9ZLfWFhmfGAVtHpa94OoNlKQOKZyKQ+st5VsbCFYO5O KWArKOccO8VapA70MrzAsyBUZjKkEDqCbtEqMp2WSR1EyPbROB4hhQvxKB3GkZJ8oJUJRx X5NJImUJFBlYgVyEyTTd2tSK739YkiNBAjmvL5JNi9dAthOVYnxnu8NFV8hCFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YB+zBWugmGzGjDDtFK2NDiMpvNoxtwhvy2UX9U2YQYg=; b=AlSqJOGnpADNH97qhVTRgQ26fSVuWPY3mktTP4rLTt/FP6MI7IuXT5KP3LodZhh7kkOuTZ 9KykCy6cCtE2hU8yuk/LN/1NJ3RsMpd46Z7KqnqMI3z9Ba3FxnXCazZidQVRhW+1OKvfKz OMQeIBGosITkuZlgMDEX5+nmxzY2btHS6tG3hu4w4tTfdWAxGZXk3BSTjD+oIu35CvgyPD lnH7Ig8z/LYDiR41E+4+ZblPCJFWL9p+/HCa9ZlUArQmxJdvLWaH9kUbHwzMdZaG7nrFvB ru9TYq4Nx4CqVU93g0nmt9rC2jpZtJ326wx9LGhFCYKbM3e0EONz+umcrGE+Wg== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WszH95P4kzHHR for ; Mon, 26 Aug 2024 18:10:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 47QIADVM068842 for ; Mon, 26 Aug 2024 18:10:13 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 47QIAD9k068841 for ports-bugs@FreeBSD.org; Mon, 26 Aug 2024 18:10:13 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 281081] sysutils/ncdu2: Illegal instruction on some machines (amd64) Date: Mon, 26 Aug 2024 18:10:13 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: hpaluch@seznam.cz X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: sunpoet@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-ports-bugs@freebsd.org Sender: owner-freebsd-ports-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D281081 Bug ID: 281081 Summary: sysutils/ncdu2: Illegal instruction on some machines (amd64) Product: Ports & Packages Version: Latest Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: sunpoet@FreeBSD.org Reporter: hpaluch@seznam.cz Flags: maintainer-feedback?(sunpoet@FreeBSD.org) Assignee: sunpoet@FreeBSD.org Latest ncdu2 package (tested 2.4_1/amd64) is optimized for build server (th= at is default behavior of Zig compiler) and thus it causes "Illegal instruction error" on some CPUs. How to reproduce: $ freebsd-version=20 14.1-RELEASE-p3 $ dmesg | fgrep CPU: CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ (2000.12-MHz K8-class C= PU) $ doas pkg install ncdu2 $ pkg info | fgrep ncdu2 ncdu2-2.4_1 NCurses Disk Usage (stable version written in Zig) $ ncdu2 Illegal instruction (core dumped) To get illegal instruction opcode we can use gdb: gdb /usr/local/bin/ncdu2=20 GNU gdb (GDB) 14.1 [GDB v14.1 for FreeBSD] ... (gdb) run Starting program: /usr/local/bin/ncdu2=20 Program received signal SIGILL, Illegal instruction. Privileged opcode. 0x00000000010a5c17 in ?? () (gdb) bt #0 0x00000000010a5c17 in ?? () #1 0x0000000001060f54 in ?? () #2 0x0000000001057ab3 in ?? () #3 0x000000000104ff44 in ?? () #4 0x000000000104fc9c in ?? () #5 0x0000000801300a6a in __libc_start1 () from /lib/libc.so.7 #6 0x000000000104fa20 in ?? () (gdb) x/4i 0x00000000010a5c17 =3D> 0x10a5c17: vpxor %xmm0,%xmm0,%xmm0 0x10a5c1b: vmovdqa %ymm0,0xa0(%rsp) 0x10a5c24: mov %rax,0x120(%rsp) 0x10a5c2c: mov 0x118(%rsp),%rax There are some references on Internet that (v)pxor requires AVX2 set, but I= was uanble to find authoritative source. Cause: Zig compiler always produces binary optimized for CPU on build server unless instructed otherwise. Workaround: pass "-Dcpu=3Dx86_64" to Zig compiler - it should produce gener= ic amd64 binary. Here are details of my CPU from dmesg: CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ (2000.12-MHz K8-class C= PU) Origin=3D"AuthenticAMD" Id=3D0x40fb2 Family=3D0xf Model=3D0x4b Steppi= ng=3D2 =20 Features=3D0x178bfbff Features2=3D0x2001 AMD Features=3D0xea500800 AMD Features2=3D0x1f SVM: NAsids=3D64 Same Illegal instruction error also occurs on another PC with "Intel(R) Celeron(R) CPU N3450 @ 1.10GHz" (ZOTAC CI327 Nano ) --=20 You are receiving this mail because: You are the assignee for the bug.=