| Age | Commit message (Collapse) | Author |
|
|
|
|
|
command, so that the command cannot appear to be more options
(which always then fails, as there would be no arg for "-c" to
treat as the command string in that case).
For the full (LONG) explanation, see:
http://mail-index.netbsd.org/current-users/2021/10/29/msg041629.html
|
|
|
|
|
|
|
|
|
|
the 3 symbols that need to be common using an attribute. Put all the 3 symbol
definitions in libc in one place (initfini.c). Reviewed by joerg@
|
|
|
|
Might want to harmonize the printf(3) and wprintf(3) descriptions of
`%a'.
|
|
- lock all relevant mutexes just before fork
- unlock all mutexes just after fork in the parent
- full reinit non-spinlocks in the child
This is not using the normal pthread_atfork interface to ensure order of
operation, malloc is used as implementation detail too often.
|
|
|
|
__mc68000__ is defined both for m68000 and m68k.
|
|
arenas_map_key is used only when NO_TLS && _REENTRANT.
|
|
|
|
This code produces the same result and is consistent with the previous
lines. Only the least significant 16 bites (unsigned short) are meaningful.
|
|
Instead of implicid promotion to signed int,
explicitly cast the arguments to unsigned int.
_rand48.c:53:27, signed integer overflow:
58989 * 58970 cannot be represented in type 'int'
_rand48.c:53:38, signed integer overflow:
-2093025904 + -1496809120 cannot be represented in type 'int'
_rand48.c:53:57, signed integer overflow:
57068 * 42787 cannot be represented in type 'int'
New and old code produce the same code as tested with:
#include <stdio.h>
#include <stdlib.h>
#define COUNT 1000 * 1000
int
main(void)
{
FILE *fp;
int i;
fp = fopen("numbers.txt", "w+");
if (!fp)
abort();
for(i = 0; i < COUNT; i++) {
fprintf(fp, "%f\n", drand48());
fprintf(fp, "%ld\n", lrand48());
fprintf(fp, "%ld\n", mrand48());
}
fclose(fp);
return 0;
}
|
|
Noted by <leot>
|
|
|
|
Break long lines into shorter instructions per line.
No Functional Change.
|
|
_env.c:260:9, pointer expression with base 0 overflowed to 0
_env.c:260:9, load of null pointer of type 'char *'
|
|
|
|
There is no platform-specific reason for avoiding TLS. The tiny
allocations should be aligned the same as small allocations for ABI
reasons.
|
|
Since aligned_alloc does not demand that size is to be multiple of alignment
anymore, don't make that claim in the man page.
|
|
https://www.bell-labs.com/usr/dmr/www/man21.pdf
|
|
|
|
|
|
|
|
The original implementation in OpenBSD returns "invalid" and avoids reading
the input string. The replaced behavior was interpreting the input string
ignoring the invalid arguments.
|
|
|
|
|
|
|
|
|
|
alignment any more.
Thanks Joseph Myers for the heads up.
|
|
Change the type of shifted value to unsigned to prevent altering the
signedness bit.
jemalloc.c:1707:14, left shift of 1 by 31 places cannot be represented in type 'int'
jemalloc.c:1724:15, left shift of 1 by 31 places cannot be represented in type 'int'
jemalloc.c:1840:28, left shift of 1 by 31 places cannot be represented in type 'int'
Detected with micro-UBSan in the user mode.
|
|
There isn't any reason to cast NULL so just remove it. A similar change
was already made in DragonFly and FreeBSD (by me).
ok fly@
|
|
|
|
|
|
Sanitizers can handle recursive interceptions in some / most cases, if they
will cause damage the problem will be not workaroundable without libc
changes - I will be back to it.
Keep namespace of asctime() as this can be a cancellation point according
to POSIX. Right now it's not implemented on NetBSD. Defer it for later.
Keep weak symbols and namespace for wait6(2) as this could be a
cancellation point as well. Defer this for later.
Sanitizers's [recursive] interceptors are a hack and moving one way or
another can cause new sets of problems. Recursive ones can be useful and
cause problems (on Linux there are known with with signal handlers).
Sponsored by <The NetBSD Foundation>
|
|
|
|
The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.
Add atoi to namespace.h.
Register a new __weak_alias() entry for atoi() in atoi.c.
atoi() is used internally in getrpcent(), rresvport_af(), ftok(), err(),
__llvm_profile_write_file(), llvm_gcda_start_file(), citrus_iconv_open(),
getprotoent_r(), __rpc_uaddr2taddr_af(), __res_nopt_rdata() and
servent_parseline().
This revision switches the internal usage to the internal symbol.
Sponsored by <The NetBSD Foundation>
|
|
The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.
This change eliminates usage of the global changes of the following symbols:
- strlcat -> _strlcat
- sysconf -> __sysconf
- closedir -> _closedir
- fparseln -> _fparseln
- kill -> _kill
- mkstemp -> _mkstemp
- reallocarr -> _reallocarr
- strcasecmp -> _strcasecmp
- strncasecmp -> _strncasecmp
- strptime -> _strptime
- strtok_r -> _strtok_r
- sysctl -> _sysctl
- dlopen -> __dlopen
- dlclose -> __dlclose
- dlsym -> __dlsym
Sponsored by <The NetBSD Foundation>
|
|
specifies the number of digits after the decimal point (oh, sorry, the
"radix character") the other specifies the number before...
While here, add a little more info on the effects of using the #n value.
|
|
|
|
|
|
- Avoid out of bounds access for the currency_symbol[3] when the symbol
is shorter (as it happens with the C locale where it is empty)
- Don't compare pointers to NUL, it is not helpful.
- Make the default sep_by_space 1 as suggested in:
https://ftp.gnu.org/old-gnu/Manuals/glibc-2.2.3/html_node/libc_111.html
- Use the correct number of bytes for memmove(3)
XXX: pullup-8
|
|
floating point types. Adjust alignment to match.
|
|
__cxa_atexit directly from atexit, they have different behavior.
|
|
Rationale:
The DSO handle is a required part of the (external) __cxa_atexit interface.
The atexit mapping is an implementation detail and not part of the public
interface. Doing it directly creates UB as it involves casting function
pointers between incompatible types.
-- Joerg
|
|
In the NetBSD implementation and suggested by Itanium C++ ABI, we wrap
the atexit(x) call as __cxa_atexit(x,NULL,NULL).
__cxa_atexit() is an internal function for the usage of C++.
Correct a bug that __cxa_atexit(x,y,NULL) is handled in the same way as
atexit(x) (which is simplified to __cxa_atexit(x,NULL,NULL).
This misbehavior has been detected in the Thread Sanitizer port to NetBSD.
Patch reviewed by <christos>
Sponsored by <The NetBSD Foundation>
|