Commit Graph

318 Commits

Author SHA1 Message Date
kre
12f8bae508 If we're going to loop, pausing and then retrying malloc() after it
has failed, in the hope that some other thread has free'd some memory,
but we want to bound the number of attempts, it helps if we actually
count them - otherwise we never get nearer to the limit.

In practice, malloc() for a reasonable application on a modern system
almost never fails, so the code containing this bug has probably never
been, and never will be, executed, but just in case, someday.

For this, it isn't clear if the intent was to have 10 retries (ie: 11
attempts) or 10 tries, but as the code said "retries > 10", I am
assuming the former (not that it matters, if the malloc() has failed
10 times in a row, with 10 second pauses between, the chances of an
11th succeeding aren't great).
2020-03-24 14:56:31 +00:00
kamil
15f8c76f05 Revert previous
It will be addressed in a better way.

Requested by <kre>
2020-03-24 14:47:02 +00:00
kamil
43bf7c3563 Avoid buffer overflow
Detected with ASan + RUMPKERNEL.
2020-03-24 01:56:56 +00:00
kamil
05ac20bb1c Fix off-by-one
Before accessing array member, check whether it is not out of valid range.

Detected with ASan + RUMPKERNEL.
2020-03-24 01:13:41 +00:00
pgoyette
561f1f3c9a Teach rump to process __link_set_evcnts entries. (Second part of
fix for PR kern/55088)
2020-03-22 13:30:10 +00:00
pgoyette
5996efe558 Teach rump how to process __link_set_sysctl_funcs so it can handle
modules the same as a real kernel.

Partly addresses PR kern/55088 - __link_set_evcnts not yet handled
(that will happen later)
2020-03-21 04:48:37 +00:00
msaitoh
40064e2457 s/lenght/length/ 2019-12-26 04:53:11 +00:00
mrg
de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
ozaki-r
1153933228 Distinguish spin mutex and adaptive mutex on rump kernels for LOCKDEBUG
Formerly rump kernels treated the two types of mutexes as both adaptive for
LOCKDEBUG for some reasons.

Now we can detect violations of mutex restrictions on rump kernels such as
taking an adaptive mutex with holding a spin mutex as well as normal kernels.
2017-12-27 09:01:53 +00:00
martin
3397b20a60 Evil hack to fix the build: provide PRIxREGISTER here.
Sevan, please check and fix correctly ;-)
2017-05-11 10:21:55 +00:00
sevan
6b31f116cc With the removal of HAVE_REGISTER_T from rumpuser_port.h, _KERNTYPES does not
need to be defined. This allows register_t to be typedef'd to RUMP_REGISTER_T
without conflict, as highlighted in PR kern/52206.
2017-05-11 04:33:14 +00:00
sevan
64fda0b19a Update NetBSD values obtained from running configure as instructed in comment.
This paves the way to resolve rump build process using buildrump.sh, where the definition of
HAVE_REGISTER_T caused conflicting definitions of register_t.
2017-05-11 04:27:27 +00:00
sevan
979875ac74 Revert previous change so builds can resume.
_KERNTYPES needs to be defined for NetBSD builds to succeed.
_KERNTYPES must not be defined for buildrum.sh builds to succeed.
2017-05-10 08:48:46 +00:00
sevan
9204518573 Do not define _KERNTYPES as this breaks build with buildrump.sh due to
conflicting types for register_t.
Closes PR kern/52206
Steered in the right direction by christos.
2017-05-10 01:11:51 +00:00
sevan
cc576e1d8e Update supporting files for components which rely on autoconf to allow systems
introducing since release of software to be recognised. This should hopefully
allow the builds to progress a littles further on systems such as the POWER8
which features a little endian 64-bit PowerPC CPU identified as ppc64le.
2017-02-01 09:26:39 +00:00
christos
585a07d820 Don't go redefining system constants, without checking if the system provides
them.
2017-01-12 18:23:04 +00:00
maya
57f1116306 Revert previous. it shouldn't have an effect.
$$ should make it sufficiently unique.
2016-10-19 09:51:38 +00:00
maya
ae394a6300 use mktemp instead of $RANDOM for tmpdir
..$RANDOM won't work with our /bin/sh.

unsure if this script is used, but it is wrong.
might help the spurious build failures that occasionally
show up on autobuilds.
2016-10-17 18:24:42 +00:00
martin
832d276ed9 Redo previous by avoiding the casts and using PRIxREGISTER instead 2016-09-06 07:45:41 +00:00
martin
cccccd8360 Can not print register_t with %d, cast to long and use %ld instead. 2016-09-06 07:32:39 +00:00
dholland
7bd425cccf printf functions should be tagged as printf functions. Noticed by
martin, whose build broke for some reason yet to be determined.
2016-09-05 20:41:59 +00:00
pooka
9331c560dd Move librumpuser compile-time options into the librumpuser source
directory.  Those options apply only for the in-tree implementation.
2016-01-25 00:24:23 +00:00
christos
ffeb8dbf4e Define _KERNTYPES for things that need it. 2016-01-23 21:22:45 +00:00
nros
b16a5c9dec Add the C11 function aligned_alloc to libc. 2015-11-07 16:21:42 +00:00
pooka
bc0dc0b26e Add more compat defs for code compiled for !NetBSD targets.
At least GNU Hurd lacks MAXHOSTNAMELEN/MAXPATHLEN/PATH_MAX, so make sure
those have some arbitrary semi-sane values.

from Robert Millan in PR misc/50166, with some modifications from myself
2015-09-21 21:50:16 +00:00
pooka
6a501c9863 Fix typos to match values from rumpuser_config.h
from Hajime Tazaki via rumpkernel-users
2015-09-18 10:56:25 +00:00
pooka
9ee0427c6e Hurd support, part 1
from Robert Millan <rmh@gnu.org> via rumpkernel-users
2015-08-16 11:37:39 +00:00
pooka
2c3e118367 Fix return value inspection for clock_nanosleep() (not displayed in the
diff, need to look at the entire file for context).

from Robert Millan <rmh@freebsd.org> via rumpkernel-users
2015-08-16 11:05:06 +00:00
pooka
4169abe3e4 Print the "halted\n" from previous commit to stdout, not stderr.
The putchar hypercall writes to stdout, so this change restores
the original "functionality" (which was not intended to change).

from gson, via tests
2015-07-27 07:31:00 +00:00
pooka
5ede295be8 Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.
2015-07-24 14:11:11 +00:00
pooka
f24bc1c7bb check for utimensat 2015-03-05 00:25:39 +00:00
justin
a0e1fabf06 Minor fixes to types and includes 2015-02-15 00:54:32 +00:00
justin
36ca2dc69a Whitespace fixes, no functional change 2015-02-13 22:00:53 +00:00
justin
eb70afec87 Fix some return value checks 2015-02-13 21:31:18 +00:00
pooka
7ee5757301 If binding fails, print URL with which it failed. 2015-02-04 12:55:47 +00:00
justin
1eb711493e Remove no longer required definitions 2015-01-17 23:49:40 +00:00
pooka
bc3e3c852d check that sys/cdefs.h builds with -Werror (not the case on alpine linux
where it contains an unconditional #warning)
2015-01-03 13:16:41 +00:00
justin
e42c569056 Just abort on currently unsupported functions. 2014-12-29 21:50:09 +00:00
pooka
68efe5aa2a With glibc on ARM kthread_exit() aborts because pthread_exit() fails
to unwind the stack.  Add a temporary workaround where we simply don't
allow the thread to exit (a kernel thread exit is a relatively uncommon
event in a rump kernel anyway).
2014-12-16 17:00:17 +00:00
justin
af1fbf0457 Avoid uninitialised variable warning when gcc is feeling lazy 2014-12-08 00:12:03 +00:00
pooka
770e02d5a9 work around c11 visibility problems on some version(s) of FreeBSD 2014-11-10 22:43:46 +00:00
pooka
05761acba3 Just _GNU_SOURCE should be enough to expose everything necessary on Linux 2014-11-10 22:29:06 +00:00
pooka
77e862601f Move rump kernel man pages from various sources to sys/rump
namely:
  * src/lib is used only when building for POSIX'y platforms, but
    the man pages have their use for all platforms
  * rumpuser.3 is a function of the rump kernel, not one of the of
    the POSIX'y implementation hosted in src/lib/librumpuser

no functional change
2014-11-09 17:39:37 +00:00
justin
50e0f3e25a Remove superfluous getcontext() 2014-11-08 23:47:15 +00:00
justin
c78a9b9247 Move makecontext into function with getcontext for consistency 2014-11-08 23:20:23 +00:00
justin
1e44adf395 Fix some error handling cases. 2014-11-08 21:27:04 +00:00
justin
0f54d4e5e3 Add some prototypes for Android rump kernel builds
See buildrump.sh #70, some Android versins are missing prototypes for
these libc functions
2014-11-05 12:28:46 +00:00
pooka
e613b0fe74 check for clock_gettime from librt too 2014-11-05 01:40:30 +00:00
pooka
aeea18dfa5 assert that clock_gettime() does not fail 2014-11-05 01:39:40 +00:00
pooka
db9c98fa8e fix clock_gettime emulation 2014-11-05 01:37:27 +00:00