mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-08 18:26:48 +00:00
* fix: Fix stack related errors Increase kernel stack to 32k. Add a stack overflow test. Remove manual placement of guard pages Signed-off-by: Godones <chenlinfeng25@outlook.com> * fix: update userstack comments Signed-off-by: Godones <chenlinfeng25@outlook.com> --------- Signed-off-by: Godones <chenlinfeng25@outlook.com>
14 lines
294 B
C
14 lines
294 B
C
#include <stdio.h>
|
|
|
|
void overflow(int depth) {
|
|
char buffer[1024 * 1024]; // 占用一些栈空间
|
|
printf("Recursion depth: %d\n", depth);
|
|
overflow(depth + 1); // 递归调用
|
|
}
|
|
|
|
int main() {
|
|
overflow(1);
|
|
printf("This line will not be printed due to stack overflow.\n");
|
|
return 0;
|
|
}
|