topjohnwu / Magisk

The Magic Mask for Android
GNU General Public License v3.0
45.48k stars 11.38k forks source link

Terminal apps don't get su permission, message "recv_fd: msg_flags =m 0, msg_controllen(0) != 24" #8072

Closed MisterFloppy closed 1 month ago

MisterFloppy commented 1 month ago

I tried getting superuser permission by running the "su" command in several terminal apps (Termux, Termius, Nethunter Terminal) after having granted su access to them in the magisk manager, all to no avail: a message is always popping up saying "recv_fd: msg_flags =m 0, msg_controllen(0) != 24". Last try was at 18:36:00.. If I remember correctly, until v26 of Magisk it worked fine.

Device: Pocophone F1 Android version: 9 Magisk version name: 81658d45(27002) Magisk version code: 27002

Magisk log: magisk.log

Yop-Solo commented 1 month ago

I get the same line in the terminal.

$ su -c ls -l /mnt/media_rw
recv_fd: msg_flags = 0, msg_controllen(0) != 24

Device: Pocophone F1 Android 12 (Lineage OS 19) Magisk 27000 Termux 0.101

magisk_log_2024-05-25T14.34.29.log

yujincheng08 commented 1 month ago

this is because someone has umounted magisk's devpts. not our issue.

~ $ su -mm -c umount -l /debug_ramdisk/.magisk/pts/
~ $ su
recv_fd: msg_flags = 0, msg_controllen(0) != 24
~ $
MisterFloppy commented 1 month ago

Thank you for your response. However,I have no clue at all how to solve the issue, and am feeling a little bit like being left standing in the rain :-(

Regarding that you have closed and labeled the issue as "not our issue" meaning that "it is caused by third-party like customized ROM or module", please take note that

So my assumption is that the problem has been introduced with the upgrade process to the newer version of Magisk.

Fortunately, as a word-around for the problem that I can't run "su" commands at the moment in native terminal apps, I have discovered an app which is an interpreter for the good old programming language "BASIC" and has an example inluded that allows running "su" commands from there! Source: https://rfobasic.miraheze.org/wiki/Main_Page#

Could you list the "su" commands one by one required to "revert" the unmount of magisk's devpts, please?

vvb2060 commented 1 month ago

https://github.com/topjohnwu/Magisk/blob/c6f076251033c46a66b8f06a517cd58d94ad2fb7/native/src/core/daemon.cpp#L394-L407

MisterFloppy commented 1 month ago

Here's a log after I have disabled all the Magisk modules on my device (with the error still occuring).

Device: Pocophone F1 Android version: 9 Magisk version name: https://github.com/topjohnwu/Magisk/commit/81658d45f7236fdbd535a6c3a06ae19bc08cb842(27002) Magisk version code: 27002

Magisk log: magisk.log