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.
This commit is contained in:
Josef Söntgen 2019-02-07 15:46:58 +01:00 committed by Norman Feske
parent afc95e36e1
commit 3ada4f4733
3 changed files with 5 additions and 5 deletions

View File

@ -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 };

View File

@ -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];
{

View File

@ -146,7 +146,7 @@ class Noux::Child : public Rpc_object<Session>,
* 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<Session>,
/**
* Command line arguments
*/
enum { ARGS_DS_SIZE = sizeof(Sysio::Args) };
Args_dataspace _args;
/**
@ -242,8 +244,6 @@ class Noux::Child : public Rpc_object<Session>,
throw Invalid_fd();
}
enum { ARGS_DS_SIZE = 4096 };
/**
* Let specified child inherit our file descriptors
*/