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

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

Closed
1 task done
lupyuen opened this issue Dec 13, 2024 · 2 comments · Fixed by apache/nuttx-apps#2888
Labels
Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture OS: Linux Issues related to Linux (building system, etc) Type: Bug Something isn't working

Comments

@lupyuen
Copy link
Member

lupyuen commented Dec 13, 2024

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.
@lupyuen lupyuen added the Type: Bug Something isn't working label Dec 13, 2024
@github-actions github-actions bot added Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture OS: Linux Issues related to Linux (building system, etc) labels Dec 13, 2024
@acassis
Copy link
Contributor

acassis commented Dec 14, 2024

@lupyuen any idea which commit introduced this issue?

@lupyuen
Copy link
Member Author

lupyuen commented Dec 15, 2024

@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.

lupyuen added a commit to lupyuen2/wip-nuttx-apps that referenced this issue Dec 16, 2024
Inside CI Build risc-v-05: `rv-virt:citest` fails with a Stack Overflow at ltp_interfaces_pthread_barrierattr_init_2_1:
- apache/nuttx#15170

This PR doubles the Stack Size for `testing/ltp` (from 4096 bytes to 8192), so that `rv-virt:citest` completes successfully.
@lupyuen lupyuen linked a pull request Dec 16, 2024 that will close this issue
xiaoxiang781216 pushed a commit to apache/nuttx-apps that referenced this issue Dec 16, 2024
Inside CI Build risc-v-05: `rv-virt:citest` fails with a Stack Overflow at ltp_interfaces_pthread_barrierattr_init_2_1:
- apache/nuttx#15170

This PR doubles the Stack Size for `testing/ltp` (from 4096 bytes to 8192), so that `rv-virt:citest` completes successfully.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture OS: Linux Issues related to Linux (building system, etc) Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants