Documentation | Rust Documentation: Hello World on SPARC crashes since 2024-Oct-10 (#37)

Jonathan Pallant (@thejpster) gitlab at rtems.org
Wed Oct 16 18:38:52 UTC 2024




Jonathan Pallant commented: https://gitlab.rtems.org/rtems/docs/rtems-docs/-/issues/37#note_113173


This bug is caused by new checks in the Rust pointer offset code which detect that the AMBA plug-and-play scan is trying to copy from the very last byte in memory. Some sources say this is UB which is why we now check for it.

Is it possible to change the AMBA code to *not* read from 0xFFFF_FFFF?

The stack trace is:

```text
#0  _SPARC_Bad_trap () at ../../../cpukit/score/cpu/sparc/sparc-bad-trap.S:55
#1  0x4000a090 in core::ptr::mut_ptr::{impl#0}::add::runtime_add_nowrap (this=0x0, count=1, size=4)
    at /home/jonathan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mut_ptr.rs:1010
#2  0x4000a044 in core::ptr::mut_ptr::{impl#0}::add::precondition_check (this=0x0, count=1, size=0)
    at /home/jonathan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mut_ptr.rs:1021
#3  0x40008de8 in core::ptr::mut_ptr::{impl#0}::add<usize> (self=0xfffffffc, count=1)
    at /home/jonathan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ub_checks.rs:77
#4  compiler_builtins::mem::impls::copy_forward::copy_forward_aligned_words (dest=0x40025398 <_ISR_Stack_area_begin+3672>, src=0xffffffe0, n=32)
    at src/mem/impls.rs:48
#5  compiler_builtins::mem::impls::copy_forward (dest=0x40025398 <_ISR_Stack_area_begin+3672>, src=0xffffffe0, n=32) at src/mem/impls.rs:112
#6  compiler_builtins::mem::memcpy (dest=0x40025398 <_ISR_Stack_area_begin+3672>, src=0xffffffe0, n=32) at src/mem/mod.rs:25
#7  0x40009ab8 in compiler_builtins::mem::memcpy::memcpy (dest=0x40025398 <_ISR_Stack_area_begin+3672>, src=0xffffffe0, n=32) at src/macros.rs:480
#8  0x4000d540 in ambapp_scan2 (abus=0x0, ioarea=0, ctx=0x40025418 <_ISR_Stack_area_begin+3800>, parent=0x0, root=0x0)
    at ../../../bsps/shared/grlib/amba/ambapp.c:225
#9  0x4000c94c in ambapp_plb () at ../../../bsps/sparc/leon3/start/amba.c:76
#10 ambapp_plb () at ../../../bsps/sparc/leon3/start/amba.c:59
#11 amba_initialize () at ../../../bsps/sparc/leon3/start/amba.c:145
#12 0x4001407c in rtems_initialize_executive () at ../../../cpukit/sapi/src/exinit.c:155
#13 0x4000c304 in boot_card (cmdline=0x0) at ../../../bsps/shared/start/bootcard.c:74
#14 0x400010d0 in hard_reset () at ../../../bsps/sparc/shared/start/start.S:524
```

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/docs/rtems-docs/-/issues/37#note_113173
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20241016/794d8e57/attachment.htm>


More information about the bugs mailing list