Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault (core dumped) #1

Open
oxr463 opened this issue Jun 2, 2021 · 3 comments
Open

Segmentation fault (core dumped) #1

oxr463 opened this issue Jun 2, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@oxr463
Copy link
Owner

oxr463 commented Jun 2, 2021

file proot-loader 
proot-loader: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=91c1bd9bf74e7fcea318a564fadfbc5b4ea9cbd5, not stripped

example/hello_world/hello 
example/hello_world/hello: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=08bb6eaac0d2dda9e16452f0bed2e8cec2637e92, for GNU/Linux 3.2.0, not stripped

./example/hello_world/hello 
Hello World

./proot-loader 
Segmentation fault (core dumped)

./proot-loader example/hello_world/hello 
Segmentation fault (core dumped)
@oxr463 oxr463 added the bug Something isn't working label Jun 2, 2021
@oxr463
Copy link
Owner Author

oxr463 commented Jun 3, 2021

diff proot-rs/src/kernel/execve/loader/loader.c proot-loader/src/loader.c 
5c5
<  * Copyright (C) 2014 STMicroelectronics
---
>  * Copyright (C) 2015 STMicroelectronics
26a27,28
> #include "compat.h"
> #include "arch.h"
41a44,45
> #elif defined(ARCH_ARM64)
> #    include "assembly-arm64.h"
134a139
> #if defined(OPEN)
135a141,143
> #else
> 			fd = SYSCALL(OPENAT, 4, AT_FDCWD, stmt->open.string_address, O_RDONLY, 0);
> #endif
171a180,187
> 		case LOAD_ACTION_MAKE_STACK_EXEC:
> 			SYSCALL(MPROTECT, 3,
> 				stmt->make_stack_exec.start, 1,
> 				PROT_READ | PROT_WRITE | PROT_EXEC | PROT_GROWSDOWN);
> 
> 			cursor += LOAD_STATEMENT_SIZE(*stmt, make_stack_exec);
> 			break;
> 

@oxr463
Copy link
Owner Author

oxr463 commented Jun 3, 2021

@oxr463
Copy link
Owner Author

oxr463 commented Jun 3, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant