<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>225095</bug_id>
          
          <creation_ts>2021-04-27 01:58:00 -0700</creation_ts>
          <short_desc>Segmentation fault in &apos;libjavascriptcoregtk&apos; when sending SIGUSR1 signal to a process using webkit through WebKit2Gtk</short_desc>
          <delta_ts>2021-04-27 01:58:00 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>Other</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Benoît Minisini">g4mba5</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1754529</commentid>
    <comment_count>0</comment_count>
    <who name="Benoît Minisini">g4mba5</who>
    <bug_when>2021-04-27 01:58:00 -0700</bug_when>
    <thetext>System: Ubuntu 20.10 / Linux kernel 5.8.0-48-generic / x86_64 / KDE environment

If you send the SIGUSR1 signal to a process using webkitgtk (WebKit2Gtk-4.0 version 2.30.6), the process segfaults.

Here is a gdb log (the process is the Gambas interpreter):

---------------------------------------------------------------------------------------------

GNU gdb (Ubuntu 9.2-0ubuntu2) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type &quot;show copying&quot; and &quot;show warranty&quot; for details.
This GDB was configured as &quot;x86_64-linux-gnu&quot;.
Type &quot;show configuration&quot; for configuration details.
For bug reporting instructions, please see:
&lt;http://www.gnu.org/software/gdb/bugs/&gt;.
Find the GDB manual and other documentation resources online at:
    &lt;http://www.gnu.org/software/gdb/documentation/&gt;.

For help, type &quot;help&quot;.
Type &quot;apropos word&quot; to search for commands related to &quot;word&quot;...
Reading symbols from gbx3...
Attaching to program: /usr/bin/gbx3, process 24324
[New LWP 24331]
[New LWP 24332]
[New LWP 24334]
[New LWP 24335]
[New LWP 24336]
[New LWP 24337]
[New LWP 24342]
[New LWP 24345]
[Thread debugging using libthread_db enabled]
Using host libthread_db library &quot;/lib/x86_64-linux-gnu/libthread_db.so.1&quot;.
0x00007f6b4f6ac66f in __GI___poll (fds=0x556d2627bc10, nfds=3, timeout=5853) at ../sysdeps/unix/sysv/linux/poll.c:29
29      ../sysdeps/unix/sysv/linux/poll.c: Aucun fichier ou dossier de ce type.
(gdb) cont
Continuing.
[Thread 0x7f6b38bfb640 (LWP 24342) exited]

Thread 1 &quot;gbx3&quot; received signal SIGUSR1, User defined signal 1.
0x00007f6b4f6ac66f in __GI___poll (fds=0x556d2627bc10, nfds=3, timeout=90000) at ../sysdeps/unix/sysv/linux/poll.c:29
29      in ../sysdeps/unix/sysv/linux/poll.c
(gdb) cont
Continuing.

Thread 1 &quot;gbx3&quot; received signal SIGSEGV, Segmentation fault.
WTF::Thread::signalHandlerSuspendResume () at ../Source/WTF/wtf/posix/ThreadingPOSIX.cpp:121
121     ../Source/WTF/wtf/posix/ThreadingPOSIX.cpp: Aucun fichier ou dossier de ce type.
(gdb) bt
#0  WTF::Thread::signalHandlerSuspendResume(int, siginfo_t*, void*) () at ../Source/WTF/wtf/posix/ThreadingPOSIX.cpp:121
#1  0x00007f6b4f5e0950 in &lt;signal handler called&gt; () at /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007f6b4f6ac66f in __GI___poll (fds=0x556d2627bc10, nfds=3, timeout=90000) at ../sysdeps/unix/sysv/linux/poll.c:29
#3  0x00007f6b4bc0d86e in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f6b4bc0d9a3 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f6b4c25aaf5 in gtk_main_iteration_do (blocking=blocking@entry=1) at ../../../../gtk/gtkmain.c:1456
#6  0x00007f6b4d219cea in MAIN_do_iteration(bool) (do_not_block=do_not_block@entry=false) at main.cpp:689
#7  0x00007f6b4d219d3e in hook_loop() () at main.cpp:586
#8  0x0000556d24bd01d2 in main (argc=&lt;optimized out&gt;, argv=&lt;optimized out&gt;) at gbx.c:480
(gdb) disassemble 
Dump of assembler code for function WTF::Thread::signalHandlerSuspendResume(int, siginfo_t*, void*):
   0x00007f6b43de2890 &lt;+0&gt;:     endbr64 
   0x00007f6b43de2894 &lt;+4&gt;:     push   %rbp
   0x00007f6b43de2895 &lt;+5&gt;:     push   %rbx
   0x00007f6b43de2896 &lt;+6&gt;:     sub    $0x98,%rsp
   0x00007f6b43de289d &lt;+13&gt;:    mov    %fs:0x28,%rax
   0x00007f6b43de28a6 &lt;+22&gt;:    mov    %rax,0x88(%rsp)
   0x00007f6b43de28ae &lt;+30&gt;:    xor    %eax,%eax
   0x00007f6b43de28b0 &lt;+32&gt;:    mov    0x3578c9(%rip),%rbx        # 0x7f6b4413a180 &lt;_ZN3WTFL12targetThreadE&gt;
=&gt; 0x00007f6b43de28b7 &lt;+39&gt;:    mov    0x40(%rbx),%eax
   0x00007f6b43de28ba &lt;+42&gt;:    test   %eax,%eax
   0x00007f6b43de28bc &lt;+44&gt;:    jne    0x7f6b43de2958 &lt;WTF::Thread::signalHandlerSuspendResume(int, siginfo_t*, void*)+200&gt;
   0x00007f6b43de28c2 &lt;+50&gt;:    mov    %rsp,%rcx
   0x00007f6b43de28c5 &lt;+53&gt;:    mov    0x10(%rbx),%rax
   0x00007f6b43de28c9 &lt;+57&gt;:    cmp    %rcx,%rax
   0x00007f6b43de28cc &lt;+60&gt;:    jb     0x7f6b43de28d9 &lt;WTF::Thread::signalHandlerSuspendResume(int, siginfo_t*, void*)+73&gt;
   0x00007f6b43de28ce &lt;+62&gt;:    test   %rax,%rax
   0x00007f6b43de28d1 &lt;+65&gt;:    je     0x7f6b43de28d9 &lt;WTF::Thread::signalHandlerSuspendResume(int, siginfo_t*, void*)+73&gt;
   0x00007f6b43de28d3 &lt;+67&gt;:    cmp    0x18(%rbx),%rcx
   0x00007f6b43de28d7 &lt;+71&gt;:    ja     0x7f6b43de2910 &lt;WTF::Thread::signalHandlerSuspendResume(int, siginfo_t*, void*)+128&gt;
   0x00007f6b43de28d9 &lt;+73&gt;:    movq   $0x0,0x38(%rbx)
   0x00007f6b43de28e1 &lt;+81&gt;:    mov    0x88(%rsp),%rax
   0x00007f6b43de28e9 &lt;+89&gt;:    sub    %fs:0x28,%rax
   0x00007f6b43de28f2 &lt;+98&gt;:    jne    0x7f6b43de2975 &lt;WTF::Thread::signalHandlerSuspendResume(int, siginfo_t*, void*)+229&gt;
...
(gdb) info registers 
rax            0x0                 0
rbx            0x0                 0
rcx            0x7f6b4f6ac66f      140098870625903
rdx            0x7ffc6646e500      140722024408320
rsi            0x7ffc6646e630      140722024408624
rdi            0xa                 10
rbp            0x556d2627bc10      0x556d2627bc10
rsp            0x7ffc6646e450      0x7ffc6646e450
r8             0x0                 0
r9             0x7f6b4bcea280      140098810061440
r10            0x7ffc664fd080      140722024992896
r11            0x293               659
r12            0x3                 3
r13            0x7ffc6646eb04      140722024409860
r14            0x15f90             90000
r15            0x556d25e731c0      93927275704768
rip            0x7f6b43de28b7      0x7f6b43de28b7 &lt;WTF::Thread::signalHandlerSuspendResume(int, siginfo_t*, void*)+39&gt;
eflags         0x10246             [ PF ZF IF RF ]
cs             0x33                51
ss             0x2b                43
ds             0x0                 0
es             0x0                 0
fs             0x0                 0
gs             0x0                 0
---------------------------------------------------------------------------------------------</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>