From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F054F3858D1E; Mon, 6 May 2024 22:08:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F054F3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715033314; bh=nrL4iRr+ogCB+1Cx/fSRb09nRSKG186Bm/4BUPb3JNc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pozWhJVOFo8ih6RK8AADehFr9IEsYbQdoaPOS3J5sSc0OIZOeev8OrgaHnX7Wbszu w8lPcA83tvkBnLdZP0k+8zTG4YYhGG+zu4Z7ZGwbVWjYZzpkpG6qFTW+u3ZCcV54nw NR2o2sk8IZ5q777CtCtDaMwbCr+TLMm6VOgGXCF4= From: "slyfox at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114872] [13/14/15 Regression] Miscompilation with -O2 after commit r13-8037 Date: Mon, 06 May 2024 22:08:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.2.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: slyfox at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114872 --- Comment #18 from Sergei Trofimovich --- > 2) ideally show a gdb session with the important events, which setjmp was= it (I see _setjmp and __sigsetjmp calls in the function), which exact func= tion called from the function ended up aborting/doing longjmp in the signal= handler and where is the crash # gdb --quiet -p 1180766 Attaching to a running `sage` interactive process. In sage repl typing: libgap.AbelianGroup(0,0,0) Breakpoint happens. SIGABRT (immediate longjmp trigger) backtrace: Thread 1 "sage-ipython" received signal SIGABRT, Aborted. 0x00007f53f8e617a7 in __GI_kill () at ../sysdeps/unix/syscall-template.S:120 120 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS) (gdb) bt #0 0x00007f53f8e617a7 in __GI_kill () at ../sysdeps/unix/syscall-template.S:120 #1 0x00007f539c581edf in sig_error () at /usr/lib/python3.12/site-packages/cysignals/macros.h:298 #2 __pyx_pf_4sage_4libs_3gap_7element_19GapElement_Function_2__call__ (__pyx_v_self=3D__pyx_v_self@entry=3D0x7f539635bc40, __pyx_v_args=3D__pyx_v_args@entry=3D(, , )) at /usr/src/debug/sci-mathematics/sagemath-standard-10.3/sagemath-standard-10.= 3-python3_12/build/cythonized/sage/libs/gap/element.c:26315 #3 0x00007f539c5834e7 in __pyx_pw_4sage_4libs_3gap_7element_19GapElement_Function_3__call__ (__pyx_v_self=3D, __pyx_args=3D(, , ), __pyx_kwds=3D) at /usr/src/debug/sci-mathematics/sagemath-standard-10.3/sagemath-standard-10.= 3-python3_12/build/cythonized/sage/libs/gap/element.c:26105 #4 0x00007f53f916496b in _PyObject_MakeTpCall (tstate=3D0x7f53f9670d08 <_PyRuntime+459656>, callable=3Dcallable@entry=3D, args=3Dargs@entry=3D0x7f53f96b5480, nargs=3D3, keywords=3D0x0) at Objects/call.c:240 ... SIGSEGV backtrace (for completeness): Thread 1 "sage-ipython" received signal SIGSEGV, Segmentation fault. 0x00007f539c58256f in _Py_IsImmortal (op=3D0x0) at /usr/include/python3.12/object.h:242 242 return _Py_CAST(PY_INT32_T, op->ob_refcnt) < 0; (gdb) bt #0 0x00007f539c58256f in _Py_IsImmortal (op=3D0x0) at /usr/include/python3.12/object.h:242 #1 Py_DECREF (op=3D0x0) at /usr/include/python3.12/object.h:700 #2 Py_XDECREF (op=3D0x0) at /usr/include/python3.12/object.h:798 #3 __pyx_pf_4sage_4libs_3gap_7element_19GapElement_Function_2__call__ (__pyx_v_self=3D__pyx_v_self@entry=3D0x7f539635bc40, __pyx_v_args=3D__pyx_v_args@entry=3D(, , )) at /usr/src/debug/sci-mathematics/sagemath-standard-10.3/sagemath-standard-10.= 3-python3_12/build/cythonized/sage/libs/gap/element.c:26535 #4 0x00007f539c5834e7 in __pyx_pw_4sage_4libs_3gap_7element_19GapElement_Function_3__call__ (__pyx_v_self=3D, __pyx_args=3D(, , ), __pyx_kwds=3D) at /usr/src/debug/sci-mathematics/sagemath-standard-10.3/sagemath-standard-10.= 3-python3_12/build/cythonized/sage/libs/gap/element.c:26105 #5 0x00007f53f916496b in _PyObject_MakeTpCall (tstate=3D0x7f53f9670d08 <_PyRuntime+459656>, callable=3Dcallable@entry=3D, args=3Dargs@entry=3D0x7f53f96b5480, nargs=3D3, keywords=3D0x0) at Objects/call.c:240 Catching `*jmp` flavours: (gdb) break __pyx_pf_4sage_4libs_3gap_7element_19GapElement_Function_2__cal= l__ (gdb) continue ... (gdb) break __GI___sigsetjmp (gdb) break longjmp (gdb) break siglongjmp (gdb) continue # a lot of them (gdb) bt #0 __GI___sigsetjmp () at ../sysdeps/x86_64/setjmp.S:33 #1 0x00007fc83e6e6ea4 in __pyx_pf_4sage_4libs_3gap_7element_19GapElement_Function_2__call__ (__pyx_v_self=3D__pyx_v_self@entry=3D0x7fc83844f2c0, __pyx_v_args=3D__pyx_v_args@entry=3D(, , )) at /usr/src/debug/sci-mathematics/sagemath-standard-10.3/sagemath-standard-10.= 3-python3_12/build/cythonized/sage/libs/gap/element.c:26315 (gdb) fr 1 #1 0x00007fc83e6e6ea4 in __pyx_pf_4sage_4libs_3gap_7element_19GapElement_Function_2__call__ (__pyx_v_self=3D__pyx_v_self@entry=3D0x7fc83844f2c0, __pyx_v_args=3D__pyx_v_args@entry=3D(, , )) at /usr/src/debug/sci-mathematics/sagemath-standard-10.3/sagemath-standard-10.= 3-python3_12/build/cythonized/sage/libs/gap/element.c:26315 26315 sig_GAP_Enter(); (gdb) disassemble Dump of assembler code for function __pyx_pf_4sage_4libs_3gap_7element_19GapElement_Function_2__call__: 0x00007fc83e6e6e9f <+831>: call 0x7fc83e6b54e0 <_setjmp@plt> =3D> 0x00007fc83e6e6ea4 <+836>: mov $0x1,%ebx That is a _setjmp at element.c:26315. ABORT happens after it.=