[riot-users] corrupt memory / pktbuf when queue size is changed

Martine Lenders mlenders at inf.fu-berlin.de
Thu Oct 27 10:18:13 CEST 2016


Hi,

2016-10-27 9:56 GMT+02:00 Robert Hartung <hartung at ibr.cs.tu-bs.de>:

> Hello everyone,
>
> I am trying to send IEEE 802.15.4 frames between two telosb nodes. The
> code is attached. It works well if I send a single packet, but not if I
> send 10 packets. The output I get is:
>
> 2016-10-27 09:33:50,232 - INFO # Packet(0x1cbe) #0: hallo?
> 2016-10-27 09:33:50,263 - INFO # Packet(0x1db6) #7: hallo?
> 2016-10-27 09:33:50,293 - INFO # Packet(0x1e02) #8: hallo?
> 2016-10-27 09:33:50,320 - INFO # Packet(0x1db6) #62:
>
> You can see, that the 4th packet is corrupt. When I change the
> RCV_QUEUE_SIZE to 5 the output changes to:
>
> 2016-10-27 09:35:33,096 - INFO # Packet(0x1c96) #0: hallo?
> 2016-10-27 09:35:33,127 - INFO # Packet(0x1d2e) #4: hallo?
> 2016-10-27 09:35:33,155 - INFO # Packet(0x1d2e) #132:
>
> When I change the RCV_QUEUE_SIZE to 8, I magically receive the packets.
> And this bug does not occur!
>
> Can anyone tell me why this happens? Do I need to change some size,
> stack size, whatsoever?


It's not magic if you keep the requirements for the message queue. It must
be a power of two ;-) [1]! I proposed a fix to the doc to make this even
more visible [2].

Kind regards,
Martine

[1] http://doc.riot-os.org/group__core__msg.html#
ga480e6f32c8ab18579b62a890f3fda2cd
[2] https://github.com/RIOT-OS/RIOT/pull/6003

2016-10-27 9:56 GMT+02:00 Robert Hartung <hartung at ibr.cs.tu-bs.de>:

> Hello everyone,
>
> I am trying to send IEEE 802.15.4 frames between two telosb nodes. The
> code is attached. It works well if I send a single packet, but not if I
> send 10 packets. The output I get is:
>
> 2016-10-27 09:33:50,232 - INFO # Packet(0x1cbe) #0: hallo?
> 2016-10-27 09:33:50,263 - INFO # Packet(0x1db6) #7: hallo?
> 2016-10-27 09:33:50,293 - INFO # Packet(0x1e02) #8: hallo?
> 2016-10-27 09:33:50,320 - INFO # Packet(0x1db6) #62:
>
> You can see, that the 4th packet is corrupt. When I change the
> RCV_QUEUE_SIZE to 5 the output changes to:
>
> 2016-10-27 09:35:33,096 - INFO # Packet(0x1c96) #0: hallo?
> 2016-10-27 09:35:33,127 - INFO # Packet(0x1d2e) #4: hallo?
> 2016-10-27 09:35:33,155 - INFO # Packet(0x1d2e) #132:
>
> When I change the RCV_QUEUE_SIZE to 8, I magically receive the packets.
> And this bug does not occur!
>
> Can anyone tell me why this happens? Do I need to change some size,
> stack size, whatsoever?
>
> Best Regards,
> Robert
>
> --
> Robert Hartung, M.Sc.
>
> Technische Universität Braunschweig
> Institut für Betriebssysteme und Rechnerverbund
> Mühlenpfordtstr. 23, Raum 115
> 38106 Braunschweig
>
> Fon: +49 (531) 391 - 3264
> Fax: +49 (531) 391 - 5936
> E-Mail: hartung at ibr.cs.tu-bs.de
>
> _______________________________________________
> users mailing list
> users at riot-os.org
> https://lists.riot-os.org/mailman/listinfo/users
>
>
-------------- nächster Teil --------------
Ein Dateianhang mit HTML-Daten wurde abgetrennt...
URL: <http://lists.riot-os.org/pipermail/users/attachments/20161027/652da657/attachment.html>


More information about the users mailing list