[riot-notifications] [RIOT-OS/RIOT] tests/thread_float: broken on AVR (#16896)

Marian Buschsieweke notifications at github.com
Tue Sep 28 12:27:39 CEST 2021


Which board and toolchain are you using? I cannot reproduce, here is my output:

```
2021-09-28 12:23:58,394 # main(): This is RIOT! (Version: 2021.10-devel-792-g454c8-cpu/avr8_common/ldscripts)
2021-09-28 12:23:58,411 # THREADS CREATED
2021-09-28 12:23:58,412 # 
2021-09-28 12:23:58,459 # TTTHHHRRREEEAAADDD   ttt231   ssstttaaarrrttt
2021-09-28 12:23:58,460 # 
2021-09-28 12:23:58,462 # 
2021-09-28 12:24:01,497 # t3: ?
2021-09-28 12:24:01,505 # t1: ?
2021-09-28 12:24:04,536 # t3: ?
2021-09-28 12:24:04,544 # t1: ?
2021-09-28 12:24:07,575 # t3: ?
2021-09-28 12:24:07,583 # t1: ?
2021-09-28 12:24:10,614 # t3: ?
2021-09-28 12:24:10,622 # t1: ?
2021-09-28 12:24:13,653 # t3: ?
2021-09-28 12:24:13,661 # t1: ?
2021-09-28 12:24:16,692 # t3: ?
2021-09-28 12:24:16,701 # t1: ?
2021-09-28 12:24:19,732 # t3: ?
2021-09-28 12:24:19,740 # t1: ?
2021-09-28 12:24:22,771 # t3: ?
2021-09-28 12:24:22,779 # t1: ?
2021-09-28 12:24:25,810 # t3: ?
2021-09-28 12:24:25,818 # t1: ?
2021-09-28 12:24:28,849 # t3: ?
2021-09-28 12:24:28,857 # t1: ?
2021-09-28 12:24:31,888 # t3: ?
2021-09-28 12:24:31,896 # t1: ?
2021-09-28 12:24:34,927 # t3: ?
2021-09-28 12:24:34,935 # t1: ?
2021-09-28 12:24:37,966 # t3: ?
2021-09-28 12:24:37,974 # t1: ?
2021-09-28 12:24:41,005 # t3: ?
2021-09-28 12:24:41,013 # t1: ?
2021-09-28 12:24:44,047 # t3: ?
2021-09-28 12:24:44,055 # t1: ?
2021-09-28 12:24:47,088 # t3: ?
2021-09-28 12:24:47,096 # t1: ?
2021-09-28 12:24:50,130 # t3: ?
2021-09-28 12:24:50,138 # t1: ?
2021-09-28 12:24:53,171 # t3: ?
2021-09-28 12:24:53,181 # t1: ?
2021-09-28 12:24:56,216 # t3: ?
2021-09-28 12:24:56,224 # t1: ?
```

after applying this:

```diff
diff --git a/tests/thread_float/main.c b/tests/thread_float/main.c
index 693e127dfa..f0387d5580 100644
--- a/tests/thread_float/main.c
+++ b/tests/thread_float/main.c
@@ -46,11 +46,9 @@ static void timer_cb(void *arg)
 
 static void *thread1(void *arg)
 {
-    (void) arg;
-
     float f, init;
 
-    printf("THREAD %" PRIkernel_pid " start\n", thread_getpid());
+    printf("THREAD %s start\n", (const char *)arg);
 
     init = 1.0 * thread_getpid();
     f = init;
@@ -60,7 +58,7 @@ static void *thread1(void *arg)
             f = f + 1.0 / f;
         }
         mutex_lock(&lock);
-        printf("T(%" PRIkernel_pid "): %f\n", thread_getpid(), (double)f);
+        printf("%s: %f\n", (const char *)arg, (double)f);
         mutex_unlock(&lock);
         init += 1.0;
         f = init;
@@ -70,11 +68,9 @@ static void *thread1(void *arg)
 
 static void *thread2(void *arg)
 {
-    (void) arg;
-
     float f, init;
 
-    printf("THREAD %" PRIkernel_pid " start\n", thread_getpid());
+    printf("THREAD %s start\n", (const char *)arg);
 
     init = 1.0 * thread_getpid();
     f = init;
@@ -91,15 +87,18 @@ static void *thread2(void *arg)
 
 int main(void)
 {
+    const char *t1_name = "t1";
+    const char *t2_name = "t2";
+    const char *t3_name = "t3";
     p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN + 1,
                        THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
-                       thread1, NULL, "nr1");
+                       thread1, (void *)t1_name, t1_name);
     p2 = thread_create(t2_stack, sizeof(t2_stack), THREAD_PRIORITY_MAIN + 1,
                        THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
-                       thread2, NULL, "nr2");
+                       thread2, (void *)t2_name, t2_name);
     p3 = thread_create(t3_stack, sizeof(t3_stack), THREAD_PRIORITY_MAIN + 1,
                        THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
-                       thread1, NULL, "nr3");
+                       thread1, (void *)t3_name, t3_name);
     puts("THREADS CREATED\n");
 
     timer.callback = timer_cb;
```

(It worked also before, but it is easier for me to read the output when not using the thread id to reference to it.)

-- 
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/16896#issuecomment-929061177
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210928/9879e907/attachment.htm>


More information about the notifications mailing list