You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Jiri Daněk (Jira)" <ji...@apache.org> on 2023/12/02 17:36:00 UTC

[jira] [Created] (DISPATCH-2360) Router might crash during initialization due to improper CPython API usage

Jiri Daněk created DISPATCH-2360:
------------------------------------

             Summary: Router might crash during initialization due to improper CPython API usage
                 Key: DISPATCH-2360
                 URL: https://issues.apache.org/jira/browse/DISPATCH-2360
             Project: Qpid Dispatch
          Issue Type: Improvement
    Affects Versions: 1.19.0
            Reporter: Jiri Daněk
            Assignee: Jiri Daněk
             Fix For: 1.20.0


The following is a stacktrace from skupper-router, but as code inspection reveals, dispatch suffers from the same invalid API usage that is causing this

{noformat}
Program received signal SIGSEGV, Segmentation fault.
0x00007f9a8b9da771 in _PyInterpreterState_GET () at /usr/src/debug/python3.12-3.12.0-1.fc39.x86_64/Include/internal/pycore_pystate.h:118
118         return tstate->interp;
(gdb) bt
#0  0x00007f9a8b9da771 in _PyInterpreterState_GET () at /usr/src/debug/python3.12-3.12.0-1.fc39.x86_64/Include/internal/pycore_pystate.h:118
#1  get_state () at /usr/src/debug/python3.12-3.12.0-1.fc39.x86_64/Objects/obmalloc.c:866
#2  _PyObject_Malloc (ctx=<optimized out>, nbytes=77) at /usr/src/debug/python3.12-3.12.0-1.fc39.x86_64/Objects/obmalloc.c:1563
#3  0x00007f9a8b9e206b in PyObject_Malloc (size=<optimized out>) at /usr/src/debug/python3.12-3.12.0-1.fc39.x86_64/Objects/obmalloc.c:801
#4  PyUnicode_New (size=36, maxchar=<optimized out>) at /usr/src/debug/python3.12-3.12.0-1.fc39.x86_64/Objects/unicodeobject.c:1208
#5  0x00007f9a8b9e145c in unicode_decode_utf8 (s=<optimized out>, size=36, error_handler=error_handler@entry=_Py_ERROR_UNKNOWN, errors=errors@entry=0x0, consumed=consumed@entry=0x0)
    at /usr/src/debug/python3.12-3.12.0-1.fc39.x86_64/Objects/unicodeobject.c:4647
#6  0x00007f9a8b9e13e9 in PyUnicode_DecodeUTF8Stateful (consumed=0x0, errors=0x0, size=<optimized out>, s=<optimized out>) at /usr/src/debug/python3.12-3.12.0-1.fc39.x86_64/Objects/unicodeobject.c:4780
#7  0x0000000000467b50 in qd_python_initialize (python_pkgdir=0x4c2848 "/usr/local/lib/skupper-router/python", qd=<optimized out>) at /root/work/skupper-router/src/python_embedded.c:52
#8  qd_dispatch (python_pkgdir=0x4c2848 "/usr/local/lib/skupper-router/python", test_hooks=<optimized out>) at /root/work/skupper-router/src/dispatch.c:137
#9  0x000000000042cea7 in main_process (config_path=config_path@entry=0x4c27d0 "/usr/local/etc/skupper-router/skrouterd.conf", python_pkgdir=python_pkgdir@entry=0x4c2848 "/usr/local/lib/skupper-router/python", test_hooks=false,
    fd=fd@entry=2) at /root/work/skupper-router/router/src/main.c:97
#10 0x0000000000428e50 in main (argc=1, argv=0x7ffef77c64e8) at /root/work/skupper-router/router/src/main.c:365
(gdb) p tstate
$1 = (PyThreadState *) 0x0
{noformat}

See the fix in skupper-router at https://github.com/skupperproject/skupper-router/pull/1307



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org