zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.82k stars 6.6k forks source link

tests: native_sim: modem_cmux build failure #76456

Closed hakehuang closed 3 months ago

hakehuang commented 3 months ago

Describe the bug

fails

To Reproduce

scripts/twister -p native_sim -T tests/subsys/modem/modem_cmux -s modem.modem_cmux --build-only

Expected behavior build PASS

Impact

modem_mcux support

Logs and console output

'''

[3/110] Generating misc/generated/syscalls_subdirs.trigger [4/110] Generating misc/generated/syscalls.json, misc/generated/struct_tags.json [5/110] Generating include/generated/zephyr/syscall_dispatch.c, include/generated/zephyr/syscall_list.h [6/110] Generating include/generated/zephyr/driver-validation.h [7/110] Generating include/generated/zephyr/kobj-types-enum.h, include/generated/zephyr/otype-to-str.h, include/generated/zephyr/otype-to-size.h [8/110] Building C object zephyr/CMakeFiles/offsets.dir/arch/posix/core/offsets/offsets.c.obj [9/110] Generating include/generated/zephyr/offsets.h [10/110] Building C object CMakeFiles/app.dir/src/main.c.obj FAILED: CMakeFiles/app.dir/src/main.c.obj ccache /usr/lib/llvm-16/bin/clang -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DTC_RUNID=6aa275a52394d71b47eca3af1273f500 -DZEPHYR=1 -I/w/zephyr/zephyr/tests/subsys/modem/modem_cmux/../mock -I/__w/zephyr/zephyr/twister-out/native_sim/tests/subsys/modem/modem_cmux/modem.modem_cmux/zephyr/include/generated/zephyr -I/w/zephyr/zephyr/include -I/w/zephyr/zephyr/twister-out/native_sim/tests/subsys/modem/modem_cmux/modem.modem_cmux/zephyr/include/generated -I/__w/zephyr/zephyr/soc/native/inf_clock -I/w/zephyr/zephyr/boards/native/native_sim -I/w/zephyr/zephyr/scripts/native_simulator/common/src/include -I/__w/zephyr/zephyr/scripts/native_simulator/native/src/include -I/w/zephyr/zephyr/subsys/testsuite/include -I/w/zephyr/zephyr/subsys/testsuite/coverage -I/w/zephyr/zephyr/subsys/testsuite/ztest/include -fno-strict-aliasing -Werror -O0 -imacros /w/zephyr/zephyr/twister-out/native_sim/tests/subsys/modem/modem_cmux/modem.modem_cmux/zephyr/include/generated/zephyr/autoconf.h -fno-common -g -gdwarf-4 -fcolor-diagnostics --config /__w/zephyr/zephyr/cmake/toolchain/llvm/clang_libgcc.cfg -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-unused-but-set-variable -Wno-typedef-redefinition -Wno-deprecated-non-prototype -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wno-sometimes-uninitialized -Wno-shift-overflow -Wno-missing-braces -Wno-self-assign -Wno-address-of-packed-member -Wno-unused-function -Wno-initializer-overrides -Wno-section -Wno-unknown-warning-option -Wno-unused-variable -Wno-format-invalid-specifier -Wno-gnu -Wno-tautological-compare -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -Wno-vla -fmacro-prefix-map=/w/zephyr/zephyr/tests/subsys/modem/modem_cmux=CMAKE_SOURCE_DIR -fmacro-prefix-map=/w/zephyr/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/__w/zephyr=WEST_TOPDIR -ffunction-sections -fdata-sections -m32 -msse2 -mfpmath=sse -fvisibility=hidden -std=c11 -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles/app.dir/src/main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj -c /w/zephyr/zephyr/tests/subsys/modem/modem_cmux/src/main.c /__w/zephyr/zephyr/tests/subsys/modem/modem_cmux/src/main.c:796:28: error: too few arguments to function call, expected 2, have 1 modem_pipe_open(dlci1_pipe);


/__w/zephyr/zephyr/include/zephyr/modem/pipe.h:99:5: note: 'modem_pipe_open' declared here
int modem_pipe_open(struct modem_pipe *pipe, k_timeout_t timeout);
    ^
/__w/zephyr/zephyr/tests/subsys/modem/modem_cmux/src/main.c:797:28: error: too few arguments to function call, expected 2, have 1
        modem_pipe_open(dlci2_pipe);
        ~~~~~~~~~~~~~~~           ^
/__w/zephyr/zephyr/include/zephyr/modem/pipe.h:99:5: note: 'modem_pipe_open' declared here
int modem_pipe_open(struct modem_pipe *pipe, k_timeout_t timeout);
    ^
/__w/zephyr/zephyr/tests/subsys/modem/modem_cmux/src/main.c:802:29: error: too few arguments to function call, expected 2, have 1
        modem_pipe_close(dlci1_pipe);
        ~~~~~~~~~~~~~~~~           ^
/__w/zephyr/zephyr/include/zephyr/modem/pipe.h:176:5: note: 'modem_pipe_close' declared here
int modem_pipe_close(struct modem_pipe *pipe, k_timeout_t timeout);
    ^
/__w/zephyr/zephyr/tests/subsys/modem/modem_cmux/src/main.c:803:29: error: too few arguments to function call, expected 2, have 1
        modem_pipe_close(dlci2_pipe);
        ~~~~~~~~~~~~~~~~           ^
/__w/zephyr/zephyr/include/zephyr/modem/pipe.h:176:5: note: 'modem_pipe_close' declared here
int modem_pipe_close(struct modem_pipe *pipe, k_timeout_t timeout);
    ^
/__w/zephyr/zephyr/tests/subsys/modem/modem_cmux/src/main.c:812:39: error: too few arguments to function call, expected 2, have 1
        zassert_ok(modem_pipe_open(dlci1_pipe));
                   ~~~~~~~~~~~~~~~           ^
/__w/zephyr/zephyr/subsys/testsuite/ztest/include/zephyr/ztest_assert.h:283:41: note: expanded from macro 'zassert_ok'
#define zassert_ok(cond, ...) zassert(!(cond), #cond " is non-zero", ##__VA_ARGS__)
                                        ^~~~
/__w/zephyr/zephyr/subsys/testsuite/ztest/include/zephyr/ztest_assert.h:189:14: note: expanded from macro 'zassert'
        _zassert_va(cond, default_msg, COND_CODE_1(__VA_OPT__(1), (__VA_ARGS__), (NULL)))
                    ^~~~
/__w/zephyr/zephyr/subsys/testsuite/ztest/include/zephyr/ztest_assert.h:186:16: note: expanded from macro '_zassert_va'
        _zassert_base(cond, default_msg, msg, ##__VA_ARGS__)
                      ^~~~
/__w/zephyr/zephyr/subsys/testsuite/ztest/include/zephyr/ztest_assert.h:175:25: note: expanded from macro '_zassert_base'
                bool _ret = z_zassert(cond, _msg ? ("(" default_msg ")") : (default_msg), __FILE__,\
                                      ^~~~
/__w/zephyr/zephyr/include/zephyr/modem/pipe.h:99:5: note: 'modem_pipe_open' declared here
int modem_pipe_open(struct modem_pipe *pipe, k_timeout_t timeout);
    ^
/__w/zephyr/zephyr/tests/subsys/modem/modem_cmux/src/main.c:814:39: error: too few arguments to function call, expected 2, have 1
        zassert_ok(modem_pipe_open(dlci2_pipe));
                   ~~~~~~~~~~~~~~~           ^
/__w/zephyr/zephyr/subsys/testsuite/ztest/include/zephyr/ztest_assert.h:283:41: note: expanded from macro 'zassert_ok'
#define zassert_ok(cond, ...) zassert(!(cond), #cond " is non-zero", ##__VA_ARGS__)
                                        ^~~~
/__w/zephyr/zephyr/subsys/testsuite/ztest/include/zephyr/ztest_assert.h:189:14: note: expanded from macro 'zassert'
        _zassert_va(cond, default_msg, COND_CODE_1(__VA_OPT__(1), (__VA_ARGS__), (NULL)))
                    ^~~~
/__w/zephyr/zephyr/subsys/testsuite/ztest/include/zephyr/ztest_assert.h:186:16: note: expanded from macro '_zassert_va'
        _zassert_base(cond, default_msg, msg, ##__VA_ARGS__)
                      ^~~~
/__w/zephyr/zephyr/subsys/testsuite/ztest/include/zephyr/ztest_assert.h:175:25: note: expanded from macro '_zassert_base'
                bool _ret = z_zassert(cond, _msg ? ("(" default_msg ")") : (default_msg), __FILE__,\
                                      ^~~~
/__w/zephyr/zephyr/include/zephyr/modem/pipe.h:99:5: note: 'modem_pipe_open' declared here
int modem_pipe_open(struct modem_pipe *pipe, k_timeout_t timeout);
    ^
6 errors generated.
ninja: build stopped: subcommand failed.
'''

**Environment (please complete the following information):**

 - OS: (e.g. Linux,, )
 - Toolchain (e.g Zephyr SDK, ...)
 - Commit SHA or Version used: v3.7.0-227-g3bcaa6f8d631

**Additional context**

this blocking multi-ply CIs https://github.com/zephyrproject-rtos/zephyr/pull/73528/checks?check_run_id=28075460084

git bisect find this issue is introduced by

```
ubuntu@ubuntu-OptiPlex-7050:/home/shared/disk/zephyr_project/zephyr_test/zephyr$ git bisect good
372c7183ef082c70ab5a6a5ba3fe9c486eb3d90f is the first bad commit
commit 372c7183ef082c70ab5a6a5ba3fe9c486eb3d90f
Author: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Date:   Mon Jun 10 17:51:15 2024 +0200

    modem: pipe: Add explicit timeout to sync APIs

    The modem pipe APIs include synchronous calls to open/close,
    which internally use a fixed timeout of 10 seconds. The timeout
    should be configurable through the APIs, anywhere from K_NO_WAIT
    to K_FOREVER.

    This commit adds timeout parameters to the open/close APIs, and
    updates in-tree usage of the open/close APIs to explicitly
    provide the previously implicit timeout of 10 seconds.

    Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>

 drivers/gnss/gnss_luatos_air530z.c            | 14 +++++++-------
 drivers/gnss/gnss_nmea_generic.c              |  4 ++--
 drivers/gnss/gnss_quectel_lcx6g.c             | 12 ++++++------
 drivers/gnss/gnss_u_blox_m10.c                |  8 ++++----
 include/zephyr/modem/pipe.h                   |  6 ++++--
 subsys/modem/modem_pipe.c                     | 14 ++++++++------
 tests/subsys/modem/backends/tty/src/main.c    | 12 ++++++------
 tests/subsys/modem/backends/uart/src/main.c   |  4 ++--
 tests/subsys/modem/modem_chat/src/main.c      |  2 +-
 tests/subsys/modem/modem_cmux/src/main.c      | 22 +++++++++++++---------
 tests/subsys/modem/modem_cmux_pair/src/main.c | 20 ++++++++++----------
 tests/subsys/modem/modem_pipe/src/main.c      | 10 +++++-----
 tests/subsys/modem/modem_ppp/src/main.c       |  2 +-
 13 files changed, 69 insertions(+), 61 deletions(-)

```
bjarki-andreasen commented 3 months ago

Hi, thanks for the detailed issue :) #76461 addresses the issue :)