[riot-notifications] [RIOT-OS/RIOT] gnrc: packet space in gnrc packet buffer is not released on very heavy load (#10701)

Martine Lenders notifications at github.com
Tue Jan 15 19:11:38 CET 2019


> * This ICMPv6 can either be an Echo request or an Echo reply.

Ok, I don't see echo replies (but for me the pinging nodes are always clean, but that might be just a timing issue). 

With the following diff (and the one from before)

```diff
diff --git a/sys/net/gnrc/network_layer/sixlowpan/frag/gnrc_sixlowpan_frag.c b/sys/net/gnrc/network_layer/sixlowpan/frag/gnrc_sixlowpan_frag.c
index 835b607..96ec9d7 100644
--- a/sys/net/gnrc/network_layer/sixlowpan/frag/gnrc_sixlowpan_frag.c
+++ b/sys/net/gnrc/network_layer/sixlowpan/frag/gnrc_sixlowpan_frag.c
@@ -363,6 +363,17 @@ void gnrc_sixlowpan_frag_rbuf_dispatch_when_complete(gnrc_sixlowpan_rbuf_t *rbuf
         new_netif_hdr->lqi = netif_hdr->lqi;
         new_netif_hdr->rssi = netif_hdr->rssi;
         LL_APPEND(rbuf->pkt, netif);
+        if (rbuf->pkt->size > 48) {
+            uint8_t *data = (uint8_t *)rbuf->pkt->data;
+            if (data[40] == 0x80) {
+                printf("id: %02x%02x, seq: %02x%02x complete\n",
+                       data[44], data[45],
+                       data[46], data[47]);
+                if (rbuf->pkt->size == 1280) {
+                    printf("data[1279] = %02x\n", data[1279]);
+                }
+            }
+        }
         gnrc_sixlowpan_dispatch_recv(rbuf->pkt, NULL, 0);
         gnrc_sixlowpan_frag_rbuf_remove(rbuf);
     }
```

I was able to confirm that the sticky package is indeed handed over broken by the reassembly buffer so somehow it registers as complete, while not actually being (or for some reason it wasn't copied properly...):

```
2019-01-15 18:57:52,904 - INFO #  id: 005a, seq: 0001 complete
2019-01-15 18:57:52,906 - INFO # data[1279] = 5a
2019-01-15 18:57:53,088 - INFO # id: 005a, seq: 0002 complete
2019-01-15 18:57:53,090 - INFO # data[1279] = 5a
2019-01-15 18:57:54,164 - INFO # id: 005a, seq: 0003 complete
2019-01-15 18:57:54,166 - INFO # data[1279] = 5a
2019-01-15 18:57:54,412 - INFO # id: 0059, seq: 0002 complete
2019-01-15 18:57:54,414 - INFO # data[1279] = 59
2019-01-15 18:57:55,246 - INFO # id: 005a, seq: 0004 complete
2019-01-15 18:57:55,247 - INFO # data[1279] = 5a
2019-01-15 18:57:55,501 - INFO # id: 0059, seq: 0003 complete
2019-01-15 18:57:55,503 - INFO # data[1279] = 59
2019-01-15 18:57:56,331 - INFO # id: 005a, seq: 0005 complete
2019-01-15 18:57:56,333 - INFO # data[1279] = 5a
2019-01-15 18:57:56,542 - INFO # id: 005a, seq: 0006 complete
2019-01-15 18:57:56,544 - INFO # data[1279] = 5a
2019-01-15 18:57:59,774 - INFO # id: 005a, seq: 0009 complete
2019-01-15 18:57:59,775 - INFO # data[1279] = 5a
2019-01-15 18:57:59,988 - INFO # id: 005a, seq: 000a complete
2019-01-15 18:57:59,990 - INFO # data[1279] = 88
2019-01-15 18:58:00,058 - INFO # id: 0059, seq: 0007 complete
2019-01-15 18:58:00,059 - INFO # data[1279] = 59
2019-01-15 18:58:01,140 - INFO # id: 0059, seq: 0008 complete
2019-01-15 18:58:01,141 - INFO # data[1279] = 59
2019-01-15 18:58:02,227 - INFO # id: 0059, seq: 0009 complete
2019-01-15 18:58:02,228 - INFO # data[1279] = 59
2019-01-15 18:58:03,306 - INFO # id: 0059, seq: 000a complete
2019-01-15 18:58:03,308 - INFO # data[1279] = 59
```

Note the 88 at `2019-01-15 18:57:59,990`

(I intentionally put the pinging nodes out of sync with the ID to be able to distinguish their messages).

The state of the packet buffer was:

```
2019-01-15 18:58:17,569 - INFO # pktbuf
2019-01-15 18:58:17,576 - INFO # packet buffer: first byte: 0x20001afc, last byte: 0x200032fc (size: 6144)
2019-01-15 18:58:17,579 - INFO #   position of last byte used: 5720
2019-01-15 18:58:17,584 - INFO # =========== chunk   0 (0x20001afc size:   48) ===========
2019-01-15 18:58:17,591 - INFO # 00000000  44  1B  00  20  64  1C  00  20  28  00  00  00  01  00  00  00
2019-01-15 18:58:17,597 - INFO # 00000010  02  88  88  88  88  88  88  88  FC  1A  00  20  8C  1C  00  20
2019-01-15 18:58:17,604 - INFO # 00000020  D8  04  00  00  01  00  00  00  03  88  88  88  88  88  88  88
2019-01-15 18:58:17,609 - INFO # ~ unused: 0x20001b2c (next: 0x20001b74, size:   24) ~
2019-01-15 18:58:17,614 - INFO # =========== chunk   1 (0x20001b44 size:   48) ===========
2019-01-15 18:58:17,621 - INFO # 00000000  00  00  00  00  5C  1B  00  20  18  00  00  00  01  00  00  00
2019-01-15 18:58:17,627 - INFO # 00000010  FF  88  88  88  88  88  88  88  08  08  07  00  00  FF  D1  FF
2019-01-15 18:58:17,634 - INFO # 00000020  79  65  08  22  86  93  9D  5A  79  65  3B  4C  F3  BB  EE  A2
2019-01-15 18:58:17,639 - INFO # ~ unused: 0x20001b74 (next: 0x20002164, size:  240) ~
2019-01-15 18:58:17,644 - INFO # =========== chunk   2 (0x20001c64 size: 1280) ===========
2019-01-15 18:58:17,650 - INFO # 00000000  60  00  00  00  04  D8  3A  40  FE  80  00  00  00  00  00  00
2019-01-15 18:58:17,657 - INFO # 00000010  7B  65  08  22  86  93  9D  5A  FE  80  00  00  00  00  00  00
2019-01-15 18:58:17,663 - INFO # 00000020  7B  65  3B  4C  F3  BB  EE  A2  80  00  D3  97  00  5A  00  0A
2019-01-15 18:58:17,670 - INFO # 00000030  5A  5A  5A  5A  5A  5A  5A  5A  5A  5A  5A  5A  5A  5A  5A  5A
...
2019-01-15 18:58:18,089 - INFO # 00000430  5A  5A  5A  5A  5A  5A  5A  5A  5A  5A  5A  5A  5A  5A  5A  5A
2019-01-15 18:58:18,096 - INFO # 00000440  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88
2019-01-15 18:58:18,102 - INFO # 00000450  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88
2019-01-15 18:58:18,109 - INFO # 00000460  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88
2019-01-15 18:58:18,115 - INFO # 00000470  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88
2019-01-15 18:58:18,122 - INFO # 00000480  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88
2019-01-15 18:58:18,128 - INFO # 00000490  88  88  88  88  88  88  88  88  6C  26  00  20  70  00  00  00
2019-01-15 18:58:18,135 - INFO # 000004A0  88  88  88  88  88  88  88  88  CC  26  00  20  60  00  00  00
2019-01-15 18:58:18,142 - INFO # 000004B0  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88
2019-01-15 18:58:18,148 - INFO # 000004C0  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88
2019-01-15 18:58:18,155 - INFO # 000004D0  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88
2019-01-15 18:58:18,161 - INFO # 000004E0  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88
2019-01-15 18:58:18,168 - INFO # 000004F0  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88  88
```

Note that the id (position 0x02b in chunk 2) and seq (0x02e) are identical with the provided packet that was broken.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/10701#issuecomment-454493526
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190115/4f186446/attachment.html>


More information about the notifications mailing list