From nobody Fri Dec 29 17:00:48 2023 X-Original-To: freebsd-stable@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 4T1s8L3Tj6z54Vm3 for ; Fri, 29 Dec 2023 17:00:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T1s8L33PWz4WdD; Fri, 29 Dec 2023 17:00:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703869250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qZXz+DTkf3aNhC3vevv2RdVUQ6mM+elQjRIrYKnHKuI=; b=UfSst9UnidkevAKkI6IR1TPHCB3fJh9KR+0XO22JgmZ7R22BSK97luuyaXnV5uvTGCuZJJ f7PoJgTcpvqHrokW1PzZSG7uyw/ErboI1NzfMVyYii5nyqdPSYHjX8Aa6uOyVPeB5+CVFh X/c0mrK1U/S9Mnw7xA/HM/Xn2nlp683eQe8m6tDuPwCifxUho3EHe9nqcoi25l74RnxUmR P67yYqwQlArzUQFxpIb82q9UpjWjT7e/lAnAHr3qq+m28vCxxIPkTtclto9W3mSZm4wWFH w8PkiO26Kf/OZv0QmCgZJBKt3an10zoGjkGYRiQK4apx8s/2yI+4oSCg3O77iw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703869250; a=rsa-sha256; cv=none; b=MEm0vkHT1ajePtPHhzGbCq3cjukHPpBcGM1tsfBVUpckQl/OIk0U3aU/rx7rPwkemWxmFb nrciF+REDM2y3Go9gsQ+qTjZCBSB5dsrAxztuP0rl89C1/TLbh9K3Axm+3LQHhP0UyZcZa Vwkgm7gB2iDF78s3HlU2R2pIiY2NA3mbp1rChpVQe0LgUyntRWUQndaJigCDcVHo9Cf1uu urvh94mUGbjMEohi9h4ziCpzFYfpWp/eArwoSAMAcdrkc+wYUwNcRQh5v/59TKsXbQ715u 1UYarXNJScPXYXF7vfKOPT1JCRvTmZgT8PW1PP7C1NgW1ZsGLd9Z2sBnqmWQZw== 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=1703869250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qZXz+DTkf3aNhC3vevv2RdVUQ6mM+elQjRIrYKnHKuI=; b=ogpGxIBZQi3n6ufDhm8vtZCtiJmp45G8JRWN1w6jVuZrn8zIQ/R+i0183p4PXVznAUnAq8 W2CCjrSLvqI5FcSUVbsvWk30S2C4XHJibWYTcIzGk3Q9j/AQav0PlprRpXnET5w1cagYqc J0yjx77skfQ2kfx4Tm/3I1cD1ww5bI5HcvAqONjSQOnjlJoBy6JPHvWRN5nb+mldHm9gsI ARvPhkQGS2EVhEloJfH/KOoZMNOP4iko4jdGQcoIy0bRNZ0Gefy17ESfJvOeeAsN2jjB8k tzxSwoQNqe4Gbzd3CX7iPdZo2anRjJx7Sqe4WT0l0/3R8lbSLWStq3skUI+Ebg== Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (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 (2048 bits) client-digest SHA256) (Client CN "tensor.andric.com", Issuer "R3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 4T1s8L1QSkz14CJ; Fri, 29 Dec 2023 17:00:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtpclient.apple (longrow.home.andric.com [192.168.0.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 0EEBF42F4C; Fri, 29 Dec 2023 18:00:49 +0100 (CET) Content-Type: text/plain; charset=us-ascii List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: SIGILL when CPUTYPE set to anyting witjh avx and CFLAGS -O2 From: Dimitry Andric In-Reply-To: Date: Fri, 29 Dec 2023 18:00:48 +0100 Cc: FreeBSD-STABLE Content-Transfer-Encoding: quoted-printable Message-Id: <72107B4B-F279-471B-8A8F-5B94C5EEDA47@FreeBSD.org> References: To: Harry Schmalzbauer X-Mailer: Apple Mail (2.3731.700.6) On 29 Dec 2023, at 11:14, Harry Schmalzbauer wrote: >=20 > at least since 14-release, I can't compile base/ports with CPUTYPE = post nehalem. Any '-march' declaring AVX(*) capability leads to = SIGILLing binaries with default -O2 CFLAGS. > Not much of a help, but here's a ports example, but same result with = base outcome too: >=20 > zsh: illegal hardware instruction (core dumped) = /var/ports-wrktree/editors/vim/work-console/vim-9.0.2143/src/vim > kernel: pid 56502 (vim), jid 0, uid 0: exited on signal 4 (core = dumped) >=20 > gdb /var/ports-wrktree/editors/vim/work-console/vim-9.0.2143/src/vim = /var/ports-wrktree/editors/vim/work-console/vim-9.0.2143/runtime/doc/vim.c= ore >=20 > GNU gdb (GDB) 13.2 [GDB v13.2 for FreeBSD] > Copyright (C) 2023 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later = > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. > Type "show copying" and "show warranty" for details. > This GDB was configured as "x86_64-portbld-freebsd14.0". > Type "show configuration" for configuration details. > For bug reporting instructions, please see: > . > Find the GDB manual and other documentation resources online at: > . >=20 > For help, type "help". > Type "apropos word" to search for commands related to "word"... > Reading symbols from = /var/ports-wrktree/editors/vim/work-console/vim-9.0.2143/src/vim... > [New LWP 154051] > Core was generated by = `/var/ports-wrktree/editors/vim/work-console/vim-9.0.2143/src/vim = --clean -esX -V'. > Program terminated with signal SIGILL, Illegal instruction. > Privileged opcode. > #0 0x000000000041e040 in init_yank () >=20 >=20 > If I compile without CFLAGS -O2 ("CFLAGS=3D -pipe"), = -march=3Dskylake-avx512 the binary doens't crash with SIGILL. >=20 > Is CPUTYPE supposed to stay untouched these days? Obviously not, but are you sure your target CPU is correct? If it is = not, the compiler may insert unsupported instructions. In any case, for the above gdb session, try the command "disassemble" to = see which particular instruction it crashed on. That may give more = information. -Dimitry