[
https://issues.apache.org/jira/browse/PROTON-800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14278397#comment-14278397
]
Cliff Jansen commented on PROTON-800:
-------------------------------------
The memory fault in the stack trace occurs from pn_io_t use (pn_close) after
the io
has been released.
It can be made to go away simply by moving the first two lines:
pn_decref(reactor->selector);
pn_decref(reactor->io);
pn_decref(reactor->collector);
pn_decref(reactor->handler);
pn_decref(reactor->children);
to the end of pn_reactor_finalize(...) so that the pn_io_t is the last to be
(possibly) freed. This matches the use in messenger where created objects are
released in reverse order.
So question #1 is does the overall API imply that pn_io_t objects, which are
created
first because so much else depends on them, should be freed/decref_ed last? The
answer to this has deep implications on the Windows io code which has to do many
Linuxy kernel things in user space on cleanup. The Windows IO code assumes the
answer is yes. If that is wrong, it needs to do extra ref counting to know
when the
IO really is being shut down.
On a completely separate note, fixing the above issue does not fix this JIRA,
it just
moves the problem a small distance. It still hangs waiting for some IO event
in a
pn_selector_select call. Sadly it is not related to
363ea5031d26bc19cd12e113e8b365d398120dea, but I will fix that anyway separate
from
this JIRA. Thanks very much for the heads up in any case.
Investigation continues...
> [Windows C] Reactor test times out
> ----------------------------------
>
> Key: PROTON-800
> URL: https://issues.apache.org/jira/browse/PROTON-800
> Project: Qpid Proton
> Issue Type: Bug
> Components: proton-c
> Affects Versions: 0.8
> Environment: Windows Server 2012 R2, Visual Studio 2010 x64
> Reporter: Chuck Rolke
>
> ctest -VV times out on the reactor test.
> Instrumenting and debugging shows the failure in test_reactor_acceptor
> Running Debug instead of RelWithDebInfo crashes with an AccVio
> {noformat}
> > qpid-protond.dll!pni_iocpdesc_map_get(iocp_t * iocp, unsigned __int64
> > s) Line 773 + 0xa bytes C++
> qpid-protond.dll!pn_close(pn_io_t * io, unsigned __int64 socket) Line
> 350 + 0x16 bytes C++
> qpid-protond.dll!pni_acceptor_finalize(pn_selectable_t * sel) Line 56
> C++
> qpid-protond.dll!pn_selectable_finalize(void * obj) Line 81 C++
> qpid-protond.dll!pn_class_decref(const pn_class_t * clazz, void *
> object) Line 100 C++
> qpid-protond.dll!pn_list_finalize(void * object) Line 205 C++
> qpid-protond.dll!pn_class_decref(const pn_class_t * clazz, void *
> object) Line 100 C++
> qpid-protond.dll!pn_decref(void * object) Line 253 C++
> qpid-protond.dll!pn_reactor_finalize(pn_reactor_t * reactor) Line 77
> C++
> qpid-protond.dll!pn_reactor_finalize_cast(void * object) Line 113 +
> 0x28 bytes C++
> qpid-protond.dll!pn_class_decref(const pn_class_t * clazz, void *
> object) Line 100 C++
> qpid-protond.dll!pn_decref(void * object) Line 253 C++
> qpid-protond.dll!pn_reactor_free(pn_reactor_t * reactor) Line 132
> C++
> c-reactor-tests.exe!test_reactor_acceptor() Line 171 C++
> c-reactor-tests.exe!main(int argc, char * * argv) Line 446 C++
> c-reactor-tests.exe!__tmainCRTStartup() Line 555 + 0x19 bytes C
> c-reactor-tests.exe!mainCRTStartup() Line 371 C
> kernel32.dll!00007ff90cc913d2()
> [Frames below may be incorrect and/or missing, no symbols loaded for
> kernel32.dll]
> ntdll.dll!00007ff90e1003c4()
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)