From 3ada4f4733a974049f94d667ffced250db83e684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Thu, 7 Feb 2019 15:46:58 +0100 Subject: [PATCH] noux: increase argv buffer to 16KiB And most importantly: use the same size everywhere. Note, this commit also configures the stack size of noux-process threads to 64 KiB independently of the CPU architecture. The reason is the increased stack usage because of the additional argument space in Execve_child_env in syscall(SYSCALL_EXECVE), which crafts a child environment on stack for the creation of the new child. Fixes #3145. --- repos/ports/include/noux_session/sysio.h | 2 +- repos/ports/src/lib/libc_noux/plugin.cc | 2 +- repos/ports/src/noux/child.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/repos/ports/include/noux_session/sysio.h b/repos/ports/include/noux_session/sysio.h index 82b96bf6a..a8bd724e0 100644 --- a/repos/ports/include/noux_session/sysio.h +++ b/repos/ports/include/noux_session/sysio.h @@ -54,7 +54,7 @@ struct Noux::Sysio enum { CHUNK_SIZE = 64*1024 }; typedef char Chunk[CHUNK_SIZE]; - enum { ARGS_MAX_LEN = 5*1024 }; + enum { ARGS_MAX_LEN = 16*1024 }; typedef char Args[ARGS_MAX_LEN]; enum { ENV_MAX_LEN = 6*1024 }; diff --git a/repos/ports/src/lib/libc_noux/plugin.cc b/repos/ports/src/lib/libc_noux/plugin.cc index 55b220f46..a1385f143 100644 --- a/repos/ports/src/lib/libc_noux/plugin.cc +++ b/repos/ports/src/lib/libc_noux/plugin.cc @@ -2278,7 +2278,7 @@ void Plugin::init(Genode::Env &env) sigemptyset(&signal_mask); /* copy command-line arguments from 'args' ROM dataspace */ - enum { MAX_ARGS = 256, ARG_BUF_SIZE = 4096UL }; + enum { MAX_ARGS = 256, ARG_BUF_SIZE = sizeof(Noux::Sysio::Args) }; static char *argv[MAX_ARGS]; static char arg_buf[ARG_BUF_SIZE]; { diff --git a/repos/ports/src/noux/child.h b/repos/ports/src/noux/child.h index f24db9d67..732f3b6b2 100644 --- a/repos/ports/src/noux/child.h +++ b/repos/ports/src/noux/child.h @@ -146,7 +146,7 @@ class Noux::Child : public Rpc_object, * Entrypoint used to serve the RPC interfaces of the * locally-provided services */ - enum { STACK_SIZE = 8*1024*sizeof(long) }; + enum { STACK_SIZE = 64*1024 }; Rpc_entrypoint _ep { &_env.pd(), STACK_SIZE, "noux_process", false }; Pd_session &_ref_pd; @@ -194,6 +194,8 @@ class Noux::Child : public Rpc_object, /** * Command line arguments */ + enum { ARGS_DS_SIZE = sizeof(Sysio::Args) }; + Args_dataspace _args; /** @@ -242,8 +244,6 @@ class Noux::Child : public Rpc_object, throw Invalid_fd(); } - enum { ARGS_DS_SIZE = 4096 }; - /** * Let specified child inherit our file descriptors */