From nobody Mon Nov 4 15:41:49 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 4Xhwgd5R5qz5cDp5 for ; Mon, 04 Nov 2024 15:41:49 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xhwgd4Hsmz4hQM for ; Mon, 4 Nov 2024 15:41:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730734909; 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=RkWTZwGJi/T3VZ491x8EYOhzQ7kXlvWhiG1hS6UeWcc=; b=goQhdPWthZnJnrXRNWh5vThxdG1yby5x5nIXpgSewVuHPtURQj7sM4dTUuCcQasK8gp4UM zCPkI3UNYSHovjvBvGC2S3+eAeaO8aAf40XoMlRItci19T+QaNhLiX7DmHHExgEUUJyrMo 82NLMZ/oIc/WLNcmprrvPeyCU79XcE2DqDtrPOYRc93qR1TkYGKebHPaEme1GVAW+fvz+y GcfGS9Zdc0dz5pyPic1kUGhIvLuiYeGuIHPnjvHBjjPxzyK6meWXV3z+R0mNrDwLxKAyYu 3ILbBY5rpodH9xzbhnMYFLythUknhj0LpgyhM7VuF1tfbVVUFMn3PYphszW+3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730734909; a=rsa-sha256; cv=none; b=qpdOWe59ACCGdyj13GtZhWDuzgVFVJKvLMMgC+vCX6ydVwOlruX61wpuYhr8zsw5UXftI0 NBOLJhaLr14qthsk6mEM2ApbTfsFpgHt3TsDM7yFKkeAvmM6W/dP3wA8pPeXPuj+wlA1w9 UesFUwpZyQF7L1neswht+8NJwaLEBX00cIv7XkjL2OZ0wOLoELr09vz/s+oqJQnyOLXk/k CchIAhsGILmwJZWQJflsUAm5//TtahJgKS6W9UhTwQuMKEK9dyqPqaYNCShTaUXTW6klXq l4WI0l+LzDUSgNwBA3mngBGJ5owInnTSmVs1bKrbzK8becf8zfIpCm1Mv0bErw== 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 4Xhwgd3vxYzfS9 for ; Mon, 4 Nov 2024 15:41:49 +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 4A4Ffnc1093412 for ; Mon, 4 Nov 2024 15:41:49 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4A4FfneX093411 for ports-bugs@FreeBSD.org; Mon, 4 Nov 2024 15:41:49 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 282543] graphics/openjph: Use AVX* instructions on default build on amd64 Date: Mon, 04 Nov 2024 15:41:49 +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 Some People X-Bugzilla-Who: vvd@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: sunpoet@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? merge-quarterly? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform bug_file_loc 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=3D282543 Bug ID: 282543 Summary: graphics/openjph: Use AVX* instructions on default build on amd64 Product: Ports & Packages Version: Latest Hardware: amd64 URL: https://github.com/aous72/OpenJPH/issues/157 OS: Any Status: New Severity: Affects Some People Priority: --- Component: Individual Port(s) Assignee: sunpoet@FreeBSD.org Reporter: vvd@FreeBSD.org Flags: maintainer-feedback?(sunpoet@FreeBSD.org) Assignee: sunpoet@FreeBSD.org Flags: merge-quarterly? OS: FreeBSD 14.1 amd64. CPU: Core 2 Quad Q6600. Build OpenJPH 0.17.0 from ports without -march and with -march=3Dcore2 - sa= me result. Dependencies list: smplayer =3D> qt5 =3D> kf5-kimageformats =3D> libheif = =3D> OpenJPH. $ gdb smplayer GNU gdb (GDB) 15.1 [GDB v15.1 for FreeBSD] Copyright (C) 2024 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.1". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from smplayer... (No debugging symbols found in smplayer) (gdb) run Starting program: /usr/local/bin/smplayer [New LWP 807958 of process 16273] Qt: Session management error: None of the authentication protocols specified are supported [New LWP 807959 of process 16273] This is SMPlayer v. 24.5.0 (revision 10277) running on FreeBSD [New LWP 807960 of process 16273] [Detaching after fork from child process 16274] Thread 1 received signal SIGILL, Illegal instruction. Privileged opcode. 0x000000081576a81a in ojph::local::initialize_tables_avx2() () from /usr/local/lib/libopenjph.so.0.17 $ valgrind smplayer ... vex amd64->IR: unhandled instruction bytes: 0xC5 0xF8 0x77 0xC3 0xC5 0xF8 0= x77 0xE8 0xDA 0x64 vex amd64->IR: REX=3D0 REX.W=3D0 REX.R=3D0 REX.X=3D0 REX.B=3D0 vex amd64->IR: VEX=3D0 VEX.L=3D0 VEX.nVVVV=3D0x0 ESC=3DNONE vex amd64->IR: PFX.66=3D0 PFX.F2=3D0 PFX.F3=3D0 =3D=3D16247=3D=3D valgrind: Unrecognised instruction at address 0x1b5f881a. =3D=3D16247=3D=3D at 0x1B5F881A: ojph::local::initialize_tables_avx2() (= in /usr/local/lib/libopenjph.so.0.17.0) =3D=3D16247=3D=3D by 0x400AF5C: ??? (in /libexec/ld-elf.so.1) =3D=3D16247=3D=3D by 0x400F3F2: ??? (in /libexec/ld-elf.so.1) =3D=3D16247=3D=3D by 0x400BF52: ??? (in /libexec/ld-elf.so.1) =3D=3D16247=3D=3D by 0x12D32276: ??? (in /usr/local/lib/libheif.so.1.19.= 1) =3D=3D16247=3D=3D by 0x12CBCB3B: heif_load_plugin (in /usr/local/lib/libheif.so.1.19.1) =3D=3D16247=3D=3D by 0x12CBC7DE: heif_load_plugins (in /usr/local/lib/libheif.so.1.19.1) =3D=3D16247=3D=3D by 0x12CBC5DE: heif_init (in /usr/local/lib/libheif.so= .1.19.1) =3D=3D16247=3D=3D by 0x12C1CADA: ??? (in /usr/local/lib/qt5/plugins/imageformats/kimg_heif.so) =3D=3D16247=3D=3D by 0x12C1CCD9: ??? (in /usr/local/lib/qt5/plugins/imageformats/kimg_heif.so) =3D=3D16247=3D=3D by 0x532D72F: ??? (in /usr/local/lib/qt5/libQt5Gui.so.= 5.15.15) =3D=3D16247=3D=3D by 0x532A4DF: QImageReader::supportedImageFormats() (in /usr/local/lib/qt5/libQt5Gui.so.5.15.15) =3D=3D16247=3D=3D Your program just tried to execute an instruction that Va= lgrind =3D=3D16247=3D=3D did not recognise. There are two possible reasons for th= is. =3D=3D16247=3D=3D 1. Your program has a bug and erroneously jumped to a non= -code =3D=3D16247=3D=3D location. If you are running Memcheck and you just sa= w a =3D=3D16247=3D=3D warning about a bad jump, it's probably your program's= fault. =3D=3D16247=3D=3D 2. The instruction is legitimate but Valgrind doesn't han= dle it, =3D=3D16247=3D=3D i.e. it's Valgrind's fault. If you think this is the = case or =3D=3D16247=3D=3D you are not sure, please let us know and we'll try to = fix it. =3D=3D16247=3D=3D Either way, Valgrind will now raise a SIGILL signal which= will =3D=3D16247=3D=3D probably kill your program. =3D=3D16247=3D=3D =3D=3D16247=3D=3D Process terminating with default action of signal 4 (SIGI= LL): dumping core =3D=3D16247=3D=3D Illegal opcode at address 0x1B5F881A =3D=3D16247=3D=3D at 0x1B5F881A: ojph::local::initialize_tables_avx2() (= in /usr/local/lib/libopenjph.so.0.17.0) =3D=3D16247=3D=3D by 0x400AF5C: ??? (in /libexec/ld-elf.so.1) =3D=3D16247=3D=3D by 0x400F3F2: ??? (in /libexec/ld-elf.so.1) =3D=3D16247=3D=3D by 0x400BF52: ??? (in /libexec/ld-elf.so.1) =3D=3D16247=3D=3D by 0x12D32276: ??? (in /usr/local/lib/libheif.so.1.19.= 1) =3D=3D16247=3D=3D by 0x12CBCB3B: heif_load_plugin (in /usr/local/lib/libheif.so.1.19.1) =3D=3D16247=3D=3D by 0x12CBC7DE: heif_load_plugins (in /usr/local/lib/libheif.so.1.19.1) =3D=3D16247=3D=3D by 0x12CBC5DE: heif_init (in /usr/local/lib/libheif.so= .1.19.1) =3D=3D16247=3D=3D by 0x12C1CADA: ??? (in /usr/local/lib/qt5/plugins/imageformats/kimg_heif.so) =3D=3D16247=3D=3D by 0x12C1CCD9: ??? (in /usr/local/lib/qt5/plugins/imageformats/kimg_heif.so) =3D=3D16247=3D=3D by 0x532D72F: ??? (in /usr/local/lib/qt5/libQt5Gui.so.= 5.15.15) =3D=3D16247=3D=3D by 0x532A4DF: QImageReader::supportedImageFormats() (in /usr/local/lib/qt5/libQt5Gui.so.5.15.15) ... AFAIU: 0xC5 0xF8 0x77 =3D vzeroupper from AVX. https://fuchsia.googlesource.com/third_party/llvm-project/+/refs/tags/llvmo= rg-13.0.0-rc1/llvm/test/CodeGen/X86/fma.ll?autodive=3D0%2F%2F%2F%2F%2F%2F%2= F%2F#665 https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#New_instructions Runtime detection of supported SIMD level in init_cpu_ext_level() work well, but OpenJPH still use instructions from unsupported SIMDs on current CPU. There are build options: option(OJPH_DISABLE_SIMD "Disables the use of SIMD instructions -- agnostic= to architectures" OFF) option(OJPH_DISABLE_SSE "Disables the use of SSE SIMD instructions and associated files" OFF) option(OJPH_DISABLE_SSE2 "Disables the use of SSE2 SIMD instructions and associated files" OFF) option(OJPH_DISABLE_SSSE3 "Disables the use of SSSE3 SIMD instructions and associated files" OFF) option(OJPH_DISABLE_SSE4 "Disables the use of SSE4 SIMD instructions and associated files" OFF) option(OJPH_DISABLE_AVX "Disables the use of AVX SIMD instructions and associated files" OFF) option(OJPH_DISABLE_AVX2 "Disables the use of AVX2 SIMD instructions and associated files" OFF) option(OJPH_DISABLE_AVX512 "Disables the use of AVX512 SIMD instructions and associated files" OFF) option(OJPH_DISABLE_NEON "Disables the use of NEON SIMD instructions and associated files" OFF) If I build with: CMAKE_ON=3DOJPH_DISABLE_SSE4 OJPH_DISABLE_AVX OJPH_DISABLE_AVX2 OJPH_DISABLE_AVX512 then smplayer run and work fine. Upstream issue: https://github.com/aous72/OpenJPH/issues/157 I can create (trivial) patch with all SIMD options for amd64. With default = ON OJPH_DISABLE_SSE and OJPH_DISABLE_SSE2 only. --=20 You are receiving this mail because: You are the assignee for the bug.=