apache / apache/nuttx

Assertion fails while freeing IOBs.

Open
#8,533 9 comments 0 reactions 1 assignee Claimed by @anchao View on GitHub
Dominant language
C
Stars
4k
Forks
1.7k
Avg merge
1d 17h
Merged PRs (30d)
237

Description

I constantly get the following assertion to fail:

`mm/iob/iob_free.c:100`

```c
/* Copy and decrement the total packet length, being careful to
* do nothing too crazy.
*/

if (iob->io_pktlen > iob->io_len)
{
/* Adjust packet length and move it to the next entry */

next->io_pktlen = iob->io_pktlen - iob->io_len;
DEBUGASSERT(next->io_pktlen >= next->io_len);
}
```

At least for me, the failure seems to be triggered while I am using a custom TCP server (mostly when connections are closed).

I haven't been able to find any specific commit that is suspicious.

Unfortunately, I am also not able to reproduce the issue reliably.
It randomly happens, sometimes almost immediately when connections are closed, sometimes everything seems fine for extended periods of time.

I would appreciate any hint as to what to look for to fix this.

---

As a reference, this is the stack trace at the moment of the failure:

![image](https://user-images.githubusercontent.com/46975045/218873931-e3f51cfc-1fbf-4896-9202-9f304b1bde4f.png)

*(Moved from the apps repo, [where](https://github.com/apache/nuttx-apps/issues/1562) I accidentally opened the issue.)*

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.