public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "slyfox at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-114872-4-jpYW56Xya6@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114872-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114872

--- Comment #18 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
> 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 function 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=__pyx_v_self@entry=0x7f539635bc40,
    __pyx_v_args=__pyx_v_args@entry=(<sage.rings.integer.Integer at remote
0x7f539b17b6c0>, <sage.rings.integer.Integer at remote 0x7f5396574390>,
<sage.rings.integer.Integer at remote 0x7f5396f957d0>))
    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=<sage.libs.gap.element.GapElement_Function at remote
0x7f539635bc40>,
    __pyx_args=(<sage.rings.integer.Integer at remote 0x7f539b17b6c0>,
<sage.rings.integer.Integer at remote 0x7f5396574390>,
<sage.rings.integer.Integer at remote 0x7f5396f957d0>), __pyx_kwds=<optimized
out>)
    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=0x7f53f9670d08
<_PyRuntime+459656>,
callable=callable@entry=<sage.libs.gap.element.GapElement_Function at remote
0x7f539635bc40>,
    args=args@entry=0x7f53f96b5480, nargs=3, keywords=0x0) at
Objects/call.c:240
...

SIGSEGV backtrace (for completeness):

Thread 1 "sage-ipython" received signal SIGSEGV, Segmentation fault.
0x00007f539c58256f in _Py_IsImmortal (op=0x0) 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=0x0) at
/usr/include/python3.12/object.h:242
#1  Py_DECREF (op=0x0) at /usr/include/python3.12/object.h:700
#2  Py_XDECREF (op=0x0) at /usr/include/python3.12/object.h:798
#3  __pyx_pf_4sage_4libs_3gap_7element_19GapElement_Function_2__call__
(__pyx_v_self=__pyx_v_self@entry=0x7f539635bc40,
    __pyx_v_args=__pyx_v_args@entry=(<sage.rings.integer.Integer at remote
0x7f539b17b6c0>, <sage.rings.integer.Integer at remote 0x7f5396574390>,
<sage.rings.integer.Integer at remote 0x7f5396f957d0>))
    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=<sage.libs.gap.element.GapElement_Function at remote
0x7f539635bc40>,
    __pyx_args=(<sage.rings.integer.Integer at remote 0x7f539b17b6c0>,
<sage.rings.integer.Integer at remote 0x7f5396574390>,
<sage.rings.integer.Integer at remote 0x7f5396f957d0>), __pyx_kwds=<optimized
out>)
    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=0x7f53f9670d08
<_PyRuntime+459656>,
callable=callable@entry=<sage.libs.gap.element.GapElement_Function at remote
0x7f539635bc40>,
    args=args@entry=0x7f53f96b5480, nargs=3, keywords=0x0) at
Objects/call.c:240


Catching `*jmp` flavours:

(gdb) break __pyx_pf_4sage_4libs_3gap_7element_19GapElement_Function_2__call__
(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=__pyx_v_self@entry=0x7fc83844f2c0,
    __pyx_v_args=__pyx_v_args@entry=(<sage.rings.integer.Integer at remote
0x7fc83e878de0>, <sage.rings.integer.Integer at remote 0x7fc8392b2790>,
<sage.rings.integer.Integer at remote 0x7fc8392b2730>))
    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=__pyx_v_self@entry=0x7fc83844f2c0,
    __pyx_v_args=__pyx_v_args@entry=(<sage.rings.integer.Integer at remote
0x7fc83e878de0>, <sage.rings.integer.Integer at remote 0x7fc8392b2790>,
<sage.rings.integer.Integer at remote 0x7fc8392b2730>))
    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>
=> 0x00007fc83e6e6ea4 <+836>:   mov    $0x1,%ebx

That is a _setjmp at element.c:26315. ABORT happens after it.

  parent reply	other threads:[~2024-05-06 22:08 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-27 18:57 [Bug c/114872] New: Miscompilation with -O2 after commit 049ec9b981d1f4f97736061d5cf7d0ae990b57d7 arojas at archlinux dot org
2024-04-27 18:59 ` [Bug c/114872] " arojas at archlinux dot org
2024-04-27 19:03 ` pinskia at gcc dot gnu.org
2024-04-27 19:05 ` pinskia at gcc dot gnu.org
2024-04-27 19:06 ` arojas at archlinux dot org
2024-04-27 20:00 ` [Bug tree-optimization/114872] [13/14/15 Regression] Miscompilation with -O2 after commit r13-8037 pinskia at gcc dot gnu.org
2024-04-29 15:53 ` sjames at gcc dot gnu.org
2024-04-29 16:00 ` jakub at gcc dot gnu.org
2024-04-29 20:05 ` arojas at archlinux dot org
2024-05-01  1:00 ` sjames at gcc dot gnu.org
2024-05-01  1:01 ` sjames at gcc dot gnu.org
2024-05-01  1:01 ` sjames at gcc dot gnu.org
2024-05-01  1:03 ` sjames at gcc dot gnu.org
2024-05-03 11:07 ` dima.pasechnik at cs dot ox.ac.uk
2024-05-03 11:26 ` dima.pasechnik at cs dot ox.ac.uk
2024-05-06 13:53 ` slyfox at gcc dot gnu.org
2024-05-06 17:29 ` jakub at gcc dot gnu.org
2024-05-06 17:59 ` jakub at gcc dot gnu.org
2024-05-06 21:41 ` slyfox at gcc dot gnu.org
2024-05-06 22:08 ` slyfox at gcc dot gnu.org [this message]
2024-05-06 22:45 ` dima.pasechnik at cs dot ox.ac.uk
2024-05-07 10:45 ` jakub at gcc dot gnu.org
2024-05-07 11:05 ` slyfox at gcc dot gnu.org
2024-05-07 22:13 ` slyfox at gcc dot gnu.org
2024-05-08  8:18 ` slyfox at gcc dot gnu.org
2024-05-08  8:27 ` rguenth at gcc dot gnu.org
2024-05-08 18:10 ` slyfox at gcc dot gnu.org
2024-05-08 19:17 ` dima.pasechnik at cs dot ox.ac.uk
2024-05-08 19:35 ` pinskia at gcc dot gnu.org
2024-05-08 19:58 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-114872-4-jpYW56Xya6@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).