When memory is accessed by the remote debugging client, the access is
sandboxed with setjmp/longjmp and appropriate exception handlers to
prevent the attempted access from causing a failure of the debugger or
otherwise altering execution. The existing implementation works as
expected when the context executing the memory access and the exception
context resulting from a failed access do not share a stack.
In the case of AArch64, a failed access when the debugger is already in
exception context causes a re-entry into exception context where the
machine state is pushed onto the same stack that was in use where the
exception occurred. When setjmp is called inside a stack frame and the
exception occurs outside that stack frame, the stack frame is unwound
before the exception occurs and the exception entry overwrites the area
previously occupied by the stack frame housing the setjmp and corrupting
the link register that is stored there. After restoration of state using
longjmp(), this corrupted link register information is loaded from the
stack frame and undesired behavior occurs.
In the instance of this bug that was encountered, the corrupted link
register contained an unaligned pointer which caused an unending cascade
of prefetch abort exceptions presenting as a hard hang.
Closes#5273
- Assume a relocation record with a symbol name with a length of
0 is resolved. ARM seems to create a symbol with no name for
R_ARM_V4BX relocation records.
- Move the addition of the rtems_rtl_base_sym_global_add symbol
to the global symbol table to the weak
rtems_rtl_base_global_syms_init call. If symbols are
embedded the support for runtime loading symbols is over
loaded. This change is required so the base object has a
valid global symbol table attached to track dependencies.
Fixes#5234
The RTEMS_CAPTURE_OVERFLOW is an overflow flag for each CPU, and its
value is the same as RTEMS_CAPTURE_INIT. Executing rtems_capture_flush
will set the RTEMS_CAPTURE_INIT flag to 0 in the global flags.
Fixes#5184.
This commit aligns trampolines for THUMB and ARM instructions
(CALL/JUMP24 and THM_JUMP24/THM_PC22).
According to the ARM technical reference in section "Register-relative
and PC-relative expressions":
In Thumb code:
- For B, BL, CBNZ, and CBZ instructions, the value of the PC is the
address of the current instruction plus 4 bytes.
- For all other instructions that use labels, the value of the PC is
the address of the current instruction plus 4 bytes, with bit[1]
of the result cleared to 0 to make it word-aligned.
Closes#5189
The POSIX sporadic server may temporarily remove the real priority of a
thread. Check that the priority node is active before the change is
propagated.
Update #5164.
Previously the system event used by lio_listio was manually added to
event.h and not using rtems-central. This patch corrects that and renames
the event to make it clearer.
Some related dead code has also been removed.
(cherry picked from commit cabc8c3a78)
Co-authored-by: alessandronardin <ale.daluch@gmail.com>
Properly serialize explicit thread priority changes (for example
rtems_task_set_priority()) and thread priority changes carried out by
thread queues (locking protocols such as priority inheritance).
Update #5159.
In case of overflows, we may have an RTEMS_RECORD_UPTIME_HIGH event as
the first event. This uptime high event has no associated
RTEMS_RECORD_UPTIME_LOW event.
This code had a uint32_t local variable for seconds from a timespec.
This was assigning a time_t to a uint32_t and ultimately returning it.
This propgated to rtems_timespec_add_to().
Coverity CID 1512527
Closes#5107.
This removes the carriage return printed before the shell prompt as it
can cause other output to be overwritten unexpectedly. This was
discovered when using the "cat" shell command on a file whose content
contained no trailing \n\r and was short enough to be entirely swallowed
by the prompt.
The rtime decompression routine does not fully check bounds during the
entirety of the decompression pass and can corrupt memory outside the
decompression buffer if the compressed data is corrupted. This adds the
required check to prevent this failure mode.
Updates #5072
This reverts commit c1aa06dbd2.
Extending the rtems_stack_checker_info like this breaks the existing
visitor API used by rtems_stack_checker_iterate(). After review, using
an information structure contradicts the intention of the reporter to
allow a minimal reporting. Filling up the information structure with
all the details would pull in several dependencies, like
_Thread_Get_name(). The API should be improved to provide the user with
the necessary information from the TCB without having to access members
directly.