size_t issue in expand_string_dollar_quote

2023-03-29 Thread Grisha Levit
bash --norc -in <<<$'"\e\cE' ERROR: AddressSanitizer: negative-size-param: (size=-1) #0 wrap_strncpy+0x228 #1 expand_string_dollar_quote subst.c:4108 #2 shell_expand_line bashline.c:2887 probably not the cleanest fix but the issue is here: diff --git a/subst.c b/subst.c index 2ff9b7c

Re: [PATCH 3/4] Port unwind protection to C23

2023-03-29 Thread Chet Ramey
On 3/26/23 7:50 PM, Paul Eggert wrote: Use the generic function type void (*) (void *) for all unwind cleanups. When an existing cleanup doesn't already have that type, change the type if the function is used only as a cleanup, and add a shim function otherwise. If the shim is used in more tha

Re: $SECONDS and timeout values use realtime `gettimeofday()`

2023-03-29 Thread Mike Jonkmans
On Wed, Mar 29, 2023 at 10:49:00AM -0400, Chet Ramey wrote: > On 3/24/23 6:19 PM, William Kennington wrote: > > Not worried, it is legitimately a problem for us to the point we are > > currently patching bash to use the monotonic clock for seconds. It times > > out stuff in our boot process which e

Re: $SECONDS and timeout values use realtime `gettimeofday()`

2023-03-29 Thread Andreas Schwab
On Mär 23 2023, William Kennington via Bug reports for the GNU Bourne Again SHell wrote: > We have systems that start off with inaccurate clocks and at some point > after the boot process synchronize with the network and jump forward in > time. This has the potential to break any scripts that are

Re: $SECONDS and timeout values use realtime `gettimeofday()`

2023-03-29 Thread Chet Ramey
On 3/24/23 6:19 PM, William Kennington wrote: Not worried, it is legitimately a problem for us to the point we are currently patching bash to use the monotonic clock for seconds. It times out stuff in our boot process which executes normally after the time sync has completed and jumped the cloc