[akaros] [PATCH 06/10] bash: Handle errors in echo

2018-10-02 Thread Barret Rhoden
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

[akaros] [PATCH 01/10] Drop the \0 from readstr()

2018-10-02 Thread Barret Rhoden
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

[akaros] [PATCH 03/10] Add GNU grep to sys-apps

2018-10-02 Thread Barret Rhoden
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 +++

[akaros] [PATCH 04/10] Print errstr() in glibc's error() (XCC)

2018-10-02 Thread Barret Rhoden
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.

[akaros] [PATCH 00/10] apps-install fixes

2018-10-02 Thread Barret Rhoden
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.

[akaros] [PATCH 05/10] bash: Split up and order the akaros-patches

2018-10-02 Thread Barret Rhoden
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 =>

[akaros] [PATCH 02/10] Use readstr() for #device text buffers

2018-10-02 Thread Barret Rhoden
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

[akaros] [PATCH 07/10] bash: Fix errstr

2018-10-02 Thread Barret Rhoden
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,

[akaros] [PATCH 10/10] Unset CC for apps-install makes

2018-10-02 Thread Barret Rhoden
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,

[akaros] [PATCH 09/10] travis: Dump build logs on failure

2018-10-02 Thread Barret Rhoden
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

[akaros] [PATCH] Make SYS_chdir affect other processes

2018-10-02 Thread Barret Rhoden
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.

[akaros] assertion failed: buf == buf_end

2018-10-02 Thread syzbot
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: