Our echo patch was ignoring the return of write. That meant that we
would never know if we echoed a bad value into a device file. For
example, if you echo garbage > /prof/mpstat, errno and errstr are set.
Bash's echo would silently ignore the failure. As of this commit, we
see the failure, but
Userspace can handle determining the length by the return value. Some
tools (e.g. GNU grep) don't like the \0 and think the contents are binary.
Signed-off-by: Barret Rhoden
---
kern/src/ns/util.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kern/src/ns/util.c
This will get built and installed with the other apps.
Signed-off-by: Barret Rhoden
---
Makefile | 4 ++
tools/sys-apps/grep/.gitignore| 1 +
tools/sys-apps/grep/Makefile | 57 +++
Glibc has a bunch of error reporting helpers, such as error(). These
take an int errnum, usually a failed errno, and a few other things to
print out, similar to perror(). Internally, these functions do a
strerror and print out a text description of the errno.
We'd also like to print out errstr.
This adds GNU's grep and fixes some of the problems with bash, notably
the whole "echo garbage > /some/kernel/device" not returning an error
(let alone an errstr).
I also added EPLAN9 (and used an EGREG string) to make the Go port
easier. I have some patches for Go that you'll need to pull too.
This ensures the patches are applied in order and it is easier to work
on various parts of the patch.
Signed-off-by: Barret Rhoden
---
.../4.3.30/0001-config-etc.patch | 37
.../akaros-patches/4.3.30/0002-echo.patch | 91 +
patch =>
These two follow the sized_kmalloc pattern for generating buffers. They
generate text, not raw data, and it should be readstr, not readmem.
Otherwise, we'll return extra bytes (zeros).
Note that our snprintf() (which creates the data in these cases) enforces
null-termination, so there's no
The old stuff wasn't working, at least not for echo, which calls bash's
internal error function (builtin_error). It looks like that
USE_AKAROS_STRERROR wasn't defined.
Now we just tack on errstr after printing the error message and
strerror. It's not perfect, since the IO stream isn't locked,
If the user overrides CC on the commandline, that was getting passed
through to the make apps-install commands. Even though we compute CC in
our top-level Makefile, we were not passing it along, and the one from the
shell's environment makes it through.
Additionally, we can't export CC directly,
Hopefully this will make the travis build failures easier to debug.
When/if we add testing, it won't help as much. Maybe we'll need to remove
the logs on success, or otherwise communicate that we shouldn't dump the
logs.
Signed-off-by: Barret Rhoden
---
.travis.yml | 9 -
1 file
Our chdir() takes a pid. A controlling process (e.g. a parent) can change
the directory of a child. This is meant to be done after proc_create and
before proc_run; the parent can set up the child before it starts running,
which avoids all sorts of nasty issues that happen in the fork() world.
Hello,
syzbot found the following crash on:
HEAD commit:0125d68f9264 Unset CC for apps-install makes
git tree: https://github.com/akaros/akaros.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=111ad23140
kernel config:
12 matches
Mail list logo