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

net.socket.get_addr_info: frdm_k64f test fails #34923

Closed
hakehuang opened this issue May 6, 2021 · 9 comments · Fixed by #35066
Closed

net.socket.get_addr_info: frdm_k64f test fails #34923

hakehuang opened this issue May 6, 2021 · 9 comments · Fixed by #35066
Assignees
Labels
area: Networking bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: medium Medium impact/importance bug
Milestone

Comments

@hakehuang
Copy link
Collaborator

Describe the bug
below two cases fails, looks like it is not stable enough to all platform
test_getaddrinfo_ok
test_getaddrinfo_cancelled

To Reproduce
Steps to reproduce the behavior:

  1. mkdir build; cd build
  2. cmake -DBOARD=frdm_k64f
  3. make falsh
  4. See error

Expected behavior
all test pass

Impact
addressinfo api call

Logs and console output

    �start application at 0x70008729 !!!

    start stack at 0x80008800 !!!

    *** Booting Zephyr OS build zephyr-v2.5.0-3077-g3a7e0f875cf1  ***

    Running test suite socket_getaddrinfo

    ===================================================================

    START - test_getaddrinfo_setup

     PASS - test_getaddrinfo_setup in 0.90 seconds

    ===================================================================

    START - test_getaddrinfo_ok

    

        Assertion failed at WEST_TOPDIR/zephyr/tests/net/socket/getaddrinfo/src/main.c:232: test_getaddrinfo_ok: (false is false)

    Did not receive all queries

     FAIL - test_getaddrinfo_ok in 2.155 seconds

    ===================================================================

    START - test_getaddrinfo_cancelled

    

        Assertion failed at WEST_TOPDIR/zephyr/tests/net/socket/getaddrinfo/src/main.c:252: test_getaddrinfo_cancelled: (false is false)

    Did not receive all queries

     FAIL - test_getaddrinfo_cancelled in 0.15 seconds

    ===================================================================

    START - test_getaddrinfo_no_host

     PASS - test_getaddrinfo_no_host in 0.1 seconds

    ===================================================================

    START - test_getaddrinfo_num_ipv4

     PASS - test_getaddrinfo_num_ipv4 in 0.1 seconds

    ===================================================================

    START - test_getaddrinfo_num_ipv6

     PASS - test_getaddrinfo_num_ipv6 in 0.1 seconds

    ===================================================================

    START - test_getaddrinfo_flags_numerichost

     PASS - test_getaddrinfo_flags_numerichost in 0.1 seconds

    ===================================================================

    START - test_getaddrinfo_ipv4_hints_ipv6

     PASS - test_getaddrinfo_ipv4_hints_ipv6 in 0.1 seconds

    ===================================================================

    START - test_getaddrinfo_ipv6_hints_ipv4

     PASS - test_getaddrinfo_ipv6_hints_ipv4 in 0.1 seconds

    ===================================================================

    START - test_getaddrinfo_port_invalid

     PASS - test_getaddrinfo_port_invalid in 0.1 seconds

    ===================================================================

    START - test_getaddrinfo_null_host

     PASS - test_getaddrinfo_null_host in 0.1 seconds

    ===================================================================

    Test suite socket_getaddrinfo failed.

    ===================================================================

    PROJECT EXECUTION FAILED

Environment (please complete the following information):

  • OS: (e.g. Linux, MacOS, Windows)
  • Toolchain (e.g Zephyr SDK, ...)
  • Commit SHA or Version used: zephyr-v2.5.0-3077-g3a7e0f875cf1
@hakehuang hakehuang added bug The issue is a bug, or the PR is fixing a bug area: Networking platform: NXP NXP labels May 6, 2021
@hakehuang
Copy link
Collaborator Author

@MaureenHelm , @dleach02 , looks like the test is not reliable, but need owner to confirm

@dleach02
Copy link
Member

dleach02 commented May 10, 2021

Hake, I'm not able to reproduce this problem. Can you retest with the 2.6 rc1 candidate?

*** Booting Zephyr OS build zephyr-v2.5.0-3651-g793e2c1891b4 ***

@jukkar
Copy link
Member

jukkar commented May 10, 2021

I tried this with 2.6.0-rc1

** Booting Zephyr OS build zephyr-v2.5.0-3767-g5e9d6d638c62  **

and did not see any issues.

@hakehuang
Copy link
Collaborator Author

hakehuang commented May 10, 2021

@jukkar @dleach02
I still have problem with v2.6.0-rc1
commit 730acbd

    *** Booting Zephyr OS build zephyr-v2.5.0-3761-g730acbd6ed85  ***

    Running test suite socket_getaddrinfo

    ===================================================================

    START - test_getaddrinfo_setup

     PASS - test_getaddrinfo_setup in 0.1 seconds

    ===================================================================

    START - test_getaddrinfo_ok

    

        Assertion failed at WEST_TOPDIR/zephyr/tests/net/socket/getaddrinfo/src/main.c:232: test_getaddrinfo_ok: (false is false)

    Did not receive all queries

     FAIL - test_getaddrinfo_ok in 2.115 seconds

    ===================================================================

    START - test_getaddrinfo_cancelled

    

        Assertion failed at WEST_TOPDIR/zephyr/tests/net/socket/getaddrinfo/src/main.c:252: test_getaddrinfo_cancelled: (false is false)

    Did not receive all queries

     FAIL - test_getaddrinfo_cancelled in 0.15 seconds

    ===================================================================

    START - test_getaddrinfo_no_host

     PASS - test_getaddrinfo_no_host in 0.1 seconds

    ===================================================================

    START - test_getaddrinfo_num_ipv4

     PASS - test_getaddrinfo_num_ipv4 in 0.1 seconds

    ===================================================================

    START - test_getaddrinfo_num_ipv6

     PASS - test_getaddrinfo_num_ipv6 in 0.1 seconds

    ===================================================================

    START - test_getaddrinfo_flags_numerichost

     PASS - test_getaddrinfo_flags_numerichost in 0.1 seconds

    ===================================================================

    START - test_getaddrinfo_ipv4_hints_ipv6

     PASS - test_getaddrinfo_ipv4_hints_ipv6 in 0.1 seconds

    ===================================================================

    START - test_getaddrinfo_ipv6_hints_ipv4

     PASS - test_getaddrinfo_ipv6_hints_ipv4 in 0.1 seconds

    ===================================================================

    START - test_getaddrinfo_port_invalid

     PASS - test_getaddrinfo_port_invalid in 0.1 seconds

    ===================================================================

    START - test_getaddrinfo_null_host

     PASS - test_getaddrinfo_null_host in 0.1 seconds

    ===================================================================

    Test suite socket_getaddrinfo failed.

    ===================================================================

    PROJECT EXECUTION FAILED

@dleach02
Copy link
Member

dleach02 commented May 10, 2021

Okay. If you connect the K64F to a network then I see the failures Hake is seeing.

@jukkar, I'm thinking that this test does want to be connected to a valid network?

@hakehuang
Copy link
Collaborator Author

if connect with ethernet cable you will see more tests is runable

*** Booting Zephyr OS build zephyr-v2.5.0-3761-g730acbd6ed85  ***
Running test suite socket_getaddrinfo
===================================================================
START - test_getaddrinfo_setup
 PASS - test_getaddrinfo_setup in 0.1 seconds
===================================================================
START - test_getaddrinfo_ok

    Assertion failed at ../src/main.c:232: test_getaddrinfo_ok: (false is false)
Did not receive all queries
 FAIL - test_getaddrinfo_ok in 2.111 seconds
===================================================================
START - test_getaddrinfo_cancelled

    Assertion failed at ../src/main.c:252: test_getaddrinfo_cancelled: (false is false)
Did not receive all queries
 FAIL - test_getaddrinfo_cancelled in 0.11 seconds
===================================================================
START - test_getaddrinfo_no_host
 PASS - test_getaddrinfo_no_host in 0.1 seconds
===================================================================
START - test_getaddrinfo_num_ipv4
 PASS - test_getaddrinfo_num_ipv4 in 0.1 seconds
===================================================================
START - test_getaddrinfo_num_ipv6
 PASS - test_getaddrinfo_num_ipv6 in 0.1 seconds
===================================================================
START - test_getaddrinfo_flags_numerichost
 PASS - test_getaddrinfo_flags_numerichost in 0.1 seconds
===================================================================
START - test_getaddrinfo_ipv4_hints_ipv6
 PASS - test_getaddrinfo_ipv4_hints_ipv6 in 0.1 seconds
===================================================================
START - test_getaddrinfo_ipv6_hints_ipv4
 PASS - test_getaddrinfo_ipv6_hints_ipv4 in 0.1 seconds
===================================================================
START - test_getaddrinfo_port_invalid
 PASS - test_getaddrinfo_port_invalid in 0.1 seconds
===================================================================
START - test_getaddrinfo_null_host
 PASS - test_getaddrinfo_null_host in 0.1 seconds
===================================================================
Test suite socket_getaddrinfo failed.
===================================================================
PROJECT EXECUTION FAILED
I: ETH_0 enabled 100M full-duplex mode.
E: ***** USAGE FAULT *****
E:   Unaligned memory access
E: r0/a1:  0x01f3d900  r1/a2:  0x000027f3  r2/a3:  0x200020b0
E: r3/a4:  0x20001338 r12/ip:  0x400c0000 r14/lr:  0x00011ef5
E:  xpsr:  0x81000000
E: Faulting instruction address (r15/pc): 0x00011eaa
E: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
E: Current thread: 0x200014c0 (sysworkq)
E: Halting system

but if no ethernet cable, then

*** Booting Zephyr OS build zephyr-v2.5.0-3761-g730acbd6ed85  ***
Running test suite socket_getaddrinfo
===================================================================
START - test_getaddrinfo_setup
 PASS - test_getaddrinfo_setup in 0.1 seconds
===================================================================
START - test_getaddrinfo_ok
 PASS - test_getaddrinfo_ok in 4.1 seconds
===================================================================
START - test_getaddrinfo_cancelled
 PASS - test_getaddrinfo_cancelled in 4.2 seconds
===================================================================
START - test_getaddrinfo_no_host
 PASS - test_getaddrinfo_no_host in 0.1 seconds
===================================================================
START - test_getaddrinfo_num_ipv4
 PASS - test_getaddrinfo_num_ipv4 in 0.1 seconds
===================================================================
START - test_getaddrinfo_num_ipv6
 PASS - test_getaddrinfo_num_ipv6 in 0.1 seconds
===================================================================
START - test_getaddrinfo_flags_numerichost
 PASS - test_getaddrinfo_flags_numerichost in 0.1 seconds
===================================================================
START - test_getaddrinfo_ipv4_hints_ipv6
 PASS - test_getaddrinfo_ipv4_hints_ipv6 in 0.1 seconds
===================================================================
START - test_getaddrinfo_ipv6_hints_ipv4
 PASS - test_getaddrinfo_ipv6_hints_ipv4 in 0.1 seconds
===================================================================
START - test_getaddrinfo_port_invalid
 PASS - test_getaddrinfo_port_invalid in 0.1 seconds
===================================================================
START - test_getaddrinfo_null_host
 PASS - test_getaddrinfo_null_host in 0.1 seconds
===================================================================
Test suite socket_getaddrinfo succeeded
===================================================================
PROJECT EXECUTION SUCCESSFUL

@jukkar
Copy link
Member

jukkar commented May 10, 2021

I'm thinking that this test does want to be connected to a valid network?

I have done the tests without any cable connected. This looks like the issue we had earlier when the test uses the board Ethernet controller instead of the fake one which is suppose to be used by the test. This should be an easy fix, I will check if the culprit is that one.

@dleach02
Copy link
Member

yeah, this does look like a "self-hosted" test... again. But I don't see where or how to setup for a dummy interface

jukkar added a commit to jukkar/zephyr that referenced this issue May 10, 2021
If the tests/net/socket/getaddrinfo is run in a board that has
Ethernet controller, then it is possible that it will interfere
the test if the Ethernet cable is connected. As the test only
needs loopback support to run, disable the Ethernet as it is
not needed by the test.

Fixes zephyrproject-rtos#34923

Signed-off-by: Jukka Rissanen <[email protected]>
@jukkar
Copy link
Member

jukkar commented May 10, 2021

The test used loopback interface and as we do not really need Ethernet, then disabling Ethernet will fix the issue.

@galak galak added this to the v2.6.0 milestone May 11, 2021
@galak galak added the priority: medium Medium impact/importance bug label May 11, 2021
nashif pushed a commit that referenced this issue May 14, 2021
If the tests/net/socket/getaddrinfo is run in a board that has
Ethernet controller, then it is possible that it will interfere
the test if the Ethernet cable is connected. As the test only
needs loopback support to run, disable the Ethernet as it is
not needed by the test.

Fixes #34923

Signed-off-by: Jukka Rissanen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants