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

Update sabre-6quad with QEMU #8438

Merged
merged 3 commits into from
Feb 6, 2023

Conversation

masayuki2009
Copy link
Contributor

Summary

  • This commit consists following two commits
    • commit 1: boards: sabre-6quad: Enable DEBUG_ASSERTION in citest
      • Since QEMU does not report L2CC information correctly,
        NuttX stops if DEBUG_ASSERTIONS=y.
      • This commit adds DEBUG_ASSERTIONS=y to citest/defconfigs
        and disables L2CC related configs.
      • Also, it disables RAMLOG to show the crash information
    • commit 2: boards: sabre-6quad: Update README.txt

Impact

  • None

Testing

  • Tested with QEMU-7.1

Summary:
- Since QEMU does not report L2CC information correctly,
  NuttX stops if DEBUG_ASSERTIONS=y.
- This commit adds DEBUG_ASSERTIONS=y to citest/defconfigs
  and disables L2CC related configs.
- Also, it disables RAMLOG to show the crash information

Impact:
- None

Testing:
- Tested with QEMU-7.1

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Summary:
- This commit updates README.txt regarding QEMU with DEBUG_ASSERTIONS=y

Impact:
- None

Testing:
- Tested with QEMU-7.1

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
@masayuki2009
Copy link
Contributor Author

masayuki2009 commented Feb 6, 2023

@xiaoxiang781216
Let me try if sabre-6quad:citest works with this PR.
#8364

@masayuki2009
Copy link
Contributor Author

masayuki2009 commented Feb 6, 2023

Hmm, it seems that heap corruption happened.
However, I can not reproduce the crash locally.

________________________ ERROR at setup of test_helloxx ________________________

get_option = (None, 'sabre-6quad', '/github/workspace/sources/nuttx', '/data', '/github/workspace/sources/nuttx/boards/arm/imx6/sabre-6quad/configs/citest/logs/sabre-6quad/qemu', None, ...)

    @pytest.fixture(scope="session", name="p")
    def connect_nuttx_session(get_option):
        (
            dev,
            board,
            vela_path,
            fs,
            log_path,
            ota_version,
            core,
            sudo,
            ci,
            method,
            target,
        ) = get_option
        print(get_option)
        p = connectNuttx(
            board, vela_path, dev, log_path, fs, ota_version, core, sudo, ci, method, target
        )
>       p.setup()

/github/workspace/sources/nuttx/tools/ci/testrun/script/conftest.py:98: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/github/workspace/sources/nuttx/tools/ci/testrun/utils/common.py:61: in setup
    start.startQemu(self, self.path, self.log_path, self.board, self.sudo)
/github/workspace/sources/nuttx/tools/ci/testrun/utils/common.py:234: in startQemu
    self.process.expect(self.PROMPT)
/usr/local/lib/python3.8/dist-packages/pexpect/spawnbase.py:343: in expect
    return self.expect_list(compiled_pattern_list,
/usr/local/lib/python3.8/dist-packages/pexpect/spawnbase.py:372: in expect_list
    return exp.expect_loop(timeout)
/usr/local/lib/python3.8/dist-packages/pexpect/expect.py:181: in expect_loop
    return self.timeout(e)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pexpect.expect.Expecter object at 0x7f539326aa30>
err = TIMEOUT('Timeout exceeded.')

    def timeout(self, err=None):
        spawn = self.spawn
    
        spawn.before = spawn._before.getvalue()
        spawn.after = TIMEOUT
        index = self.searcher.timeout_index
        if index >= 0:
            spawn.match = TIMEOUT
            spawn.match_index = index
            return index
        else:
            spawn.match = None
            spawn.match_index = None
            msg = str(spawn)
            msg += '\nsearcher: %s' % self.searcher
            if err is not None:
                msg = str(err) + '\n' + msg
    
            exc = TIMEOUT(msg)
            exc.__cause__ = None    # in Python 3.x we can use "raise exc from None"
>           raise exc
E           pexpect.exceptions.TIMEOUT: Timeout exceeded.
E           <pexpect.pty_spawn.spawn object at 0x7f539326ab20>
E           command: /usr/bin/bash
E           args: ['/usr/bin/bash', '-c', 'qemu-system-arm -M sabrelite -smp 1 -bios none -kernel ./nuttx -nographic | tee /github/workspace/sources/nuttx/boards/arm/imx6/sabre-6quad/configs/citest/logs/sabre-6quad/qemu/sabre-6quad_20230206_060401.log']
E           buffer (last 100 chars): b':27 arm\r\r\n_assert: Assertion failed : at file: mm_heap/mm_malloc.c:195 task: Idle Task 0x1080106d\r\r\n'
E           before (last 100 chars): b':27 arm\r\r\n_assert: Assertion failed : at file: mm_heap/mm_malloc.c:195 task: Idle Task 0x1080106d\r\r\n'
E           after: <class 'pexpect.exceptions.TIMEOUT'>
E           match: None
E           match_index: None
E           exitstatus: None
E           flag_eof: False
E           pid: 317973
E           child_fd: 7
E           closed: False
E           timeout: 30
E           delimiter: <class 'pexpect.exceptions.EOF'>
E           logfile: None
E           logfile_read: None
E           logfile_send: None
E           maxread: 2000
E           ignorecase: False
E           searchwindowsize: None
E           delaybeforesend: 0.05
E           delayafterclose: 0.1
E           delayafterterminate: 0.1
E           searcher: searcher_re:
E               0: re.compile(b'nsh>')

/usr/local/lib/python3.8/dist-packages/pexpect/expect.py:144: TIMEOUT
_________________________ ERROR at setup of test_pipe __________________________

@masayuki2009
Copy link
Contributor Author

Hmm, it seems that heap corruption happened.
However, I can not reproduce the crash locally.

I can reproduce the crash.

$ /home/ishikawa/opensource/QEMU/qemu-7.1/build/qemu-system-arm -M sabrelite -smp 1 -bios none -kernel ./nuttx -nographic ABDGHIJKNOPQ
_assert: Current Version: NuttX  12.0.0 388fa31892-dirty Feb  6 2023 16:22:38 arm
_assert: Assertion failed : at file: mm_heap/mm_malloc.c:195 task: Idle Task 0x1080106d

It seems that we need to add -m 1024

$ /home/ishikawa/opensource/QEMU/qemu-7.1/build/qemu-system-arm -M sabrelite -m 1024 -smp 1 -bios none -kernel ./nuttx -nographic
ABDGHIJKNOPQ

NuttShell (NSH) NuttX-12.0.0
nsh>

I will fix common.py in this PR.

Summary:
- I noticed that nuttx crashes if DEBUG_ASSERTIONS=y
- This commit fixes this issue by changing QEMU options

Impact:
- None

Testing:
- Tested with QEMU

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
@masayuki2009
Copy link
Contributor Author

It seems all the tests passed.

++ basename /github/workspace/sources/nuttx/boards/arm/imx6/sabre-6quad/configs/citest
+ config=citest
+ '[' sabre-6quad == sim ']'
+ '[' st == 64 ']'
+ target=qemu
+ mark=qemu
+ core=qemu
++ find /github/workspace/sources/nuttx -type f -name nuttx
+ image=/github/workspace/sources/nuttx/nuttx
+ path=/github/workspace/sources/nuttx
+ cd /github/workspace/sources/nuttx/tools/ci/testrun/script
+ python3 -m pytest -m qemu ./ -B sabre-6quad -P /github/workspace/sources/nuttx -L /github/workspace/sources/nuttx/boards/arm/imx6/sabre-6quad/configs/citest/logs/sabre-6quad/qemu -R qemu -C --json=/github/workspace/sources/nuttx/boards/arm/imx6/sabre-6quad/configs/citest/logs/sabre-6quad/qemu/pytest.json
============================= test session starts ==============================
platform linux -- Python 3.8.10, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /github/workspace/sources/nuttx/tools/ci/testrun, configfile: pytest.ini
plugins: repeat-0.9.1, ordering-0.6, json-0.4.0
collecting ... collected 12 items
test_example/test_example.py::test_hello PASSED                          [  8%]
test_example/test_example.py::test_pipe PASSED                           [ 25%]
test_example/test_example.py::test_popen PASSED                          [ 33%]
test_example/test_example.py::test_usrsocktest PASSED                    [ 41%]
test_os/test_os.py::test_ostest PASSED                                   [ 50%]
test_os/test_os.py::test_mm SKIPPED (unsupported at sabre-6quad)         [ 58%]
test_os/test_os.py::test_cxxtest SKIPPED (unsupported at sabre-6quad)    [ 66%]
test_os/test_os.py::test_scanftest SKIPPED (unsupported at sabre-6quad)  [ 75%]
test_os/test_os.py::test_getprime PASSED                                 [ 83%]
test_os/test_os.py::test_fs_test SKIPPED (unsupported at sabre-6quad)    [ 91%]
test_os/test_os.py::test_psram_test SKIPPED (unsupported at sabre-6quad) [100%]
- generated json report: /github/workspace/sources/nuttx/boards/arm/imx6/sabre-6quad/configs/citest/logs/sabre-6quad/qemu/pytest.json -
=================== 7 passed, 5 skipped in 168.88s (0:02:48) ===================

@masayuki2009
Copy link
Contributor Author

@jerpelea
Please merge this PR.

@xiaoxiang781216 xiaoxiang781216 merged commit 7970462 into apache:master Feb 6, 2023
@masayuki2009 masayuki2009 deleted the sabre-6quad-qemu branch June 3, 2023 10:16
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.

4 participants