Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaked termini and qdr_link_t at router shutdown #335

Closed
ganeshmurthy opened this issue Apr 14, 2022 · 1 comment
Closed

Leaked termini and qdr_link_t at router shutdown #335

ganeshmurthy opened this issue Apr 14, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ganeshmurthy
Copy link
Contributor

ganeshmurthy commented Apr 14, 2022

When a attach comes in just before router shutdown, the qdr_link_first_attach() is called which adds an action to the core thread with the qdr_link_inbound_first_attach_CT callback. When discard is true, qdr_link_inbound_first_attach_CT does not free the termini. It cannot free the qdr_link_t object since someone is holding its reference and that person might try to use it.
This leak can be reproduced intermittently by running the system_tests_http2_tls.py system test.

56: ERROR: Aborted due to unexpected alloc pool leak of type 'qdr_link_t'
56: 
56: <<<<
56: 
56: Router QDR debug dump file:
56: >>>>
56: alloc.c: Items of type 'qd_iterator_t' remain allocated at shutdown: 1 (SUPPRESSED)
56: alloc.c: Items of type 'qdr_field_t' remain allocated at shutdown: 1 (SUPPRESSED)
56: alloc.c: Items of type 'qd_buffer_t' remain allocated at shutdown: 1 (SUPPRESSED)
56: alloc.c: Items of type 'qdr_terminus_t' remain allocated at shutdown: 2
56: Leak: 2022-04-06 13:48:04.996099 +0000 type: qdr_terminus_t address: 0x612000035f50
56: /lib64/libasan.so.6(+0x44701) [0x7fba53ea6701]
56: skrouterd(qd_alloc+0x1fe) [0x4c064e]
56: skrouterd(qdr_terminus+0x2e) [0x6226ae]
56: skrouterd() [0x6c6f67]
56: skrouterd() [0x6d27f2]
56: skrouterd() [0x67aa85]
56: skrouterd() [0x682156]
56: /lib64/libc.so.6(+0x8db1a) [0x7fba528b4b1a]
56: /lib64/libc.so.6(+0x112660) [0x7fba5[2939](https://github.com/skupperproject/skupper-router/runs/5851875396?check_suite_focus=true#step:26:2939)660]
56: 
56: Leak: 2022-04-06 13:48:04.996123 +0000 type: qdr_terminus_t address: 0x612000035dd0
56: /lib64/libasan.so.6(+0x44701) [0x7fba53ea6701]
56: skrouterd(qd_alloc+0x1fe) [0x4c064e]
56: skrouterd(qdr_terminus+0x2e) [0x6226ae]
56: skrouterd() [0x6c7009]
56: skrouterd() [0x6d27f2]
56: skrouterd() [0x67aa85]
56: skrouterd() [0x682156]
56: /lib64/libc.so.6(+0x8db1a) [0x7fba528b4b1a]
56: /lib64/libc.so.6(+0x112660) [0x7fba52939660]
56: 
56: alloc.c: Items of type 'qdr_link_t' remain allocated at shutdown: 1
56: Leak: 2022-04-06 13:48:04.996134 +0000 type: qdr_link_t address: 0x617000085490
56: /lib64/libasan.so.6(+0x44701) [0x7fba53ea6701]
56: skrouterd(qd_alloc+0x1fe) [0x4c064e]
56: skrouterd(qdr_link_first_attach+0x42) [0x5a4332]
56: skrouterd() [0x6c7047]
56: skrouterd() [0x6d27f2]
56: skrouterd() [0x67aa85]
56: skrouterd() [0x682156]
56: /lib64/libc.so.6(+0x8db1a) [0x7fba528b4b1a]
56: /lib64/libc.so.6(+0x112660) [0x7fba52939660]
56: 
56: alloc.c: Items of type 'qd_http2_buffer_t' remain allocated at shutdown: 1 (SUPPRESSED)

https://github.com/skupperproject/skupper-router/runs/5851875396?check_suite_focus=true#step:26:2902

@ganeshmurthy ganeshmurthy added the bug Something isn't working label Apr 14, 2022
@ganeshmurthy ganeshmurthy added this to the 2.1.0 milestone Apr 14, 2022
@ganeshmurthy
Copy link
Contributor Author

Upon @kgiusti 's advice I will upload a partial fix for this issue. The fix will just free the termini objects and suppress the qdr_link_t leak

ganeshmurthy added a commit to ganeshmurthy/skupper-router that referenced this issue Apr 14, 2022
…g it to the suppression list. The termini objects can be freed since we have ownership of those objects
ganeshmurthy added a commit that referenced this issue Apr 14, 2022
#336)

* #335: Partially address the leak of qdr_link_t by adding it to the suppression list. The termini objects can be freed since we have ownership of those objects

* Code review change. Removed the if discard check. We own the termini and we have to free it before returning
@ganeshmurthy ganeshmurthy modified the milestones: 2.1.0, 2.2.0 Sep 30, 2022
@ganeshmurthy ganeshmurthy modified the milestones: 2.2.0, 2.3.0 Nov 11, 2022
@ganeshmurthy ganeshmurthy modified the milestones: 2.3.0, 2.4.0 Feb 6, 2023
@ganeshmurthy ganeshmurthy modified the milestones: 2.4.0, 2.5.0 Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants