Skip to content

Conversation

theob-pro
Copy link
Contributor

@theob-pro theob-pro commented Aug 13, 2024

Fixes #77006
Fixes #77007

Add a test to reproduce those issues.

When disconnected while sending data, if ISO doesn't get the number of
completed packets it will not call `process_unack_tx` and thus will leak
TX context.

Fix that by setting the connection state in ISO disconnection which will
trigger a call to `process_unack_tx`.

Signed-off-by: Théo Battrel <[email protected]>
@theob-pro theob-pro added bug The issue is a bug, or the PR is fixing a bug area: Bluetooth area: Bluetooth Host Bluetooth Host (excluding BR/EDR) labels Aug 13, 2024
@zephyrbot zephyrbot added the platform: nRF BSIM Nordic Semiconductors, nRF BabbleSim label Aug 13, 2024
@theob-pro theob-pro force-pushed the prop-tx-iso-frag-fix branch from e2d8225 to 8aaddb9 Compare August 13, 2024 12:53
@jhedberg
Copy link
Member

Screenshot 2024-08-13 at 15 54 15
@theob-pro you need to list the affected issues each on its own line (Fixes #...) or GitHub doesn't recognize the linkage.

@theob-pro
Copy link
Contributor Author

theob-pro commented Aug 13, 2024

@theob-pro you need to list the affected issues each on its own line (Fixes #...) or GitHub doesn't recognize the linkage.

Oh yeah true, thanks!

@jhedberg jhedberg assigned Thalley and unassigned jhedberg and jori-nordic Aug 13, 2024
alwa-nordic
alwa-nordic previously approved these changes Aug 13, 2024
jhedberg
jhedberg previously approved these changes Aug 13, 2024
@theob-pro theob-pro dismissed stale reviews from jhedberg and alwa-nordic via 1b09f4b August 14, 2024 04:53
@theob-pro theob-pro force-pushed the prop-tx-iso-frag-fix branch from 8aaddb9 to 1b09f4b Compare August 14, 2024 04:53
When sending data using ISO and the data is fragmented, if the
connection is cut before all the fragments are sent, the data buffer
will be leaked.

Fix the issue by unref'ing the buffer when ISO is not in a connected
state.

Signed-off-by: Théo Battrel <[email protected]>
@theob-pro theob-pro force-pushed the prop-tx-iso-frag-fix branch from 1b09f4b to f008309 Compare August 14, 2024 08:20
jori-nordic
jori-nordic previously approved these changes Aug 14, 2024
jhedberg
jhedberg previously approved these changes Aug 14, 2024
Copy link
Contributor

@Thalley Thalley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to get backported?

@jori-nordic jori-nordic added the backport v3.7-branch Request backport to the v3.7-branch label Aug 14, 2024
@jori-nordic jori-nordic added this to the v3.7.1 milestone Aug 14, 2024
This test create a setup where an ISO broadcaster will send fragmented
data and get stopped after sending the first fragment and repeating that
operation multiple time to verify that buffers are not leaked.

Signed-off-by: Théo Battrel <[email protected]>
@theob-pro theob-pro dismissed stale reviews from jhedberg and jori-nordic via 1fca0b9 August 16, 2024 05:20
@theob-pro theob-pro force-pushed the prop-tx-iso-frag-fix branch from f008309 to 1fca0b9 Compare August 16, 2024 05:20
@fabiobaltieri fabiobaltieri merged commit f3dcaae into zephyrproject-rtos:main Aug 16, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Host Bluetooth Host (excluding BR/EDR) area: Bluetooth backport v3.7-branch Request backport to the v3.7-branch bug The issue is a bug, or the PR is fixing a bug platform: nRF BSIM Nordic Semiconductors, nRF BabbleSim
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bluetooth: Host: ISO not clearing TX context on disconnect Bluetooth: Host: ISO buffer not unreffed
7 participants