Skip to content

Userspace stack space seems to be rather fragile #3

@penberg

Description

@penberg

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 <ulib.h>

#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);
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions