Skip to content

feature_cmsis5: Fix mbedmicro-rtos-threads test for gcc 5.4. #3839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

nvlsianpu
Copy link
Contributor

@nvlsianpu nvlsianpu commented Feb 24, 2017

Description

For gcc 5.4 each task created into this test consumes 0x128 B of stack. for gcc 4.9 consumption was 0xA0 B. Increase the THREAD_STACK_SIZE fixed the problem.

Status

READY

Related to Issue

#3690

@nvlsianpu
Copy link
Contributor Author

nvlsianpu commented Feb 24, 2017

ARM compiler test results

| target       | platform_name | test suite                                                                           | result | elapsed_time (sec) | copy_method |
+--------------+---------------+--------------------------------------------------------------------------------------+--------+--------------------+-------------+
| NRF52_DK-ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-basic_test                        | OK     | 13.32              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-basic_test_default                | OK     | 13.24              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-case_async_validate               | OK     | 17.41              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-case_control_async                | OK     | 21.26              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-case_control_repeat               | OK     | 17.44              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-case_selection                    | OK     | 13.46              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-case_setup_failure                | OK     | 13.9               | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-case_teardown_failure             | OK     | 16.49              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-control_type                      | OK     | 14.27              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-minimal_async_scheduler           | OK     | 17.29              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-minimal_scheduler                 | OK     | 15.13              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-test_assertion_failure_test_setup | OK     | 13.51              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-test_setup_case_selection_failure | OK     | 13.29              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-test_setup_failure                | OK     | 12.93              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-rtos-rtx2-target_cortex_m-tests-memory-heap_and_stack                        | OK     | 12.46              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-events-queue                                                           | OK     | 22.68              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-integration-basic                                                      | OK     | 12.34              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-c_strings                                                 | OK     | 15.07              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-dev_null                                                  | OK     | 14.52              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-echo                                                      | OK     | 25.24              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-generic_tests                                             | OK     | 13.89              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-lp_timeout                                                | OK     | 22.2               | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-race_test                                                 | OK     | 14.59              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-rtc                                                       | OK     | 23.27              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-stl_features                                              | OK     | 14.21              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-ticker                                                    | OK     | 49.01              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-timeout                                                   | OK     | 26.75              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-wait_us                                                   | OK     | 26.27              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbed_functional-callback                                               | OK     | 15.02              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbed_functional-callback_big                                           | OK     | 15.14              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbed_functional-callback_small                                         | OK     | 15.09              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbed_functional-functionpointer                                        | OK     | 15.99              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbed_hal-lp_ticker                                                     | OK     | 22.22              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbedmicro-mbed-attributes                                              | OK     | 15.81              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbedmicro-mbed-call_before_main                                        | OK     | 14.62              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbedmicro-mbed-cpp                                                     | OK     | 12.75              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbedmicro-mbed-div                                                     | OK     | 12.59              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbedmicro-mbed-static_assert                                           | OK     | 12.85              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbedmicro-rtos-mbed-basic                                              | OK     | 23.5               | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbedmicro-rtos-mbed-isr                                                | OK     | 17.51              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbedmicro-rtos-mbed-malloc                                             | OK     | 27.42              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbedmicro-rtos-mbed-mutex                                              | OK     | 22.63              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbedmicro-rtos-mbed-queue                                              | OK     | 14.36              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbedmicro-rtos-mbed-semaphore                                          | OK     | 19.58              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbedmicro-rtos-mbed-signals                                            | OK     | 17.75              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbedmicro-rtos-mbed-threads                                            | OK     | 20.98              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-mbedtls-selftest                                                       | OK     | 19.55              | shell       |
| NRF52_DK-ARM | NRF52_DK      | mbed-os-tests-netsocket-ip_parsing                                                   | OK     | 14.95              | shell       |
+--------------+---------------+--------------------------------------------------------------------------------------+--------+--------------------+-------------+

GCC 5.4:

| target           | platform_name | test suite                                                                           | result | elapsed_time (sec) | copy_method |
+------------------+---------------+--------------------------------------------------------------------------------------+--------+--------------------+-------------+
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-basic_test                        | OK     | 13.85              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-basic_test_default                | OK     | 15.86              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-case_async_validate               | OK     | 17.95              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-case_control_async                | OK     | 21.85              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-case_control_repeat               | OK     | 18.12              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-case_selection                    | OK     | 13.83              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-case_setup_failure                | OK     | 14.21              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-case_teardown_failure             | OK     | 16.72              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-control_type                      | OK     | 16.8               | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-minimal_async_scheduler           | OK     | 16.9               | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-minimal_scheduler                 | OK     | 15.72              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-test_assertion_failure_test_setup | OK     | 13.64              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-test_setup_case_selection_failure | OK     | 14.09              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-features-frameworks-utest-tests-unit_tests-test_setup_failure                | OK     | 13.6               | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-rtos-rtx2-target_cortex_m-tests-memory-heap_and_stack                        | OK     | 13.06              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-events-queue                                                           | OK     | 21.06              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-integration-basic                                                      | OK     | 12.72              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-c_strings                                                 | OK     | 15.44              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-dev_null                                                  | OK     | 15.7               | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-echo                                                      | OK     | 25.87              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-generic_tests                                             | OK     | 14.3               | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-lp_timeout                                                | OK     | 22.77              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-race_test                                                 | OK     | 15.1               | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-rtc                                                       | OK     | 24.08              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-stl_features                                              | OK     | 15.19              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-ticker                                                    | OK     | 49.29              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-timeout                                                   | OK     | 26.65              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbed_drivers-wait_us                                                   | OK     | 24.83              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbed_functional-callback                                               | OK     | 15.37              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbed_functional-callback_big                                           | OK     | 15.47              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbed_functional-callback_small                                         | OK     | 15.36              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbed_functional-functionpointer                                        | OK     | 16.26              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbed_hal-lp_ticker                                                     | OK     | 22.57              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbedmicro-mbed-attributes                                              | OK     | 15.43              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbedmicro-mbed-call_before_main                                        | OK     | 15.44              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbedmicro-mbed-cpp                                                     | OK     | 13.21              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbedmicro-mbed-div                                                     | OK     | 13.26              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbedmicro-mbed-static_assert                                           | OK     | 13.25              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbedmicro-rtos-mbed-basic                                              | OK     | 23.84              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbedmicro-rtos-mbed-isr                                                | OK     | 18.18              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbedmicro-rtos-mbed-malloc                                             | OK     | 28.01              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbedmicro-rtos-mbed-mutex                                              | OK     | 23.73              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbedmicro-rtos-mbed-queue                                              | OK     | 14.75              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbedmicro-rtos-mbed-semaphore                                          | OK     | 20.21              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbedmicro-rtos-mbed-signals                                            | OK     | 18.33              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbedmicro-rtos-mbed-threads                                            | OK     | 21.51              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-mbedtls-selftest                                                       | OK     | 20.87              | shell       |
| NRF52_DK-GCC_ARM | NRF52_DK      | mbed-os-tests-netsocket-ip_parsing                                                   | OK     | 15.81              | shell       |
+------------------+---------------+--------------------------------------------------------------------------------------+--------+--------------------+-------------+```

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 24, 2017

Can you share a map file for those 2 different versions of GCC ? I would like to make a diff to see why it increases? what about GCC 6?

@@ -48,7 +48,10 @@ int main()
if (NULL == thread_list[i]) {
allocation_failure = true;
}
thread_list[i]->start(task_using_malloc);
else
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use the same formatting

@nvlsianpu
Copy link
Contributor Author

@0xc0170 map files were sent via e-mail.

@pan-
Copy link
Member

pan- commented Feb 24, 2017

@nvlsianpu Could you fix the line which create the new threads ? With new it will never return NULL. the std::nothrow overload has to be used.

thread_list[i] = new (std::nothrow) Thread(osPriorityNormal, THREAD_STACK_SIZE);

   For gcc 5.4 each task consumes 0x128 B of stack.
@mazimkhan
Copy link

@nvlsianpu
Copy link
Contributor Author

@bulislaw @pan- Could you investigate build's fail mentioned above?

@pan-
Copy link
Member

pan- commented Feb 27, 2017

@bulislaw UVISOR requires a file named rt_OsEventObserver.h, apparently it is not bundled with RTX2. I've also noticed that the buildbot use GCC 4.9 which was causing issue on m0 targets like the NRF51_DK. What's the GCC target for RTX 2 ?

@bulislaw
Copy link
Member

Ignore all the failures from the CIs. The uVisor support is not yet in (there's PR open). We'll update GCC to v6 soon in the CIs so all the issues will go away.

@nvlsianpu Thanks for that, I'll check locally if changing stack size doesn't break other boards and merge.

@bulislaw bulislaw changed the title Fix mbedmicro-rtos-threads test for gcc 5.4. feature_cmsis5: Fix mbedmicro-rtos-threads test for gcc 5.4. Feb 28, 2017
@bulislaw
Copy link
Member

bulislaw commented Mar 1, 2017

I had a look and this PR actually makes the test fail for the GCC6.
Status for now ARM all test pass, GCCv6 1 failure tests-mbed_drivers-stl_features

@bulislaw
Copy link
Member

bulislaw commented Mar 2, 2017

Now both NRF51 and NRF52 pass all the tests for GCC and ARM. Thanks for your help. I'll close this PR.

@bulislaw bulislaw closed this Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants