su -c gives "[1] Segmentation fault " in Android (Linux)
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"
精彩评论