[riot-notifications] [RIOT-OS/RIOT] sys: add unaligned.h (header for alignment safe value-from-pointer functions) (#10797)

Martine Lenders notifications at github.com
Thu Jan 24 12:56:12 CET 2019


miri64 commented on this pull request.

I tested on `native`, `samr21-xpro`, `z1`, and `arduino-mega2560` with the following patch to the unittests:

```diff
diff --git a/tests/unittests/tests-checksum/tests-checksum-fletcher32.c b/tests/unittests/tests-checksum/tests-checksum-fletcher32.c
index 7f5d428..90e24cf 100644
--- a/tests/unittests/tests-checksum/tests-checksum-fletcher32.c
+++ b/tests/unittests/tests-checksum/tests-checksum-fletcher32.c
@@ -46,13 +46,13 @@ static void test_checksum_fletcher32_empty(void)
 static void test_checksum_fletcher32_0to1_undetected(void)
 {
     /* fletcher cannot distinguish between all 0 and all 1 segments */
-    unsigned char buf0[16] = {
-        0xA1, 0xA1, 0xA1, 0xA1,
+    unsigned char buf0[17] = {
+        0x00, 0xA1, 0xA1, 0xA1, 0xA1,
         0x00, 0x00, 0x00, 0x00,
         0x00, 0x00, 0x00, 0x00,
         0x1A, 0x1A, 0x1A, 0x1A,
     };
-    uint32_t expect = fletcher32((const uint16_t *) buf0, sizeof(buf0)/2);
+    uint32_t expect = fletcher32((const uint16_t *) &buf0[1], (sizeof(buf0) - 1)/2);
     unsigned char buf1[16] = {
         0xA1, 0xA1, 0xA1, 0xA1,
         0xFF, 0xFF, 0xFF, 0xFF,
```

### master (https://github.com/RIOT-OS/RIOT/commit/d90d546053bbbb6c915ed1c711a8cbc9997ad81f)
#### `samr21-xpro`

Endless loop of crashes

```
2019-01-24 12:47:15,079 - INFO # Lr��j�5�j��ºj:��"�JR...........*** RIOT kernel panic:
2019-01-24 12:47:15,079 - INFO # HARD FAULT HANDLER
2019-01-24 12:47:15,079 - INFO # 
2019-01-24 12:47:15,079 - INFO # *** rebooting...
2019-01-24 12:47:15,080 - INFO # 
2019-01-24 12:47:15,080 - INFO # main(): This is RIOT! (Version: 2018.10-RC1-1187-gd90d5)
2019-01-24 12:47:15,080 - INFO # ...........*** RIOT kernel panic:
2019-01-24 12:47:15,080 - INFO # HARD FAULT HANDLER
2019-01-24 12:47:15,080 - INFO # 
2019-01-24 12:47:15,081 - INFO # *** rebooting...
2019-01-24 12:47:15,081 - INFO # 
2019-01-24 12:47:15,081 - INFO # main(): This is RIOT! (Version: 2018.10-RC1-1187-gd90d5)
2019-01-24 12:47:15,081 - INFO # ...........*** RIOT kernel panic:
2019-01-24 12:47:15,081 - INFO # HARD FAULT HANDLER
2019-01-24 12:47:15,081 - INFO # 
2019-01-24 12:47:15,082 - INFO # *** rebooting...
2019-01-24 12:47:15,082 - INFO # 
2019-01-24 12:47:15,082 - INFO # main(): This is RIOT! (Version: 2018.10-RC1-1187-gd90d5)
2019-01-24 12:47:15,082 - INFO # ...........*** RIOT kernel panic:
2019-01-24 12:47:15,082 - INFO # HARD FAULT HANDLER
2019-01-24 12:47:15,082 - INFO # 
2019-01-24 12:47:15,083 - INFO # *** rebooting...
2019-01-24 12:47:15,083 - INFO # 
2019-01-24 12:47:15,083 - INFO # main(): This is RIOT! (Version: 2018.10-RC1-1187-gd90d5)
2019-01-24 12:47:15,083 - INFO # ...........*** RIOT kernel panic:
2019-01-24 12:47:15,083 - INFO # HARD FAULT HANDLER
2019-01-24 12:47:15,083 - INFO # 
2019-01-24 12:47:15,084 - INFO # *** rebooting...
2019-01-24 12:47:15,084 - INFO # 
2019-01-24 12:47:15,084 - INFO # main(): This is RIOT! (Version: 2018.10-RC1-1187-gd90d5)
2019-01-24 12:47:15,084 - INFO # ...........*** RIOT kernel panic:
2019-01-24 12:47:15,084 - INFO # HARD FAULT HANDLER
2019-01-24 12:47:15,084 - INFO # 
2019-01-24 12:47:15,085 - INFO # *** rebooting...
2019-01-24 12:47:15,085 - INFO # 
2019-01-24 12:47:15,085 - INFO # main(): This is RIOT! (Version: 2018.10-RC1-1187-gd90d5)
2019-01-24 12:47:15,085 - INFO # ...........*** RIOT kernel panic:
2019-01-24 12:47:15,085 - INFO # HARD FAULT HANDLER
2019-01-24 12:47:15,085 - INFO # 
2019-01-24 12:47:15,086 - INFO # *** rebooting...
2019-01-24 12:47:15,086 - INFO # 
2019-01-24 12:47:15,086 - INFO # main(): This is RIOT! (Version: 2018.10-RC1-1187-gd90d5)
2019-01-24 12:47:15,086 - INFO # ...........*** RIOT kernel panic:
2019-01-24 12:47:15,086 - INFO # HARD FAULT HANDLER
2019-01-24 12:47:15,086 - INFO # 
2019-01-24 12:47:15,087 - INFO # *** rebooting...
2019-01-24 12:47:15,087 - INFO # 
```

#### `z1`

```
2019-01-24 12:46:41,504 - INFO # main(): This is RIOT! (Version: 2018.10-RC1-1187-gd90d5)
2019-01-24 12:46:41,517 - INFO # ...........
2019-01-24 12:46:41,523 - INFO # checksum_fletcher32_tests.test_checksum_fletcher32_0to1_undetected (tests/unittests/tests-checksum/tests-checksum-fletcher32.c 63) calc_and_compare_checksum(buf1, sizeof(buf1), expect)
2019-01-24 12:46:41,535 - INFO # ........
2019-01-24 12:46:41,538 - INFO # run 19 failures 1
```

#### `arduino-mega2560`

passes

#### `native`

passes

### This PR

All boards pass.

So also test ACK



-- 
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/pull/10797#pullrequestreview-195990643
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190124/f5d638eb/attachment.html>


More information about the notifications mailing list