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 2021/05/04 07:34:00 UTC

[jira] [Commented] (DISPATCH-2098) Crash when ctrl-c on router that has a libwebsockets listener connected to a console (2)

    [ https://issues.apache.org/jira/browse/DISPATCH-2098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17338815#comment-17338815 ] 

Jiri Daněk commented on DISPATCH-2098:
--------------------------------------

This is because of https://github.com/apache/qpid-dispatch/pull/1080 :( In qd_dispatch_free():

{code}
void qd_dispatch_free(qd_dispatch_t *qd)
{
    if (!qd) return;
    free(qd->sasl_config_path);
    free(qd->sasl_config_name);
    qd_connection_manager_free(qd->connection_manager);
    qd_policy_free(qd->policy);
    Py_XDECREF((PyObject*) qd->agent);
    qd_router_free(qd->router);
    qd_container_free(qd->container);
    qd_server_free(qd->server);
    qd_log_finalize();
...
{code}

So {{qd_container_free}} is done before {{qd_server_free}}. The container_free deletes the mutex. But it is only in {{qd_server_free}} where {{qd_http_server_free}} is called. So there is a period of time when the mutex in container is still needed. but it is already destroyed.

> Crash when ctrl-c on router that has a libwebsockets listener connected to a console (2)
> ----------------------------------------------------------------------------------------
>
>                 Key: DISPATCH-2098
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-2098
>             Project: Qpid Dispatch
>          Issue Type: Bug
>          Components: Routing Engine
>            Reporter: Charles E. Rolke
>            Priority: Major
>
> This crash seems similar to DISPATCH-857 except that it is happening on qpid-dispatch main @ 8545a425.
> Process console
> {code:java}
> qdrouterd: /home/chug/git/qpid-dispatch/src/posix/threading.c:58: sys_mutex_lock: Assertion `result == 0' failed.
> {code}
> gdb backtrace
> {code:java}
> > gdb qdrouterd core.qdrouterd.1102256
> GNU gdb (GDB) Fedora 9.1-6.fc32
> Copyright (C) 2020 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> Type "show copying" and "show warranty" for details.
> This GDB was configured as "x86_64-redhat-linux-gnu".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
>     <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from qdrouterd...
> [New LWP 1102256]
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/usr/lib64/libthread_db.so.1".
> Core was generated by `qdrouterd -c INTA.conf'.
> Program terminated with signal SIGABRT, Aborted.
> #0  0x00007f310faed9e5 in raise () from /usr/lib64/libc.so.6
> Missing separate debuginfos, use: dnf debuginfo-install cyrus-sasl-gssapi-2.1.27-4.fc32.x86_64 cyrus-sasl-lib-2.1.27-4.fc32.x86_64 cyrus-sasl-md5-2.1.27-4.fc32.x86_64 cyrus-sasl-plain-2.1.27-4.fc32.x86_64 glibc-2.31-4.fc32.x86_64 keyutils-libs-1.6-4.fc32.x86_64 krb5-libs-1.18.2-29.fc32.x86_64 libcom_err-1.45.5-3.fc32.x86_64 libdb-5.3.28-40.fc32.x86_64 libev-4.31-2.fc32.x86_64 libffi-3.1-24.fc32.x86_64 libgcc-10.2.1-9.fc32.x86_64 libselinux-3.0-5.fc32.x86_64 libuv-1.39.0-1.fc32.x86_64 libwebsockets-3.2.2-2.fc32.x86_64 libxcrypt-4.4.17-1.fc32.x86_64 openssl-libs-1.1.1g-1.fc32.x86_64 pcre2-10.35-8.fc32.x86_64 python3-libs-3.8.6-1.fc32.x86_64 zlib-1.2.11-21.fc32.x86_64
> (gdb) bt
> #0  0x00007f310faed9e5 in raise () from /usr/lib64/libc.so.6
> #1  0x00007f310fad6895 in abort () from /usr/lib64/libc.so.6
> #2  0x00007f310fad6769 in __assert_fail_base.cold () from /usr/lib64/libc.so.6
> #3  0x00007f310fae5e76 in __assert_fail () from /usr/lib64/libc.so.6
> #4  0x00007f3110138e05 in sys_mutex_lock (mutex=0x2182800) at /home/chug/git/qpid-dispatch/src/posix/threading.c:58
> #5  0x00007f311011a02f in notify_closed (container=0x216ab80, conn=0x7f30f4016e90, context=0x7f30f4033690) at /home/chug/git/qpid-dispatch/src/container.c:302
> #6  0x00007f311011a334 in close_handler (container=0x216ab80, conn=0x7f30f4112510, qd_conn=0x7f30f4016e90) at /home/chug/git/qpid-dispatch/src/container.c:375
> #7  0x00007f311011b6c1 in qd_container_handle_event (container=0x216ab80, event=0x2134690, conn=0x7f30f4112510, qd_conn=0x7f30f4016e90) at /home/chug/git/qpid-dispatch/src/container.c:751
> #8  0x00007f3110187180 in handle (qd_server=0x2130700, e=0x2134690, pn_conn=0x7f30f4112510, ctx=0x7f30f4016e90) at /home/chug/git/qpid-dispatch/src/server.c:1096
> #9  0x00007f31101892c4 in qd_connection_handle (c=0x7f30f4016e90, e=0x2134690) at /home/chug/git/qpid-dispatch/src/server.c:1777
> #10 0x00007f311018afa2 in handle_events (c=0x7f30f40476f0) at /home/chug/git/qpid-dispatch/src/http-libwebsockets.c:179
> #11 0x00007f311018ce96 in callback_amqpws (wsi=0x7f30f40a4d80, reason=LWS_CALLBACK_CLOSED, user=0x7f30f40476f0, in=0x0, len=0) at /home/chug/git/qpid-dispatch/src/http-libwebsockets.c:880
> #12 0x00007f310fc95d8e in __lws_close_free_wsi.part.0 () from /usr/lib64/libwebsockets.so.15
> #13 0x00007f310fc91379 in lws_context_destroy () from /usr/lib64/libwebsockets.so.15
> #14 0x00007f311018d20b in qd_http_server_free (hs=0x2109d80) at /home/chug/git/qpid-dispatch/src/http-libwebsockets.c:954
> #15 0x00007f3110187eaa in qd_server_free (qd_server=0x2130700) at /home/chug/git/qpid-dispatch/src/server.c:1383
> #16 0x00007f311011e343 in qd_dispatch_free (qd=0x1fb5610) at /home/chug/git/qpid-dispatch/src/dispatch.c:373
> #17 0x0000000000402626 in main_process (config_path=0x7ffe537887f3 "INTA.conf", python_pkgdir=0x404283 "/usr/lib/qpid-dispatch/python", test_hooks=false, fd=2)
>     at /home/chug/git/qpid-dispatch/router/src/main.c:119
> #18 0x00000000004030cf in main (argc=3, argv=0x7ffe53786d98) at /home/chug/git/qpid-dispatch/router/src/main.c:369
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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