[jira] [Commented] (PROTON-2568) Leak of addrinfo memory held by raw connection

2022-06-22 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on PROTON-2568:
-

Commit 9e461090c79fc4209f8977e2a850dc3a89fb2a01 in qpid-proton's branch 
refs/heads/main from Andrew Stitcher
[ https://gitbox.apache.org/repos/asf?p=qpid-proton.git;h=9e461090c ]

PROTON-2568: Free raw connection addrinfo in raw connection cleanup

This covers the case that the raw connection is cleaned up between
starting the connection and processing the event for actually
connecting the connection.


> Leak of addrinfo memory held by raw connection 
> ---
>
> Key: PROTON-2568
> URL: https://issues.apache.org/jira/browse/PROTON-2568
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: proton-c
>Affects Versions: proton-c-0.37.0, proton-c-0.38.0
>Reporter: Ken Giusti
>Assignee: Andrew Stitcher
>Priority: Major
> Attachments: fix.patch
>
>
> This leak can be triggered by running the skupper-router http1 unit test for 
> a single router, example:
> /usr/bin/python3.10 
> "/home/kgiusti/work/skupper/skupper-router/BUILD/tests/run.py" "-m" 
> "unittest" "-v" 
> "system_tests_http1_adaptor.Http1AdaptorOneRouterTest.test_001_get"
>  
> The leak occurs when skupper-router is attempting to connect to a remote HTTP 
> server via a raw connection but shuts down before any raw connection events 
> are processed (e.g. No PN_RAW_CONNECTION_CONNECTED or _DISCONNECTED).
> During shutdown the router frees the proactor and expects any outstanding raw 
> connection resources owned by it to be freed.
> I've traced the proactor shutdown logic, and when the leak occurs there is a 
> final call to praw_connection_cleanup() for the outstanding connection, but 
> the praw_connection_t still holds a pointer to the allocated addrinfo.  
> praw_connection_cleanup() frees the praw_connection_t but does not call 
> freeaddrinfo(prc->addrinfo) to release the addrinfo memory.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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



[jira] [Commented] (PROTON-2568) Leak of addrinfo memory held by raw connection

2022-06-22 Thread Andrew Stitcher (Jira)


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

Andrew Stitcher commented on PROTON-2568:
-

[~kgiusti] Thanks for debugging this!

This looks like the correct fix - annoyingly {{freeaddrinfo()}} does not 
document what it does with a null pointer so the null check seems necessary.

> Leak of addrinfo memory held by raw connection 
> ---
>
> Key: PROTON-2568
> URL: https://issues.apache.org/jira/browse/PROTON-2568
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: proton-c
>Affects Versions: proton-c-0.37.0, proton-c-0.38.0
>Reporter: Ken Giusti
>Assignee: Andrew Stitcher
>Priority: Major
> Attachments: fix.patch
>
>
> This leak can be triggered by running the skupper-router http1 unit test for 
> a single router, example:
> /usr/bin/python3.10 
> "/home/kgiusti/work/skupper/skupper-router/BUILD/tests/run.py" "-m" 
> "unittest" "-v" 
> "system_tests_http1_adaptor.Http1AdaptorOneRouterTest.test_001_get"
>  
> The leak occurs when skupper-router is attempting to connect to a remote HTTP 
> server via a raw connection but shuts down before any raw connection events 
> are processed (e.g. No PN_RAW_CONNECTION_CONNECTED or _DISCONNECTED).
> During shutdown the router frees the proactor and expects any outstanding raw 
> connection resources owned by it to be freed.
> I've traced the proactor shutdown logic, and when the leak occurs there is a 
> final call to praw_connection_cleanup() for the outstanding connection, but 
> the praw_connection_t still holds a pointer to the allocated addrinfo.  
> praw_connection_cleanup() frees the praw_connection_t but does not call 
> freeaddrinfo(prc->addrinfo) to release the addrinfo memory.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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



[jira] [Commented] (PROTON-2568) Leak of addrinfo memory held by raw connection

2022-06-21 Thread Ken Giusti (Jira)


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

Ken Giusti commented on PROTON-2568:


Added example fix.

> Leak of addrinfo memory held by raw connection 
> ---
>
> Key: PROTON-2568
> URL: https://issues.apache.org/jira/browse/PROTON-2568
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: proton-c
>Affects Versions: proton-c-0.37.0, proton-c-0.38.0
>Reporter: Ken Giusti
>Priority: Major
> Attachments: fix.patch
>
>
> This leak can be triggered by running the skupper-router http1 unit test for 
> a single router, example:
> /usr/bin/python3.10 
> "/home/kgiusti/work/skupper/skupper-router/BUILD/tests/run.py" "-m" 
> "unittest" "-v" 
> "system_tests_http1_adaptor.Http1AdaptorOneRouterTest.test_001_get"
>  
> The leak occurs when skupper-router is attempting to connect to a remote HTTP 
> server via a raw connection but shuts down before any raw connection events 
> are processed (e.g. No PN_RAW_CONNECTION_CONNECTED or _DISCONNECTED).
> During shutdown the router frees the proactor and expects any outstanding raw 
> connection resources owned by it to be freed.
> I've traced the proactor shutdown logic, and when the leak occurs there is a 
> final call to praw_connection_cleanup() for the outstanding connection, but 
> the praw_connection_t still holds a pointer to the allocated addrinfo.  
> praw_connection_cleanup() frees the praw_connection_t but does not call 
> freeaddrinfo(prc->addrinfo) to release the addrinfo memory.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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