chobits/tinyos — Issue #3: Userspace stack space seems to be rather fragile
Author: penberg
Created: 2012-01-03 22:50:37+00:00
State: open

I tried allocating 4K on userspace stack and noticed that the kernel crashes hard. You can see the issue if you update the new user/utils/pwd.c to look like this:

penberg@jaguar:~/src/tinyos$ git diff
diff --git a/user/utils/pwd.c b/user/utils/pwd.c
index 53aee22..3c46b49 100644
--- a/user/utils/pwd.c
+++ b/user/utils/pwd.c
@@ -1,10 +1,10 @@
#include

#define BUF_SIZE 4096
-static char buf[BUF_SIZE];

int main(int argc, char **argv)
{
+ char buf[BUF_SIZE];
char *cwd;

cwd = getcwd(buf, BUF_SIZE);