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

Robert Hartung hartung at ibr.cs.tu-bs.de
Thu Oct 27 10:23:22 CEST 2016


Oh ... thanks a lot! I was using [1] as a basic example and just
assigned 10 to Q_SZ - as there was no complete example.

[1] http://riot-os.org/api/group__net__gnrc.html

Best Regards,
Robert

On 27.10.2016 10:18, Martine Lenders wrote:
> Hi,
> 
> 2016-10-27 9:56 GMT+02:00 Robert Hartung <hartung at ibr.cs.tu-bs.de
> <mailto: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
> <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
> <mailto: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 <tel:%2B49%20%28531%29%20391%20-%203264>
>     Fax: +49 (531) 391 - 5936 <tel:%2B49%20%28531%29%20391%20-%205936>
>     E-Mail: hartung at ibr.cs.tu-bs.de <mailto:hartung at ibr.cs.tu-bs.de>
> 
>     _______________________________________________
>     users mailing list
>     users at riot-os.org <mailto:users at riot-os.org>
>     https://lists.riot-os.org/mailman/listinfo/users
>     <https://lists.riot-os.org/mailman/listinfo/users>
> 
> 
> 
> 
> _______________________________________________
> users mailing list
> users at riot-os.org
> https://lists.riot-os.org/mailman/listinfo/users
> 

-- 
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


More information about the users mailing list