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

Bluetooth: assertion fail with basic repeated extended advertisement API #29101

Closed
pabigot opened this issue Oct 10, 2020 · 0 comments · Fixed by #29104
Closed

Bluetooth: assertion fail with basic repeated extended advertisement API #29101

pabigot opened this issue Oct 10, 2020 · 0 comments · Fixed by #29104
Assignees
Labels
area: Bluetooth bug The issue is a bug, or the PR is fixing a bug

Comments

@pabigot
Copy link
Collaborator

pabigot commented Oct 10, 2020

The head commit on https://github.com/pabigot/zephyr/tree/testing/extadv modifies the beacon sample to use extended advertising to control the frequency of advertisements. It creates an advertising set, configures it for one transmission, then after the transmission completes schedules another transmission five seconds later.

The program aborts with the following error after the fifth transmission completes.

ASSERTION FAIL [delta <= 0 || mem_link_rx.quota_pdu < ((1 + 3) + 2)] @ WEST_TOPDIR/zephyr/subsys/bluetooth/controller/ll_sw
/ull.c:1047
[00:00:20.298,889] <err> os: r0/a1:  0x00000003  r1/a2:  0x0000000a  r2/a3:  0x00000000
[00:00:20.298,889] <err> os: r3/a4:  0x00001c15 r12/ip:  0x00000000 r14/lr:  0x00005f2d
[00:00:20.298,889] <err> os:  xpsr:  0x61000000
[00:00:20.298,919] <err> os: Faulting instruction address (r15/pc): 0x00005f38
[00:00:20.298,919] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
[00:00:20.298,919] <err> os: Current thread: 0x20000690 (unknown)
[00:00:20.344,268] <err> os: Halting system

Analysis shows that the increment at https://github.com/zephyrproject-rtos/zephyr/blob/master/subsys/bluetooth/controller/ll_sw/ull.c#L984 is not paired with a decrement anywhere, when processing a link node of type NODE_RX_TYPE_EXT_ADV_TERMINATE.

@pabigot pabigot added the bug The issue is a bug, or the PR is fixing a bug label Oct 10, 2020
cvinayak added a commit to cvinayak/zephyr that referenced this issue Oct 11, 2020
NODE_RX_TYPE_EXT_ADV_TERMINATE is generated in ULL context
and shall not increment received PDU quota value.

Fixes zephyrproject-rtos#29101.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
carlescufi pushed a commit that referenced this issue Oct 13, 2020
NODE_RX_TYPE_EXT_ADV_TERMINATE is generated in ULL context
and shall not increment received PDU quota value.

Fixes #29101.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants