开发者

su -c gives "[1] Segmentation fault " in Android (Linux)

开发者 https://www.devze.com 2023-03-17 07:03 出处:网络
I am facing this strange problem in my android , When I try to run a executable by using : su -c \"/path/to/executable\"

I am facing this strange problem in my android ,

When I try to run a executable by using :

su -c "/path/to/executable"

I get this error:

[1]   Segmentation fault /path/to/executable

however, when i run same code after reaching the specific directory and then changing user to root and then running command :

./executable 

Everything works just fine.

Cant find any problem in the code.

This was working just fine a few days ago, I did change the executable.

Note that executable is made by compiling C-Code.

Any help on whats go开发者_运维知识库ing wrong?


Run

 strace su -c /path/to/executable

to identify the problem.


Perhaps the program depends on a file in current working directory? Have you tried:

su -c "cd /directory; sh programfile"
0

精彩评论

暂无评论...
验证码 换一张
取 消