[
https://issues.apache.org/jira/browse/DISPATCH-2109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17388626#comment-17388626
]
Jiri Daněk commented on DISPATCH-2109:
--------------------------------------
notes from offline discussion:
Looking at the backtrace in the JIRA. It does not exactly align with the line
numbers on mainline but it looks to me that the {{void
qdr_modules_finalize(qdr_core_t *core)}} function is called, and one of the
modules finalizers cause a core thread action to be added, and one of those
action callbacks is {{qdr_set_cost_CT}}. No actions should be added to the core
thread action list if {{core->running}} is false.
I was wondering if the function that enqueues the action - {{void
qdr_action_enqueue(qdr_core_t *core, qdr_action_t *action)}} - should assert on
{{core->running}}. It probably _should_, but I know there's a hacky "clean up
the action list after core exits" code section in the shutdown so I'm betting
you'll assert. A lot. You should fix it so that all the i/o threads complete,
then send a final "shutdown" action to the core instead. That + an assert
would be A Good Approach.
Good point. I was also thinking that in that function - {{void
qdr_action_enqueue(qdr_core_t *core, qdr_action_t *action)}} - instead of
asserting on {{core->running}}, what if we return a null action? The caller
upon calling {{qdr_action_enqueue()}} if s/he receives a null, they will clean
up their local variables and be done with it. The caller doesn't ever clean up
the parameters it passes in the action - you'll still have to invoke the action
with "{{discard=true}}" I think. Perhaps returning null will entail a LOT of
changes.
Oh well, would that be a simpler/less code approach, or would having the core
thread shut down after the I/O threads are done require less code? /hint: I've
thought about this alot. The former is surely not a less code approach. I
really have not thought about the latter approach.
Less code == less bugs. I'll just leave this here:
https://issues.apache.org/jira/browse/DISPATCH-2129. We should do as that JIRA
says. Whoever created that JIRA must be one brilliant guy.
This is one of the topics. Router Shutdown. Oh good - I love discussing router
shutdown... each and every time we do it.
> Shutdown crash: member access within null pointer of type 'struct qdr_node_t'
> -----------------------------------------------------------------------------
>
> Key: DISPATCH-2109
> URL: https://issues.apache.org/jira/browse/DISPATCH-2109
> Project: Qpid Dispatch
> Issue Type: Bug
> Affects Versions: 1.17.0
> Reporter: Jiri Daněk
> Assignee: Jiri Daněk
> Priority: Major
> Fix For: 1.17.0
>
>
> https://travis-ci.com/github/apache/qpid-dispatch/jobs/503812980#L4578
> {code}
> 28:
> /home/travis/build/apache/qpid-dispatch/src/router_core/route_tables.c:530:17:
> runtime error: member access within null pointer of type 'struct qdr_node_t'
> 28: #0 0x3ff9628d5bd in qdr_set_cost_CT
> /home/travis/build/apache/qpid-dispatch/src/router_core/route_tables.c:530
> 28: #1 0x3ff9627e7cb in qdr_core_free
> /home/travis/build/apache/qpid-dispatch/src/router_core/router_core.c:251
> 28: #2 0x3ff962e13f9 in qd_router_free
> /home/travis/build/apache/qpid-dispatch/src/router_node.c:2160
> 28: #3 0x3ff9617979d in qd_dispatch_free
> /home/travis/build/apache/qpid-dispatch/src/dispatch.c:375
> 28: #4 0x3ff9617979d in qd_dispatch_free
> /home/travis/build/apache/qpid-dispatch/src/dispatch.c:363
> 28: #5 0x2aa23604fa9 in main_process
> /home/travis/build/apache/qpid-dispatch/router/src/main.c:119
> 28: #6 0x2aa23604a23 in main
> /home/travis/build/apache/qpid-dispatch/router/src/main.c:369
> 28: #7 0x3ff94faa5f9 in __libc_start_main
> (/lib/s390x-linux-gnu/libc.so.6+0x2a5f9)
> 28: #8 0x2aa23604d23
> (/home/travis/build/apache/qpid-dispatch/build/router/qdrouterd+0x4d23)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]