From nobody Fri Oct 15 14:57:22 2021 X-Original-To: freebsd-arm@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 5F34A180C558 for ; Fri, 15 Oct 2021 14:57:22 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HW8WQ27pHz3GWP for ; Fri, 15 Oct 2021 14:57:22 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 255A025D for ; Fri, 15 Oct 2021 14:57:22 +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 19FEvMvd087789 for ; Fri, 15 Oct 2021 14:57:22 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 19FEvMU5087788 for freebsd-arm@FreeBSD.org; Fri, 15 Oct 2021 14:57:22 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: freebsd-arm@FreeBSD.org Subject: [Bug 259187] Use of thumb NEON instructions in thread causes SIGILL Date: Fri, 15 Oct 2021 14:57:22 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: arm X-Bugzilla-Version: 13.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: fuz@fuz.su X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-arm@FreeBSD.org X-Bugzilla-Flags: mfc-stable13? mfc-stable12? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc 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: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D259187 Bug ID: 259187 Summary: Use of thumb NEON instructions in thread causes SIGILL Product: Base System Version: 13.0-RELEASE Hardware: arm OS: Any Status: New Severity: Affects Only Me Priority: --- Component: arm Assignee: freebsd-arm@FreeBSD.org Reporter: fuz@fuz.su CC: cognet@FreeBSD.org Flags: mfc-stable13?, mfc-stable12? The following program crashes with a SIGILL on armv7 FreeBSD 13.0-RELEASE. = It does not crash in an armv7 jail on arm64 FreeBSD and does not crash when compiled without -mthumb. #include #include void *a(void *x) { (void)x; struct { int b[4]; } c =3D c; return (NULL); } int main() { pthread_t d; pthread_create(&d, NULL, a, NULL); pthread_join(d, NULL); } Save the program in a file name min.c, then type cc -mthumb min.c -lpthread && ./a.out to reproduce. The assembly code for function a() looks as follows: 00020754 : 20754: b086 sub sp, #24 20756: 9005 str r0, [sp, #20] 20758: 4668 mov r0, sp 2075a: f960 0a8f vld1.32 {d16-d17}, [r0] 2075e: f940 0acf vst1.64 {d16-d17}, [r0] 20762: 2000 movs r0, #0 20764: b006 add sp, #24 20766: 4770 bx lr The program crashes at address 2075a at the vld1.32 instruction. When compiled for ARM mode, the same instruction is used but no crash occur= s.=20 I do not understand what causes this issue. It also does not seem to happen when executing the function a() without usi= ng a separate thread. I've used a Raspberry Pi 3B (Cortex-A7) to find this issue. --=20 You are receiving this mail because: You are the assignee for the bug.=