Giter Club home page Giter Club logo

Comments (7)

trygveaa avatar trygveaa commented on June 1, 2024 1

I posted an issue to CPython for this: python/cpython#116510

I also noticed that it's fixed in version v3.13.0a4.

from weechat.

laemeiqu avatar laemeiqu commented on June 1, 2024

If title is unloaded before autosort then weechat does not crash on exit:

  1. /script unload title
  2. /exit
  3. no crash

If autosort is unloaded before title then weechat does crash on exit or on unloading of title:

  1. /script unload autosort
  2. /script unload title
  3. crash

from weechat.

flashcode avatar flashcode commented on June 1, 2024

Does the crash happen with any Python script?
Did you try with two different scripts (if possible very small scripts, doing almost nothing)?

from weechat.

laemeiqu avatar laemeiqu commented on June 1, 2024

I can reproduce this crash with other python plugins. I reproduced the crash with the scripts go.py and grep.py both installed.

If grep.py is unloaded before go.py then weechat does not crash on exit:

  1. /script unload grep.py
  2. /exit
  3. no crash

If go.py is unloaded before grep.py then weechat does crash on exit or on unloading of grep.py:

  1. /script unload go.py
  2. /script unload grep.py
  3. crash

Note: going straight for /exit when grep.py and go.py are both installed and loaded also results in the crash.

from weechat.

flashcode avatar flashcode commented on June 1, 2024

Hi,
I can not reproduce on Debian (Sid/unstable) with Python 3.11 (not 3.12, that could explain), is it possible to write a short Dockerfile based on voidlinux to reproduce the crash inside, so I can investigate?

from weechat.

rjarry avatar rjarry commented on June 1, 2024

Hi there,

I can also reproduce the issue with read_marker.py and soju.py loaded, in that order. For some reason, loading soju.py first does not trigger the issue every time.

Reproducer:

  • run weechat -s to disable autoloading of any script
  • /script load read_marker.py
  • /script load soju.py
  • /quit

Here is some more debug info if that helps:

Python 3.12.1 (main, Dec 18 2023, 00:00:00) [GCC 13.2.1 20231205 (Red Hat 13.2.1-6)] on linux

======= WeeChat backtrace =======
(written by WeeChat 4.2.1, compiled on Feb 14 2024 23:44:18)
001  /home/rjarry/upstream/weechat/src/core/wee-backtrace.c:167 [function weechat_backtrace]
002  /home/rjarry/upstream/weechat/src/core/wee-debug.c:192 [function debug_sigsegv_cb]
003  ??:? [function __restore_rt]
004  ??:? [function _PyObject_FastCallDictTstate]
005  ??:? [function PyObject_Free]
006  ??:? [function _PyModule_ClearDict]
007  ??:? [function PyGC_Collect]
008  ??:? [function Py_EndInterpreter]
009  /home/rjarry/upstream/weechat/src/plugins/python/weechat-python.c:978 [function weechat_python_unload]
010  /home/rjarry/upstream/weechat/src/plugins/python/weechat-python.c:1022 [function weechat_python_unload_all]
011  /home/rjarry/upstream/weechat/src/plugins/plugin-script.c:1791 [function plugin_script_end]
012  /home/rjarry/upstream/weechat/src/plugins/python/weechat-python.c:1569 [function weechat_plugin_end]
013  /home/rjarry/upstream/weechat/src/plugins/plugin.c:1259 [function plugin_unload]
014  /home/rjarry/upstream/weechat/src/plugins/plugin.c:1306 [function plugin_unload_all]
015  /home/rjarry/upstream/weechat/src/plugins/plugin.c:1431 [function plugin_end]
016  /home/rjarry/upstream/weechat/src/core/weechat.c:710 [function weechat_end]
017  /home/rjarry/upstream/weechat/src/gui/curses/normal/main.c:47 [function main]
018  ??:? [function __libc_start_call_main]
019  :? [function __libc_start_main_alias_2]
020  ??:? [function _start]
======= End of  backtrace =======

(gdb) thread apply all bt full

Thread 1 (Thread 0x7f4e332f0a80 (LWP 171986)):
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
        tid = <optimized out>
        ret = 0
        pd = <optimized out>
        old_mask = {
          __val = {[0] = 140730321364448}
        }
        ret = <optimized out>
#1  0x00007f4e33aca8a3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
No locals.
#2  0x00007f4e33a788ee in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
        ret = <optimized out>
#3  0x00007f4e33a608ff in __GI_abort () at abort.c:79
        save_stage = 1
        act = {
          __sigaction_handler = {
            sa_handler = 0x20,
            sa_sigaction = 0x20
          },
          sa_mask = {
            __val = {[0] = 139973852474048, [1] = 416, [2] = 14057664, [3] = 140730321364592, [4] = 139973851178954, [5] = 2, [6] = 18446744073709551472, [7] = 2, [8] = 14057248, [9] = 139973824960864, [10] = 18446744073709551472, [11] = 2, [12] = 12498224, [13] = 140730321364672, [14] = 139973851190238, [15] = 140730321364656}
          },
          sa_flags = 870771879,
          sa_restorer = 0x7f4e318eb790
        }
#4  0x0000000000406e6f in weechat_shutdown (return_code=1, crash=1) at /home/rjarry/upstream/weechat/src/core/weechat.c:600
No locals.
#5  0x00000000004355f7 in debug_sigsegv_cb () at /home/rjarry/upstream/weechat/src/core/wee-debug.c:192
No locals.
#6  <signal handler called>
No locals.
#7  0x00007f4e31df9a8d in _PyGCHead_SET_NEXT (next=0x7f4e318eb730, gc=0x7f4e3225f0c8) at /usr/src/debug/python3.12-3.12.1-2.fc39.x86_64/Include/internal/pycore_gc.h:63
No locals.
#8  _PyObject_GC_UNTRACK (op=0x7f4e318eb790) at /usr/src/debug/python3.12-3.12.1-2.fc39.x86_64/Include/internal/pycore_object.h:246
        gc = 0x7f4e318eb780
        prev = 0x7f4e3225f0c8
        next = 0x7f4e318eb730
        gc = <optimized out>
        prev = <optimized out>
        next = <optimized out>
#9  PyObject_GC_UnTrack (op_raw=0x7f4e318eb790) at /usr/src/debug/python3.12-3.12.1-2.fc39.x86_64/Modules/gcmodule.c:2242
        op = 0x7f4e318eb790
        op = <optimized out>
#10 meth_dealloc (m=0x7f4e318eb790) at /usr/src/debug/python3.12-3.12.1-2.fc39.x86_64/Objects/methodobject.c:162
No locals.
#11 0x00007f4e31dec157 in _Py_Dealloc (op=0x7f4e318eb790) at /usr/src/debug/python3.12-3.12.1-2.fc39.x86_64/Objects/object.c:2625
        type = <optimized out>
        dealloc = <optimized out>
#12 Py_DECREF (op=0x7f4e318eb790) at /usr/src/debug/python3.12-3.12.1-2.fc39.x86_64/Include/object.h:706
No locals.
#13 Py_XDECREF (op=0x7f4e318eb790) at /usr/src/debug/python3.12-3.12.1-2.fc39.x86_64/Include/object.h:799
No locals.
#14 insertdict (interp=<optimized out>, mp=0x7f4e30bc7b00, key=0x7f4e32172740 <const_str_register>, hash=<optimized out>, value=0x7f4e321d5960 <_Py_NoneStruct>) at /usr/src/debug/python3.12-3.12.1-2.fc39.x86_64/Objects/dictobject.c:1319
        old_value = 0x7f4e318eb790
        ix = <optimized out>
#15 0x00007f4e31e4fe60 in PyDict_SetItem (value=0x7f4e321d5960 <_Py_NoneStruct>, key=0x7f4e32172740 <const_str_register>, op=0x7f4e30bc7b00) at /usr/src/debug/python3.12-3.12.1-2.fc39.x86_64/Objects/dictobject.c:1883
No locals.
#16 _PyModule_ClearDict (d=0x7f4e30bc7b00) at /usr/src/debug/python3.12-3.12.1-2.fc39.x86_64/Objects/moduleobject.c:656
        pos = 6
        key = 0x7f4e32172740 <const_str_register>
        value = 0x7f4e318eb790
        verbose = <optimized out>
#17 0x00007f4e31ebde94 in finalize_modules_clear_weaklist (verbose=0, weaklist=0x7f4e30d294c0, interp=0x230a8e0) at /usr/src/debug/python3.12-3.12.1-2.fc39.x86_64/Python/pylifecycle.c:1526
        tup = <optimized out>
        name = 0x7f4e30bc94a0
        mod = 0x7f4e30bd8540
        dict = <optimized out>
        i = 70
#18 finalize_modules (tstate=tstate@entry=0x2368200) at /usr/src/debug/python3.12-3.12.1-2.fc39.x86_64/Python/pylifecycle.c:1609
        interp = <optimized out>
        modules = <optimized out>
        verbose = 0
        weaklist = 0x7f4e30d294c0
#19 0x00007f4e31ecb494 in Py_EndInterpreter (tstate=0x2368200) at /usr/src/debug/python3.12-3.12.1-2.fc39.x86_64/Python/pylifecycle.c:2199
        interp = 0x230a8e0
        __func__ = "Py_EndInterpreter"
#20 0x00007f4e323fc007 in weechat_python_unload (script=0x2218e10) at /home/rjarry/upstream/weechat/src/plugins/python/weechat-python.c:975
        rc = 0x270e6d0
        interpreter = 0x2368200
        filename = 0x5d074a0 "/home/rjarry/.local/share/weechat/python/autoload/soju.py"
#21 0x00007f4e323fc1c7 in weechat_python_unload_all () at /home/rjarry/upstream/weechat/src/plugins/python/weechat-python.c:1024
No locals.
#22 0x00007f4e3242c8a6 in plugin_script_end (weechat_plugin=0xe592a0, plugin_data=0x7f4e3243a140 <python_data>) at /home/rjarry/upstream/weechat/src/plugins/plugin-script.c:1790
        scripts_loaded = 1
#23 0x00007f4e323fd76d in weechat_plugin_end (plugin=0xe592a0) at /home/rjarry/upstream/weechat/src/plugins/python/weechat-python.c:1568
No locals.
#24 0x00000000004c3fb5 in plugin_unload (plugin=0xe592a0) at /home/rjarry/upstream/weechat/src/plugins/plugin.c:1256
        end_func = 0x7f4e323fd70c <weechat_plugin_end>
        name = 0x1b45be0 "python"
#25 0x00000000004c411c in plugin_unload_all () at /home/rjarry/upstream/weechat/src/plugins/plugin.c:1308
        plugins_loaded = 1
#26 0x00000000004c4475 in plugin_end () at /home/rjarry/upstream/weechat/src/plugins/plugin.c:1428
No locals.
#27 0x00000000004071a9 in weechat_end (gui_end_cb=0x4bb8df <gui_main_end>) at /home/rjarry/upstream/weechat/src/core/weechat.c:709
No locals.
#28 0x0000000000406129 in main (argc=1, argv=0x7ffe54d071d8) at /home/rjarry/upstream/weechat/src/gui/curses/normal/main.c:45
No locals.

from weechat.

trygveaa avatar trygveaa commented on June 1, 2024

I bisected this issue to this commit in cpython: python/cpython@de64e75

from weechat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.