drivers/cc2420: don't append to FIFO if iol->iol_len == 0#11331
Merged
miri64 merged 1 commit intoRIOT-OS:masterfrom Apr 2, 2019
Merged
drivers/cc2420: don't append to FIFO if iol->iol_len == 0#11331miri64 merged 1 commit intoRIOT-OS:masterfrom
miri64 merged 1 commit intoRIOT-OS:masterfrom
Conversation
This prevents SPI transfers with len == 0, which triggers an assert failure.
24 tasks
miri64
approved these changes
Apr 2, 2019
Member
miri64
left a comment
There was a problem hiding this comment.
I tested with z1. Since gnrc_networking is too big for that board, I used examples/default with txtsnd instead of the proposed testing procedures and sniffed the traffic.
Without this PR I can send non-zero payloads (see pkt 1 in wireshark screenshot beloow) but with an empty payload the node runs into an assertion:
> txtsnd 4 bcast "abcd"
2019-04-02 16:21:21,481 - INFO # txtsnd 4 bcast "abcd"
> txtsnd 4 bcast ""
2019-04-02 16:21:27,297 - INFO # txtsnd 4 bcast ""
2019-04-02 16:21:27,316 - INFO # n/a
2019-04-02 16:21:27,316 - INFO # *** RIOT kernel panic:
2019-04-02 16:21:27,316 - INFO # FAILED ASSERTION.
2019-04-02 16:21:27,316 - INFO #
2019-04-02 16:21:27,317 - INFO # pid | name | state Q | pri | stack ( used) | base addr | current
2019-04-02 16:21:27,324 - INFO # - | isr_stack | - - | - | 256 ( -1) | 0xffff | 0xffff
2019-04-02 16:21:27,332 - INFO # 1 | idle | pending Q | 15 | 96 ( 58) | 0x111a | 0x1140
2019-04-02 16:21:27,340 - INFO # 2 | main | pending Q | 7 | 512 ( 452) | 0x117a | 0x124e
2019-04-02 16:21:27,349 - INFO # 3 | pktdump | bl rx _ | 6 | 512 ( 148) | 0x1966 | 0x1ad4
2019-04-02 16:21:27,358 - INFO # 4 | cc2420 | running Q | 2 | 512 ( 408) | 0x155c | 0x15ca
2019-04-02 16:21:27,359 - INFO # | SUM | | | 1888 ( 1066)
2019-04-02 16:21:27,359 - INFO #
2019-04-02 16:21:27,359 - INFO # *** halted.
2019-04-02 16:21:27,359 - INFO #
2019-04-02 16:21:33,407 - INFO # Exiting Pyterm
With this PR everything I am also able to send empty payloads (see pkt 2 and 3 below):
> txtsnd 4 bcast "abcd"
2019-04-02 16:22:23,787 - INFO # txtsnd 4 bcast "abcd"
> txtsnd 4 bcast ""
2019-04-02 16:22:26,130 - INFO # txtsnd 4 bcast ""
So ACK.
Contributor
Author
|
Thanks @miri64 ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Contribution description
Fix assertion failure as described on #11163.
Testing procedure
See #11163 .
Issues/PRs references
#11163