Skip to content
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

HardFault when running Greentea netsocket tests #17

Closed
juhaylinen opened this issue Aug 17, 2018 · 19 comments
Closed

HardFault when running Greentea netsocket tests #17

juhaylinen opened this issue Aug 17, 2018 · 19 comments

Comments

@juhaylinen
Copy link
Contributor

juhaylinen commented Aug 17, 2018

NUCLEO_F401RE+IDW01M1
Mbed-os SHA: 3c25b9644

Steps to reproduce:

mbed new test
cd test
cd mbed-os
git checkout master
cd ..
git clone https://github.com/ARMmbed/wifi-x-nucleo-idw01m1.git
mbed test --compile -m NUCLEO_F401RE -t GCC_ARM --app-config=mbed_app.json -n mbed-os-tests-netsocket-tcp
mbedgt -m NUCLEO_F401RE -v --test-spec=./BUILD/tests/NUCLEO_F401RE/GCC_ARM/test_spec.json --report-fails

mbed_app.json:

{
    "config": {
        "wifi-secure-ssid": {
            "help": "WiFi SSID for WPA2 secured network",
            "value": "\"SSID\""
        },
        "wifi-password": {
            "help": "WiFi Password",
            "value": "\"PASSWORD\""
        },
        "header-file": {
            "help" : "String for including your driver header file",
            "value" : "\"SpwfSAInterface.h\""
        },
        "object-construction" : {
            "value" : "new SpwfSAInterface(D8, D2)"
        },
        "connect-statement" : {
            "help" : "Must use 'net' variable name",
            "value" : "net->wifiInterface()->connect(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA_WPA2)"
        },
        "echo-server-addr" : {
            "help" : "IP address of echo server",
            "value" : "\"echo.mbedcloudtesting.com\""
        },
        "echo-server-port" : {
            "help" : "Port of echo server",
            "value" : "7"
        },
        "tcp-echo-prefix" : {
            "help" : "Some servers send a prefix before echoed message",
            "value" : null
        }
    },
    "target_overrides": {
        "*": {
            "target.features_add": ["LWIP"],
            "nsapi.default-stack": "LWIP"
        }
    },
    "macros": ["MBED_EXTENDED_TESTS"]
}

HardFault:

[1534500305.53][CONN][RXD] >>> Running case #2: 'TCPSOCKET_ECHOTEST_NONBLOCK'...
[1534500305.58][CONN][INF] found KV pair in stream: {{__testcase_start;TCPSOCKET_ECHOTEST_NONBLOCK}}, queued...
[1534500305.78][CONN][RXD] [Sender#00] bytes sent: 1
[1534500306.78][CONN][RXD]
[1534500306.81][CONN][RXD] ++ MbedOS Fault Handler ++
[1534500306.81][CONN][RXD]
[1534500306.84][CONN][RXD] FaultType: HardFault
[1534500306.84][CONN][RXD]
[1534500306.84][CONN][RXD] Context:
[1534500306.86][CONN][RXD] R0   : 20004E3C
[1534500306.88][CONN][RXD] R1   : 20018000
[1534500306.89][CONN][RXD] R2   : 400095D6
[1534500306.91][CONN][RXD] R3   : 20017FFE
[1534500306.93][CONN][RXD] R4   : 00000008
[1534500306.94][CONN][RXD] R5   : 20004E30
[1534500306.96][CONN][RXD] R6   : 20004E3C
[1534500306.98][CONN][RXD] R7   : 2000431C
[1534500306.99][CONN][RXD] R8   : 00000000
[1534500307.01][CONN][RXD] R9   : 20000DDC
[1534500307.03][CONN][RXD] R10  : 00000000
[1534500307.04][CONN][RXD] R11  : 000003E8
[1534500307.06][CONN][RXD] R12  : 20000DDC
[1534500307.08][CONN][RXD] SP   : 2000529C
[1534500307.10][CONN][RXD] LR   : 0800D849
[1534500307.11][CONN][RXD] PC   : 0801068E
[1534500307.13][CONN][RXD] xPSR : 210F0200
[1534500307.14][CONN][RXD] PSP  : 20005230
[1534500307.16][CONN][RXD] MSP  : 20017FD8
[1534500307.18][CONN][RXD] CPUID: 410FC241
[1534500307.19][CONN][RXD] HFSR : 40000000
[1534500307.21][CONN][RXD] MMFSR: 00000000
[1534500307.23][CONN][RXD] BFSR : 00000082
[1534500307.24][CONN][RXD] UFSR : 00000000
[1534500307.26][CONN][RXD] DFSR : 00000008
[1534500307.28][CONN][RXD] AFSR : 00000000
[1534500307.30][CONN][RXD] BFAR : 20018000
[1534500307.31][CONN][RXD] Mode : Thread
[1534500307.33][CONN][RXD] Priv : Privileged
[1534500307.34][CONN][RXD] Stack: PSP
[1534500307.34][CONN][RXD]
[1534500307.38][CONN][RXD] -- MbedOS Fault Handler --
[1534500307.38][CONN][RXD]
[1534500307.38][CONN][RXD]
[1534500307.38][CONN][RXD]
[1534500307.39][CONN][RXD] ++ MbedOS Error Info ++
[1534500307.44][CONN][RXD] Error Status: 0x80FF013D Code: 317 Module: 255
[1534500307.48][CONN][RXD] Error Message: Fault exception
[1534500307.49][CONN][RXD] Location: 0x800800B
[1534500307.53][CONN][RXD] Error Value: 0x801068E
[1534500307.63][CONN][RXD] Current Thread: Id: 0x20004DE0 Entry: 0x800A6E9 StackSize: 0x400 StackMem: 0x20004FC0 SP: 0x20017F70
[1534500307.66][CONN][RXD] -- MbedOS Error Info --
@betzw
Copy link
Collaborator

betzw commented Aug 27, 2018

This might also be due to too low values for TX/RX buffers (see here).

@juhaylinen
Copy link
Contributor Author

I tested with few buffers sizes (512, 640, 768, 1024) for TX/RX buffers but no improvement.

@betzw
Copy link
Collaborator

betzw commented Aug 29, 2018

How often will _ifup() be called during the whole mbed-os-tests-netsocket-tcp test execution?
Note: the WiFi driver is conceptually a singleton.

@juhaylinen
Copy link
Contributor Author

In my understanding _ifup() is called only once during the test setup phase.

@betzw
Copy link
Collaborator

betzw commented Aug 29, 2018

Could you pls. provide a complete execution trace?

@juhaylinen
Copy link
Contributor Author

Full trace below.

$ mbedhtrun -m NUCLEO_F401RE -v -f ./BUILD/tests/NUCLEO_F401RE/GCC_ARM/mbed-os/TESTS/netsocket/tcp/tcp.bin -d D: -p COM16
[1535610368.76][HTST][INF] host test executor ver. 1.3.1
[1535610368.78][HTST][INF] copy image onto target...
        1 file(s) copied.
[1535610376.41][MBED][WRN] Target ID not found: Skipping flash check and retry
[1535610376.42][HTST][INF] starting host test process...
[1535610376.83][CONN][INF] starting connection process...
[1535610376.83][CONN][INF] notify event queue about extra 60 sec timeout for serial port pooling
[1535610376.83][CONN][INF] initializing serial port listener...
[1535610376.83][SERI][INF] serial(port=COM16, baudrate=9600, read_timeout=0.01, write_timeout=5)
[1535610376.83][SERI][INF] reset device using 'default' plugin...
[1535610376.86][HTST][INF] setting timeout to: 60 sec
[1535610377.09][SERI][INF] waiting 1.00 sec after reset
[1535610378.10][SERI][INF] wait for it...
[1535610378.12][SERI][TXD] mbedmbedmbedmbedmbedmbedmbedmbedmbedmbed
[1535610378.12][CONN][INF] sending up to 2 __sync packets (specified with --sync=2)
[1535610378.12][CONN][INF] sending preamble 'a9d60c3b-e721-4d08-b707-7060ea7b8d5a'
[1535610378.16][SERI][TXD] {{__sync;a9d60c3b-e721-4d08-b707-7060ea7b8d5a}}
[1535610378.23][CONN][RXD] mbedmbedmbedmbedmbedmbedmbedmbed
[1535610378.29][CONN][INF] found SYNC in stream: {{__sync;a9d60c3b-e721-4d08-b707-7060ea7b8d5a}} it is #0 sent, queued...
[1535610378.31][HTST][INF] sync KV found, uuid=a9d60c3b-e721-4d08-b707-7060ea7b8d5a, timestamp=1535610378.289000
[1535610378.31][CONN][INF] found KV pair in stream: {{__version;1.3.0}}, queued...
[1535610378.31][HTST][INF] DUT greentea-client version: 1.3.0
[1535610378.33][CONN][INF] found KV pair in stream: {{__timeout;480}}, queued...
[1535610378.35][HTST][INF] setting timeout to: 480 sec
[1535610378.37][CONN][INF] found KV pair in stream: {{__host_test_name;default_auto}}, queued...
[1535610378.38][HTST][INF] host test class: '<class 'mbed_host_tests.host_tests.default_auto.DefaultAuto'>'
[1535610378.38][HTST][INF] host test setup() call...
[1535610378.38][HTST][INF] CALLBACKs updated
[1535610378.38][HTST][INF] host test detected: default_auto
[1535610426.64][CONN][RXD] MBED: TCPClient IP address is '192.168.64.130'
[1535610426.68][CONN][INF] found KV pair in stream: {{__testcase_count;14}}, queued...
[1535610426.69][CONN][RXD] >>> Running 14 test cases...
[1535610426.74][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_ECHOTEST}}, queued...
[1535610426.79][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_ECHOTEST_NONBLOCK}}, queued...
[1535610426.84][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_OPEN_CLOSE_REPEAT}}, queued...
[1535610426.89][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_OPEN_LIMIT}}, queued...
[1535610426.94][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_THREAD_PER_SOCKET_SAFETY}}, queued...
[1535610426.99][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_CONNECT_INVALID}}, queued...
[1535610427.04][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_ECHOTEST_BURST}}, queued...
[1535610427.10][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_ECHOTEST_BURST_NONBLOCK}}, queued...
[1535610427.14][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_RECV_100K}}, queued...
[1535610427.19][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_RECV_100K_NONBLOCK}}, queued...
[1535610427.24][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_RECV_TIMEOUT}}, queued...
[1535610427.29][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_SEND_REPEAT}}, queued...
[1535610427.33][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_SEND_TIMEOUT}}, queued...
[1535610427.38][CONN][RXD]
[1535610427.38][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_ENDPOINT_CLOSE}}, queued...
[1535610427.42][CONN][RXD] >>> Running case #1: 'TCPSOCKET_ECHOTEST'...
[1535610427.48][CONN][INF] found KV pair in stream: {{__testcase_start;TCPSOCKET_ECHOTEST}}, queued...
[1535610432.40][CONN][INF] found KV pair in stream: {{__testcase_finish;TCPSOCKET_ECHOTEST;1;0}}, queued...
[1535610432.44][CONN][RXD] >>> 'TCPSOCKET_ECHOTEST': 1 passed, 0 failed
[1535610432.44][CONN][RXD]
[1535610432.50][CONN][RXD] >>> Running case #2: 'TCPSOCKET_ECHOTEST_NONBLOCK'...
[1535610432.56][CONN][INF] found KV pair in stream: {{__testcase_start;TCPSOCKET_ECHOTEST_NONBLOCK}}, queued...
[1535610432.71][CONN][RXD] [Sender#00] bytes sent: 1
[1535610433.77][CONN][RXD] [Recevr#00] bytes received: 1
[1535610433.79][CONN][RXD] [Sender#01] bytes sent: 2
[1535610434.85][CONN][RXD] [Recevr#01] bytes received: 2
[1535610434.89][CONN][RXD] [Sender#02] bytes sent: 3
[1535610435.94][CONN][RXD] [Recevr#02] bytes received: 3
[1535610435.97][CONN][RXD] [Sender#03] bytes sent: 4
[1535610437.02][CONN][RXD] [Recevr#03] bytes received: 4
[1535610437.05][CONN][RXD] [Sender#04] bytes sent: 5
[1535610438.11][CONN][RXD] [Recevr#04] bytes received: 5
[1535610438.14][CONN][RXD] [Sender#05] bytes sent: 6
[1535610439.19][CONN][RXD] [Recevr#05] bytes received: 6
[1535610439.22][CONN][RXD] [Sender#06] bytes sent: 7
[1535610440.22][CONN][RXD]
[1535610440.26][CONN][RXD] ++ MbedOS Fault Handler ++
[1535610440.26][CONN][RXD]
[1535610440.27][CONN][RXD] FaultType: HardFault
[1535610440.27][CONN][RXD]
[1535610440.29][CONN][RXD] Context:
[1535610440.29][CONN][RXD] R0   : BD104620
[1535610440.31][CONN][RXD] R1   : 00000018
[1535610440.34][CONN][RXD] R2   : 20004ED8
[1535610440.36][CONN][RXD] R3   : 00002204
[1535610440.37][CONN][RXD] R4   : 20002FC4
[1535610440.39][CONN][RXD] R5   : 00000001
[1535610440.39][CONN][RXD] R6   : 00000001
[1535610440.42][CONN][RXD] R7   : 20002BA8
[1535610440.44][CONN][RXD] R8   : 200052B0
[1535610440.45][CONN][RXD] R9   : 200052AF
[1535610440.47][CONN][RXD] R10  : 00000003
[1535610440.49][CONN][RXD] R11  : 0801C02A
[1535610440.49][CONN][RXD] R12  : 08009A2D
[1535610440.51][CONN][RXD] SP   : 20017FC0
[1535610440.53][CONN][RXD] LR   : 0800894B
[1535610440.54][CONN][RXD] PC   : 08009AE2
[1535610440.56][CONN][RXD] xPSR : 8107000B
[1535610440.58][CONN][RXD] PSP  : 200051F8
[1535610440.60][CONN][RXD] MSP  : 20017FA0
[1535610440.61][CONN][RXD] CPUID: 410FC241
[1535610440.63][CONN][RXD] HFSR : 40000000
[1535610440.64][CONN][RXD] MMFSR: 00000000
[1535610440.67][CONN][RXD] BFSR : 00000082
[1535610440.69][CONN][RXD] UFSR : 00000000
[1535610440.69][CONN][RXD] DFSR : 00000008
[1535610440.71][CONN][RXD] AFSR : 00000000
[1535610440.74][CONN][RXD] BFAR : BD104640
[1535610440.76][CONN][RXD] Mode : Handler
[1535610440.77][CONN][RXD] Priv : Privileged
[1535610440.77][CONN][RXD] Stack: MSP
[1535610440.79][CONN][RXD]
[1535610440.81][CONN][RXD] -- MbedOS Fault Handler --
[1535610440.81][CONN][RXD]
[1535610440.81][CONN][RXD]
[1535610440.81][CONN][RXD]
[1535610440.84][CONN][RXD] ++ MbedOS Error Info ++
[1535610440.89][CONN][RXD] Error Status: 0x80FF013D Code: 317 Module: 255
[1535610440.92][CONN][RXD] Error Message: Fault exception
[1535610440.94][CONN][RXD] Location: 0x80085FB
[1535610440.96][CONN][RXD] Error Value: 0x8009AE2
[1535610441.07][CONN][RXD] Current Thread: Id: 0x20004ED8 Entry: 0x8013665 StackSize: 0x200003F8 StackMem: 0x20000828 SP: 0x20017F38
[1535610441.09][CONN][RXD] -- MbedOS Error Info --
[1535610858.72][HTST][INF] test suite run finished after 480.37 sec...
[1535610858.74][CONN][INF] received special event '__host_test_finished' value='True', finishing
[1535610858.74][HTST][INF] CONN exited with code: 0
[1535610858.74][HTST][INF] No events in queue
[1535610858.74][HTST][INF] stopped consuming events
[1535610858.74][HTST][INF] host test result(): None
[1535610858.74][HTST][WRN] missing __exit event from DUT
[1535610858.74][HTST][WRN] missing __exit_event_queue event from host test
[1535610858.74][HTST][ERR] missing __exit_event_queue event from host test and no result from host test, timeout...
[1535610858.74][HTST][INF] calling blocking teardown()
[1535610858.74][HTST][INF] teardown() finished
[1535610858.74][HTST][INF] {{result;timeout}}

@betzw
Copy link
Collaborator

betzw commented Aug 30, 2018

Feels like a stack overflow. Can you increase the stack size of the dynamically created Threads in the test?

@betzw
Copy link
Collaborator

betzw commented Aug 30, 2018

First execution tests on my side seem to confirm that we are facing stack overflows.
Setting tcp_global::TCP_OS_STACK_SIZE to (4*1024) makes the test standing in question run.

@juhaylinen
Copy link
Contributor Author

Yes, I agree. Increasing thread stack size fixes the issue.

I saw random crash when test case TCPSOCKET_ECHOTEST_BURST_NONBLOCK was running. Lets see if I can reproduce it.

@betzw
Copy link
Collaborator

betzw commented Aug 30, 2018

I did not have problems with TCPSOCKET_ECHOTEST_BURST_NONBLOCK, but pls. note that both TCPSOCKET_RECV_100K tests will fail (see #11).

@betzw
Copy link
Collaborator

betzw commented Aug 30, 2018

I would furthermore suggest the following mofification:

diff --git a/TESTS/netsocket/tcp/tcpsocket_thread_per_socket_safety.cpp b/TESTS/netsocket/tcp/tcpsocket_thread_per_socket_safety.cpp
index 7a0226e2c..1b5752ff7 100644
--- a/TESTS/netsocket/tcp/tcpsocket_thread_per_socket_safety.cpp
+++ b/TESTS/netsocket/tcp/tcpsocket_thread_per_socket_safety.cpp
@@ -30,7 +30,7 @@ static const int SIGNAL_SIGIO1 = 0x1;
 static const int SIGNAL_SIGIO2 = 0x2;
 static const int SIGIO_TIMEOUT = 5000; //[ms]
 
-Thread thread;
+Thread thread(osPriorityNormal, tcp_global::TCP_OS_STACK_SIZE);
 volatile bool running = true;
 }
 
@@ -51,8 +51,8 @@ static void check_const_len_rand_sequence()
     sock.sigio(callback(_sigio_handler1, Thread::gettid()));
 
     static const int BUFF_SIZE = 10;
-    char rx_buff[BUFF_SIZE] = {0};
-    char tx_buff[BUFF_SIZE] = {0};
+    static char rx_buff[BUFF_SIZE] = {0};
+    static char tx_buff[BUFF_SIZE] = {0};
 
 
     int bytes2process;
@@ -108,8 +108,8 @@ static void check_var_len_rand_sequence()
     sock.sigio(callback(_sigio_handler2, Thread::gettid()));
 
     static const int BUFF_SIZE = 1001;
-    char rx_buff[BUFF_SIZE];
-    char tx_buff[BUFF_SIZE];
+    static char rx_buff[BUFF_SIZE];
+    static char tx_buff[BUFF_SIZE];
     static const int pkt_size_diff = 100;
 
     int bytes2process;

@juhaylinen
Copy link
Contributor Author

Thank you for suggesting improvements.

I was able to reproduce the hardfault with TCPSOCKET_ECHOTEST_BURST:

mbedhtrun -m NUCLEO_F401RE -v -f ./BUILD/tests/NUCLEO_F401RE/GCC_ARM/mbed-os/TESTS/netsocket/tcp/tcp.bin -d D: -p COM16
[1535703655.29][HTST][INF] host test executor ver. 1.3.1
[1535703655.29][HTST][INF] copy image onto target...
        1 file(s) copied.
[1535703662.85][MBED][WRN] Target ID not found: Skipping flash check and retry
[1535703662.85][HTST][INF] starting host test process...
[1535703663.27][CONN][INF] starting connection process...
[1535703663.27][CONN][INF] notify event queue about extra 60 sec timeout for serial port pooling
[1535703663.27][CONN][INF] initializing serial port listener...
[1535703663.27][SERI][INF] serial(port=COM16, baudrate=9600, read_timeout=0.01, write_timeout=5)
[1535703663.27][SERI][INF] reset device using 'default' plugin...
[1535703663.29][HTST][INF] setting timeout to: 60 sec
[1535703663.52][SERI][INF] waiting 1.00 sec after reset
[1535703664.52][SERI][INF] wait for it...
[1535703664.56][SERI][TXD] mbedmbedmbedmbedmbedmbedmbedmbedmbedmbed
[1535703664.56][CONN][INF] sending up to 2 __sync packets (specified with --sync=2)
[1535703664.56][CONN][INF] sending preamble '9ce38317-1012-422e-b343-5d5b8f884883'
[1535703664.60][SERI][TXD] {{__sync;9ce38317-1012-422e-b343-5d5b8f884883}}
[1535703664.66][CONN][RXD] mbedmbedmbedmbedmbedmbedmbedmbed
[1535703664.71][CONN][INF] found SYNC in stream: {{__sync;9ce38317-1012-422e-b343-5d5b8f884883}} it is #0 sent, queued...
[1535703664.71][HTST][INF] sync KV found, uuid=9ce38317-1012-422e-b343-5d5b8f884883, timestamp=1535703664.711000
[1535703664.73][CONN][INF] found KV pair in stream: {{__version;1.3.0}}, queued...
[1535703664.73][HTST][INF] DUT greentea-client version: 1.3.0
[1535703664.75][CONN][INF] found KV pair in stream: {{__timeout;480}}, queued...
[1535703664.75][HTST][INF] setting timeout to: 480 sec
[1535703664.78][CONN][INF] found KV pair in stream: {{__host_test_name;default_auto}}, queued...
[1535703664.79][HTST][INF] host test class: '<class 'mbed_host_tests.host_tests.default_auto.DefaultAuto'>'
[1535703664.79][HTST][INF] host test setup() call...
[1535703664.79][HTST][INF] CALLBACKs updated
[1535703664.79][HTST][INF] host test detected: default_auto
[1535703692.74][CONN][RXD] MBED: TCPClient IP address is '192.168.64.130'
[1535703692.77][CONN][INF] found KV pair in stream: {{__testcase_count;12}}, queued...
[1535703692.80][CONN][RXD] >>> Running 12 test cases...
[1535703692.84][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_ECHOTEST}}, queued...
[1535703692.89][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_ECHOTEST_NONBLOCK}}, queued...
[1535703692.94][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_OPEN_CLOSE_REPEAT}}, queued...
[1535703692.98][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_OPEN_LIMIT}}, queued...
[1535703693.04][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_THREAD_PER_SOCKET_SAFETY}}, queued...
[1535703693.09][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_CONNECT_INVALID}}, queued...
[1535703693.13][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_ECHOTEST_BURST}}, queued...
[1535703693.20][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_ECHOTEST_BURST_NONBLOCK}}, queued...
[1535703693.24][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_RECV_100K}}, queued...
[1535703693.29][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_RECV_TIMEOUT}}, queued...
[1535703693.33][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_SEND_REPEAT}}, queued...
[1535703693.37][CONN][RXD]
[1535703693.37][CONN][INF] found KV pair in stream: {{__testcase_name;TCPSOCKET_SEND_TIMEOUT}}, queued...
[1535703693.42][CONN][RXD] >>> Running case #1: 'TCPSOCKET_ECHOTEST'...
[1535703693.46][CONN][INF] found KV pair in stream: {{__testcase_start;TCPSOCKET_ECHOTEST}}, queued...
[1535703699.45][CONN][INF] found KV pair in stream: {{__testcase_finish;TCPSOCKET_ECHOTEST;1;0}}, queued...
[1535703699.49][CONN][RXD] >>> 'TCPSOCKET_ECHOTEST': 1 passed, 0 failed
[1535703699.49][CONN][RXD]
[1535703699.55][CONN][RXD] >>> Running case #2: 'TCPSOCKET_ECHOTEST_NONBLOCK'...
[1535703699.60][CONN][INF] found KV pair in stream: {{__testcase_start;TCPSOCKET_ECHOTEST_NONBLOCK}}, queued...
[1535703699.76][CONN][RXD] [Sender#00] bytes sent: 1
[1535703700.80][CONN][RXD] [Recevr#00] bytes received: 1
[1535703700.88][CONN][RXD] [Sender#01] bytes sent: 2
[1535703701.93][CONN][RXD] [Recevr#01] bytes received: 2
[1535703701.97][CONN][RXD] [Sender#02] bytes sent: 3
[1535703703.02][CONN][RXD] [Recevr#02] bytes received: 3
[1535703703.05][CONN][RXD] [Sender#03] bytes sent: 4
[1535703704.10][CONN][RXD] [Recevr#03] bytes received: 4
[1535703704.13][CONN][RXD] [Sender#04] bytes sent: 5
[1535703705.18][CONN][RXD] [Recevr#04] bytes received: 5
[1535703705.22][CONN][RXD] [Sender#05] bytes sent: 6
[1535703706.28][CONN][RXD] [Recevr#05] bytes received: 6
[1535703706.33][CONN][RXD] [Sender#06] bytes sent: 7
[1535703707.37][CONN][RXD] [Recevr#06] bytes received: 7
[1535703707.41][CONN][RXD] [Sender#07] bytes sent: 8
[1535703708.46][CONN][RXD] [Recevr#07] bytes received: 8
[1535703708.49][CONN][RXD] [Sender#08] bytes sent: 9
[1535703709.55][CONN][RXD] [Recevr#08] bytes received: 9
[1535703709.58][CONN][RXD] [Sender#09] bytes sent: 10
[1535703710.64][CONN][RXD] [Recevr#09] bytes received: 10
[1535703710.69][CONN][RXD] [Sender#10] bytes sent: 100
[1535703711.75][CONN][RXD] [Recevr#10] bytes received: 100
[1535703711.82][CONN][RXD] [Sender#11] bytes sent: 200
[1535703712.89][CONN][RXD] [Recevr#11] bytes received: 200
[1535703712.95][CONN][RXD] [Sender#12] bytes sent: 300
[1535703714.03][CONN][RXD] [Recevr#12] bytes received: 300
[1535703714.11][CONN][RXD] [Sender#13] bytes sent: 400
[1535703715.20][CONN][RXD] [Recevr#13] bytes received: 400
[1535703715.30][CONN][RXD] [Sender#14] bytes sent: 500
[1535703716.39][CONN][RXD] [Recevr#14] bytes received: 500
[1535703716.48][CONN][RXD] [Sender#15] bytes sent: 600
[1535703717.59][CONN][RXD] [Recevr#15] bytes received: 600
[1535703717.69][CONN][RXD] [Sender#16] bytes sent: 700
[1535703718.80][CONN][RXD] [Recevr#16] bytes received: 700
[1535703718.91][CONN][RXD] [Sender#17] bytes sent: 800
[1535703720.07][CONN][RXD] [Recevr#17] bytes received: 800
[1535703720.20][CONN][RXD] [Sender#18] bytes sent: 900
[1535703721.38][CONN][RXD] [Recevr#18] bytes received: 900
[1535703721.53][CONN][RXD] [Sender#19] bytes sent: 1000
[1535703722.71][CONN][RXD] [Recevr#19] bytes received: 1000
[1535703722.88][CONN][RXD] [Sender#20] bytes sent: 1100
[1535703724.08][CONN][RXD] [Recevr#20] bytes received: 1100
[1535703724.25][CONN][RXD] [Sender#21] bytes sent: 1200
[1535703725.45][CONN][RXD] [Recevr#21] bytes received: 1200
[1535703725.51][CONN][INF] found KV pair in stream: {{__testcase_finish;TCPSOCKET_ECHOTEST_NONBLOCK;1;0}}, queued...
[1535703725.57][CONN][RXD] >>> 'TCPSOCKET_ECHOTEST_NONBLOCK': 1 passed, 0 failed
[1535703725.57][CONN][RXD]
[1535703725.62][CONN][RXD] >>> Running case #3: 'TCPSOCKET_OPEN_CLOSE_REPEAT'...
[1535703725.68][CONN][INF] found KV pair in stream: {{__testcase_start;TCPSOCKET_OPEN_CLOSE_REPEAT}}, queued...
[1535703725.74][CONN][INF] found KV pair in stream: {{__testcase_finish;TCPSOCKET_OPEN_CLOSE_REPEAT;1;0}}, queued...
[1535703725.79][CONN][RXD] >>> 'TCPSOCKET_OPEN_CLOSE_REPEAT': 1 passed, 0 failed
[1535703725.79][CONN][RXD]
[1535703725.84][CONN][RXD] >>> Running case #4: 'TCPSOCKET_OPEN_LIMIT'...
[1535703725.89][CONN][INF] found KV pair in stream: {{__testcase_start;TCPSOCKET_OPEN_LIMIT}}, queued...
[1535703725.94][CONN][RXD] [round#00] unable to open new socket, error: -3005
[1535703725.97][CONN][RXD] [round#00] 8 sockets opened
[1535703726.02][CONN][RXD] [round#01] unable to open new socket, error: -3005
[1535703726.05][CONN][RXD] [round#01] 8 sockets opened
[1535703726.10][CONN][INF] found KV pair in stream: {{__testcase_finish;TCPSOCKET_OPEN_LIMIT;1;0}}, queued...
[1535703726.15][CONN][RXD] >>> 'TCPSOCKET_OPEN_LIMIT': 1 passed, 0 failed
[1535703726.15][CONN][RXD]
[1535703726.22][CONN][RXD] >>> Running case #5: 'TCPSOCKET_THREAD_PER_SOCKET_SAFETY'...
[1535703726.27][CONN][INF] found KV pair in stream: {{__testcase_start;TCPSOCKET_THREAD_PER_SOCKET_SAFETY}}, queued...
[1535703729.69][CONN][INF] found KV pair in stream: {{__testcase_finish;TCPSOCKET_THREAD_PER_SOCKET_SAFETY;1;0}}, queued...
[1535703729.76][CONN][RXD] >>> 'TCPSOCKET_THREAD_PER_SOCKET_SAFETY': 1 passed, 0 failed
[1535703729.76][CONN][RXD]
[1535703729.82][CONN][RXD] >>> Running case #6: 'TCPSOCKET_CONNECT_INVALID'...
[1535703729.87][CONN][INF] found KV pair in stream: {{__testcase_start;TCPSOCKET_CONNECT_INVALID}}, queued...
[1535703742.33][CONN][INF] found KV pair in stream: {{__testcase_finish;TCPSOCKET_CONNECT_INVALID;1;0}}, queued...
[1535703742.38][CONN][RXD] >>> 'TCPSOCKET_CONNECT_INVALID': 1 passed, 0 failed
[1535703742.38][CONN][RXD]
[1535703742.43][CONN][RXD] >>> Running case #7: 'TCPSOCKET_ECHOTEST_BURST'...
[1535703742.48][CONN][INF] found KV pair in stream: {{__testcase_start;TCPSOCKET_ECHOTEST_BURST}}, queued...
[1535703789.14][CONN][RXD]
[1535703789.14][CONN][RXD]
[1535703789.17][CONN][RXD] ++ MbedOS Error Info ++
[1535703789.22][CONN][RXD] Error Status: 0x80FF0100 Code: 256 Module: 255
[1535703789.26][CONN][RXD] Error Message: Fatal Run-time error
[1535703789.28][CONN][RXD] Location: 0x800D22B
[1535703789.29][CONN][RXD] Error Value: 0x0
[1535703789.40][CONN][RXD] Current Thread: Id: 0x20003684 Entry: 0x8008369 StackSize: 0x1000 StackMem: 0x200036D0 SP: 0x20004370
[1535703789.42][CONN][RXD] -- MbedOS Error Info --
[1535703789.42][CONN][RXD]
[1535703789.48][CONN][RXD] SPWF> SPWFSAxx::_server_gone_handler failed!
[1535704144.94][HTST][INF] test suite run finished after 480.18 sec...
[1535704144.94][CONN][INF] received special event '__host_test_finished' value='True', finishing
[1535704144.95][HTST][INF] CONN exited with code: 0
[1535704144.95][HTST][INF] No events in queue
[1535704144.95][HTST][INF] stopped consuming events
[1535704144.95][HTST][INF] host test result(): None
[1535704144.95][HTST][WRN] missing __exit event from DUT
[1535704144.95][HTST][WRN] missing __exit_event_queue event from host test
[1535704144.95][HTST][ERR] missing __exit_event_queue event from host test and no result from host test, timeout...
[1535704144.95][HTST][INF] calling blocking teardown()
[1535704144.95][HTST][INF] teardown() finished
[1535704144.95][HTST][INF] {{result;timeout}}

@betzw
Copy link
Collaborator

betzw commented Aug 31, 2018

How deterministic is this behavior and which FW version are you using?
I am asking this also because I never faced this issue on my side ...

@betzw
Copy link
Collaborator

betzw commented Sep 7, 2018

Any update on this issue?

@juhaylinen
Copy link
Contributor Author

Sorry for the late reply.

I'm using the latest FW version 3.6.
I've seen the hardfault with TCPSOCKET_ECHOTEST_BURST only two times from ~30 runs.

@VeijoPesonen
Copy link

VeijoPesonen commented Sep 12, 2018

I would furthermore suggest the following mofification:

diff --git a/TESTS/netsocket/tcp/tcpsocket_thread_per_socket_safety.cpp b/TESTS/netsocket/tcp/tcpsocket_thread_per_socket_safety.cpp
index 7a0226e2c..1b5752ff7 100644
--- a/TESTS/netsocket/tcp/tcpsocket_thread_per_socket_safety.cpp
+++ b/TESTS/netsocket/tcp/tcpsocket_thread_per_socket_safety.cpp
@@ -30,7 +30,7 @@ static const int SIGNAL_SIGIO1 = 0x1;
 static const int SIGNAL_SIGIO2 = 0x2;
 static const int SIGIO_TIMEOUT = 5000; //[ms]
 
-Thread thread;
+Thread thread(osPriorityNormal, tcp_global::TCP_OS_STACK_SIZE);
 volatile bool running = true;
 }
 
@@ -51,8 +51,8 @@ static void check_const_len_rand_sequence()
     sock.sigio(callback(_sigio_handler1, Thread::gettid()));
 
     static const int BUFF_SIZE = 10;
-    char rx_buff[BUFF_SIZE] = {0};
-    char tx_buff[BUFF_SIZE] = {0};
+    static char rx_buff[BUFF_SIZE] = {0};
+    static char tx_buff[BUFF_SIZE] = {0};
 
 
     int bytes2process;
@@ -108,8 +108,8 @@ static void check_var_len_rand_sequence()
     sock.sigio(callback(_sigio_handler2, Thread::gettid()));
 
     static const int BUFF_SIZE = 1001;
-    char rx_buff[BUFF_SIZE];
-    char tx_buff[BUFF_SIZE];
+    static char rx_buff[BUFF_SIZE];
+    static char tx_buff[BUFF_SIZE];
     static const int pkt_size_diff = 100;
 
     int bytes2process;

@betzw Looks good to me. If you don't mind could you please raise a PR? I can also do it myself but it might take a while. You also want to include the stack size increase I assume. Would be good to increase the TCP_OS_STACK_SIZE size as it also gets hit if one compiles with debug profile.

@betzw
Copy link
Collaborator

betzw commented Sep 13, 2018

Not sure when I will have some time to create a PR, but I'll keep you informed.
Btw, I would recommend to use FW version 3.5.3 (SPWF01S-170111-665d284) and pls. do not ask me why ... 😊

@betzw
Copy link
Collaborator

betzw commented Sep 28, 2018

Can we close this issue?

0xc0170 pushed a commit to ARMmbed/mbed-os that referenced this issue Oct 1, 2018
0xc0170 pushed a commit to ARMmbed/mbed-os that referenced this issue Oct 1, 2018
Stack size is insufficient for debug profile
Stack size is insufficient for NUCLEO_F401RE+IDW01M1
Please see ARMmbed/wifi-x-nucleo-idw01m1#17
@VeijoPesonen
Copy link

@juhaylinen @betzw The issue can be closed.

adbridge pushed a commit to ARMmbed/mbed-os that referenced this issue Oct 8, 2018
adbridge pushed a commit to ARMmbed/mbed-os that referenced this issue Oct 8, 2018
Stack size is insufficient for debug profile
Stack size is insufficient for NUCLEO_F401RE+IDW01M1
Please see ARMmbed/wifi-x-nucleo-idw01m1#17
adbridge pushed a commit to ARMmbed/mbed-os that referenced this issue Oct 8, 2018
adbridge pushed a commit to ARMmbed/mbed-os that referenced this issue Oct 8, 2018
Stack size is insufficient for debug profile
Stack size is insufficient for NUCLEO_F401RE+IDW01M1
Please see ARMmbed/wifi-x-nucleo-idw01m1#17
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

No branches or pull requests

3 participants