Skip to content

[BUG] rv-virt:citest fails with Load Access Fault at ltp_interfaces_pthread_barrierattr_init_2_1 (risc-v-05) #15170

Closed
apache/nuttx-apps
#2888

Description

@lupyuen

Description / Steps to reproduce the issue

Inside CI Build risc-v-05: rv-virt:citest fails with a Load Access Fault at ltp_interfaces_pthread_barrierattr_init_2_1:

https://gist.github.com/lupyuen/4ec372cea171b99ae5bc5603aa75a6a7

sudo docker run \
  -it \
  --name nuttx \
  ghcr.io/apache/nuttx/apache-nuttx-ci-linux:latest \
  /bin/bash
cd
git clone https://github.com/apache/nuttx
git clone https://github.com/apache/nuttx-apps apps
pushd nuttx ; echo NuttX Source: https://github.com/apache/nuttx/tree/$(git rev-parse HEAD) ; popd
pushd apps  ; echo NuttX Apps: https://github.com/apache/nuttx-apps/tree/$(git rev-parse HEAD) ; popd
cd nuttx/tools/ci
./cibuild.sh -c -A -N -R testlist/risc-v-05.dat 
[Wait for it to fail. Press Ctrl-C a few times to stop it]
cat /root/nuttx/boards/risc-v/qemu-rv/rv-virt/configs/citest/logs/rv-virt/qemu/*

## Output shows:
NuttX Source: https://github.com/apache/nuttx/tree/5cdc6c77cfcecc162b74b1bcc902fde978384352
NuttX Apps: https://github.com/apache/nuttx-apps/tree/fa22f80ee3a0b6b232752e8d796129bd79082da8
...
test_open_posix/test_openposix_.py::test_ltp_interfaces_sem_post_1_2 PASSED               [ 17%]
test_open_posix/test_openposix_.py::test_ltp_interfaces_sigtimedwait_2_1 PASSED           [ 17%]
test_open_posix/test_openposix_.py::test_ltp_interfaces_pthread_barrierattr_init_2_1 FAILED [ 17%]
test_open_posix/test_openposix_.py::test_ltp_interfaces_sigaction_13_9 FAILED             [ 17%]
test_open_posix/test_openposix_.py::test_ltp_interfaces_mq_send_14_1 FAILED               [ 17%]
...
nsh> ltp_interfaces_pthread_barrierattr_init_2_1
riscv_exception: EXCEPTION: Load access fault. MCAUSE: 00000005, EPC: 800074c6, MTVAL: 000002a4
riscv_exception: PANIC!!! Exception = 00000005
dump_assert_info: Current Version: NuttX  12.7.0 5cdc6c77cf Dec 13 2024 05:10:36 risc-v
dump_assert_info: Assertion failed panic: at file: common/riscv_exception.c:131 task: ltp_interfaces_pthread_barriera process: ltp_interfaces_pthread_barriera 0x800664ae
up_dump_register: EPC: 800074c6

Update: Ah the stack is full for ltp_interfaces_pthread_barrierattr_init_2_1! Let's increase it and retest. (But where is it defined?)
https://gist.github.com/lupyuen/4ec372cea171b99ae5bc5603aa75a6a7#file-gistfile1-txt-L5587

dump_tasks:    PID GROUP PRI POLICY   TYPE    NPX STATE   EVENT      SIGMASK          STACKBASE  STACKSIZE      USED   FILLED    COMMAND
dump_tasks:   ----   --- --- -------- ------- --- ------- ---------- ---------------- 0x8014dd70      2048       748    36.5%    irq
dump_task:     740   740 100 RR       Task    -   Running            0000000000000000 0x80178650      3936      3936   100.0%!   ltp_interfaces_pthread_barriera

Update 2: Stack Size for ltp_interfaces_pthread_barrierattr_init_2_1 might be here:

https://github.com/apache/nuttx-apps/blob/master/testing/ltp/Kconfig#L14-L16

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

Ubuntu LTS at GitHub Actions

NuttX Version

master

Issue Architecture

[Arch: risc-v]

Issue Area

[Area: Other]

Verification

  • I have verified before submitting the report.

Activity

  1. added
    Type: Bug
    on Dec 13, 2024
  2. added
    Arch: risc-v
    OS: Linux
    on Dec 13, 2024
  3. acassis commented on Dec 14, 2024

    @acassis
    Contributor

    @lupyuen any idea which commit introduced this issue?

  4. lupyuen commented on Dec 15, 2024

    @lupyuen
    MemberAuthor

    @acassis I think it happens sometime after this commit 656883f, based on the earlier discussion

    I'll have to run "git bisect" on the past month of commits.

  5. added a commit that references this issue on Dec 16, 2024
  6. linked a pull request that will close this issuetesting/ltp: Increase Stack Size #2888on Dec 16, 2024
  7. added a commit that references this issue on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Arch: risc-vOS: LinuxType: Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions