errlogBufResize copied the print buffer from &pvt.print->base (the
address of the char* field inside the buffer_t struct) instead of
pvt.print->base (the buffer it points to), reading bufSize bytes from an
~8-byte struct field. Drop the stray & so it reads the actual buffer,
matching the adjacent log-buffer copy.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The ca_repeater function has some failure cases which can cause it to
return. In such a situation, a reference to the current thread's
epicsThreadId is kept in the taskwd, causing an eventual use-after-free
when the taskwd tries to determine the task's status.
We fix this problem by removing the thread from the taskwd if
ca_repeater ever returns.
* Add GDB helper script
Pretty printing of some common argument types
Need to add a line to ~/.gdbinit
> add-auto-load-safe-path /path/to/base/checkout/
afterwards verify at GDB shell with
> info auto-load python-scripts
> info pretty-printer
Tested with GDB 16.3 circa Debian 13
Add $rcast(dbCommon) to up-cast
Add $record("name") to lookup record
Add $elln(ELLLIST,#) to index into list
* configure: fail hard if RPATH ORIGIN requested, but makeRPath errors out
The $(shell ...) construct stores the numeric exit code in
$(.SHELLSTATUS). Map zero to empty string, so that
non-zero values select $(error ...).
../rec/biRecord.c:191:42: warning: argument to ‘sizeof’ in ‘strncpy’
call is the same expression as the source; did you mean to use the
size of the destination? [-Wsizeof-pointer-memaccess]
191 | strncpy(pstring,prec->znam,sizeof(prec->znam));
| ^
Use memcpy instead of snprintf.
STATIC_ASSERT is added to ensure znam and onam are sized enough.
Debugging a problem and looking at the message
recGblDbaddrError: dbPut: Request type is 0 Illegal Database Request Type...
does not help very much: request type 0 is a legal value.
Improve the message to show the field type as well:
recGblDbaddrError: dbPut: dbrType = 0 field_type = DBF_INLIK (14)...
Do the same for both dbPut and dbGet.
RTEMS performs a few early errlogPrintf calls. This initialises
the errlog buffers to some default values blocking certain tests
from re-initialising the error log later.