<feed xmlns='http://www.w3.org/2005/Atom'>
<title>musl/src/time, branch v1.2.5</title>
<subtitle>musl - an implementation of the standard library for Linux-based systems</subtitle>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/'/>
<entry>
<title>strftime: fix breakage in last change (uninitialized pointer access)</title>
<updated>2024-02-16T14:33:03+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2024-02-12T22:35:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=4a16ddf53e7c634169d0a649782f8a724611f263'/>
<id>4a16ddf53e7c634169d0a649782f8a724611f263</id>
<content type='text'>
commit f47a5d400b8ffa26cfc5b345dbff52fec94ac7f3 overlooked that
strtoul was responsible for setting p to a const-laundered copy of the
format string pointer f, even in the case where there was no number to
parse. by making the call conditional on isdigit, that copy was lost.

the logic here is a mess and should be cleaned up, but for now, this
seems to be the least invasive change that undoes the breakage.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit f47a5d400b8ffa26cfc5b345dbff52fec94ac7f3 overlooked that
strtoul was responsible for setting p to a const-laundered copy of the
format string pointer f, even in the case where there was no number to
parse. by making the call conditional on isdigit, that copy was lost.

the logic here is a mess and should be cleaned up, but for now, this
seems to be the least invasive change that undoes the breakage.
</pre>
</div>
</content>
</entry>
<entry>
<title>strftime: don't attempt to parse field width without seeing a digit</title>
<updated>2023-11-21T21:33:15+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2023-11-21T21:33:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=f47a5d400b8ffa26cfc5b345dbff52fec94ac7f3'/>
<id>f47a5d400b8ffa26cfc5b345dbff52fec94ac7f3</id>
<content type='text'>
strtoul will consume leading whitespace or sign characters, which are
not valid in this context, thereby accepting invalid field specifiers.
so, avoid calling it unless there is a number to parse as the width.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
strtoul will consume leading whitespace or sign characters, which are
not valid in this context, thereby accepting invalid field specifiers.
so, avoid calling it unless there is a number to parse as the width.
</pre>
</div>
</content>
</entry>
<entry>
<title>__year_to_secs: fix dangling pointer</title>
<updated>2023-11-06T18:29:07+00:00</updated>
<author>
<name>Alex Xu (Hello71)</name>
<email>alex_y_xu@yahoo.ca</email>
</author>
<published>2023-11-01T23:37:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=2d84486a08c57d00b647586b7cbe2dcec2728e81'/>
<id>2d84486a08c57d00b647586b7cbe2dcec2728e81</id>
<content type='text'>
The lifetime of the compound literal ends after the "if" statement's
implicit block. gcc also warns about this.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The lifetime of the compound literal ends after the "if" statement's
implicit block. gcc also warns about this.
</pre>
</div>
</content>
</entry>
<entry>
<title>timer_create: volatile static -&gt; static volatile</title>
<updated>2023-11-06T18:28:28+00:00</updated>
<author>
<name>Alex Xu (Hello71)</name>
<email>alex_y_xu@yahoo.ca</email>
</author>
<published>2023-11-01T23:37:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=c5459df18879dad8f5388480d588edbcbd1b7eb2'/>
<id>c5459df18879dad8f5388480d588edbcbd1b7eb2</id>
<content type='text'>
C11 6.11.5p1:

&gt; The placement of a storage-class specifier other than at the
&gt; beginning of the declaration specifiers in a declaration is an
&gt; obsolescent feature.

gcc also warns about this.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
C11 6.11.5p1:

&gt; The placement of a storage-class specifier other than at the
&gt; beginning of the declaration specifiers in a declaration is an
&gt; obsolescent feature.

gcc also warns about this.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix thread leak on timer_create(SIGEV_THREAD) failure</title>
<updated>2022-09-19T17:24:05+00:00</updated>
<author>
<name>Alexey Izbyshev</name>
<email>izbyshev@ispras.ru</email>
</author>
<published>2022-09-08T09:18:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=3ad3fa962efee12067d68c3405a537dce156a7ac'/>
<id>3ad3fa962efee12067d68c3405a537dce156a7ac</id>
<content type='text'>
After commit 5b74eed3b301e2227385f3bf26d3bb7c2d822cf8 the timer thread
doesn't check whether timer_create() actually created the timer,
proceeding to wait for a signal that might never arrive.  We can't fix
this by simply checking for a negative timer_id after
pthread_barrier_wait() because we have no way to distinguish a timer
creation failure and a request to delete a timer with INT_MAX id if it
happens to arrive quickly (a variation of this bug existed before
5b74eed3b301e2227385f3bf26d3bb7c2d822cf8, where the timer would be
leaked in this case).  So (ab)use cancel field of pthread_t instead.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After commit 5b74eed3b301e2227385f3bf26d3bb7c2d822cf8 the timer thread
doesn't check whether timer_create() actually created the timer,
proceeding to wait for a signal that might never arrive.  We can't fix
this by simply checking for a negative timer_id after
pthread_barrier_wait() because we have no way to distinguish a timer
creation failure and a request to delete a timer with INT_MAX id if it
happens to arrive quickly (a variation of this bug existed before
5b74eed3b301e2227385f3bf26d3bb7c2d822cf8, where the timer would be
leaked in this case).  So (ab)use cancel field of pthread_t instead.
</pre>
</div>
</content>
</entry>
<entry>
<title>re-enable vdso clock_gettime on arm (32-bit) with workaround</title>
<updated>2022-09-19T17:21:54+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2022-09-12T12:38:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=bf14ef193b4203aa9a8b173faeeea06d98397f65'/>
<id>bf14ef193b4203aa9a8b173faeeea06d98397f65</id>
<content type='text'>
commit 4486c579cbf0d989080705f515d08cb48636ba88 disabled vdso
clock_gettime on arm due to a Linux kernel bug that was not understood
at the time, whereby the vdso function silently produced
catastrophically wrong results on some systems.

since then, the bug was tracked down to the way the arm kernel
disabled use of vdso clock_gettime on kernels where the necessary
timer was not available or was disabled. it simply patched out the
symbols, but it only did this for the legacy time32 functions, and
left the time64 function in place but non-operational. kernel commit
4405bdf3c57ec28d606bdf5325f1167505bfdcd4 (first present in 5.8)
provided the fix.

if this were a bug that impacted all users of the broken kernel
versions, we could probably ignore it and assume it had been patched
or replaced. however, it's very possible that these kernels appear in
the wild in devices running time32 userspace (glibc, musl 1.1.x, or
some other environment) where they appear to work fine, but where our
new binaries would fail catastrophically if we used the time64 vdso
function.

since the kernel has not (yet?) given us a way to probe for the
working time64 vdso function semantically, we work around the problem
by refusing to use the time64 one unless the time32 one is also
present. this will revert to not using vdso at all if the time32 one
is ever removed, but at least that's safe against wrong results and is
just a missed optimization.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 4486c579cbf0d989080705f515d08cb48636ba88 disabled vdso
clock_gettime on arm due to a Linux kernel bug that was not understood
at the time, whereby the vdso function silently produced
catastrophically wrong results on some systems.

since then, the bug was tracked down to the way the arm kernel
disabled use of vdso clock_gettime on kernels where the necessary
timer was not available or was disabled. it simply patched out the
symbols, but it only did this for the legacy time32 functions, and
left the time64 function in place but non-operational. kernel commit
4405bdf3c57ec28d606bdf5325f1167505bfdcd4 (first present in 5.8)
provided the fix.

if this were a bug that impacted all users of the broken kernel
versions, we could probably ignore it and assume it had been patched
or replaced. however, it's very possible that these kernels appear in
the wild in devices running time32 userspace (glibc, musl 1.1.x, or
some other environment) where they appear to work fine, but where our
new binaries would fail catastrophically if we used the time64 vdso
function.

since the kernel has not (yet?) given us a way to probe for the
working time64 vdso function semantically, we work around the problem
by refusing to use the time64 one unless the time32 one is also
present. this will revert to not using vdso at all if the time32 one
is ever removed, but at least that's safe against wrong results and is
just a missed optimization.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix ESRCH error handling for clock_getcpuclockid</title>
<updated>2022-08-01T17:53:22+00:00</updated>
<author>
<name>Eugene Yudin</name>
<email>e.yudin@ndmsystems.com</email>
</author>
<published>2022-08-01T17:53:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=baaf257f05b96816c24951e7b6721d72922949e5'/>
<id>baaf257f05b96816c24951e7b6721d72922949e5</id>
<content type='text'>
the syscall used to probe availability of the clock fails with EINVAL
when the requested pid does not exist, but clock_getcpuclockid is
specified to use ESRCH for this purpose.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the syscall used to probe availability of the clock fails with EINVAL
when the requested pid does not exist, but clock_getcpuclockid is
specified to use ESRCH for this purpose.
</pre>
</div>
</content>
</entry>
<entry>
<title>use __fstat instead of __fstatat with AT_EMPTY_PATH in __map_file</title>
<updated>2022-05-04T14:53:01+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2022-05-04T14:53:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=6e9d2370c7559af80b32a91f20898f41597e093b'/>
<id>6e9d2370c7559af80b32a91f20898f41597e093b</id>
<content type='text'>
this isolates knowledge of the nonstandard AT_EMPTY_PATH extension to
one place and returns __map_file to its prior simplicity.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this isolates knowledge of the nonstandard AT_EMPTY_PATH extension to
one place and returns __map_file to its prior simplicity.
</pre>
</div>
</content>
</entry>
<entry>
<title>drop direct use of stat syscalls in internal __map_file</title>
<updated>2022-05-02T03:25:21+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2022-04-28T06:18:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=2b754a542492f5878608a1130e00021ae02a0e34'/>
<id>2b754a542492f5878608a1130e00021ae02a0e34</id>
<content type='text'>
this function is used to implement some baseline ISO C interfaces, so
it cannot call any of the stat functions by their public names. use
the namespace-safe __fstatat instead.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this function is used to implement some baseline ISO C interfaces, so
it cannot call any of the stat functions by their public names. use
the namespace-safe __fstatat instead.
</pre>
</div>
</content>
</entry>
<entry>
<title>only fallback to gettimeofday/settimeofday syscalls if they exist</title>
<updated>2022-05-02T03:25:21+00:00</updated>
<author>
<name>Stefan O'Rear</name>
<email>sorear@fastmail.com</email>
</author>
<published>2020-09-03T07:33:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=12a757b3219408c5f96fd5b9daa5c551944337ee'/>
<id>12a757b3219408c5f96fd5b9daa5c551944337ee</id>
<content type='text'>
riscv32 and future architectures only provide the clock_ functions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
riscv32 and future architectures only provide the clock_ functions.
</pre>
</div>
</content>
</entry>
</feed>
