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

Rafael H. Schloming commented on PROTON-800:
--------------------------------------------

I believe there are two relevant cases to consider when answering your 
question. If you assume you have a "parent" object (the pn_io_t) and a "child" 
object (the pn_socket_t) we actually follow two different patterns depending on 
the circumstances. In the case where the child object is a full fledged object, 
e.g. the parent is a pn_connection_t and the child is a pn_session_t, we have 
the parent keep a pointer to the child and keep it alive, so that the order of 
decref of the parent relative to the child doesn't matter.

The second case to consider is when the child is not actually an independent 
object, e.g. it might be a pn_handle_t rather than an actual pointer. (We use 
this pattern in the map API for example.) In these cases the life of the child 
is scoped to the parent and the order of decref is important.

In your case I think we have to assume the latter unless we turn pn_socket_t 
into a full-on pointer rather than just an alias for a file descriptor. I think 
this is fine so long as we are clear about the semantics.

> [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)

Reply via email to