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

[Bug]: 一种部分手机上的内置客户端 sched_setaffinity 权限问题,以及一种可能的方案 #36

Open
2 of 4 tasks
fy0 opened this issue Apr 5, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@fy0
Copy link
Member

fy0 commented Apr 5, 2024

在提问之前...

  • 我理解 Issue 是用于反馈和解决问题的,而非吐槽评论区,将尽可能提供更多信息帮助问题解决
  • 我填写了简短且清晰明确的标题,以便开发者在翻阅 issue 列表时能快速确定大致问题。而不是“一个建议”、“卡住了”等
  • 我已查看master branch或最新测试版的更新内容,并未提及该 bug 已被修复的情况
  • 已有issue中并没有看见其他人与我反馈相同的问题

问题描述

报错:

7972  <... rt_sigprocmask resumed>NULL, 8) = 0
7974  <... sched_getaffinity resumed>[0 1 2 3 4 5 6 7]) = 8
7972  futex(0x7fe95c02d4, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
7974  sched_setaffinity(0, 128, [0 1 2 3 4 5 6 7]) = -1 EPERM (Operation not permitted)
7974  futex(0x7fe95c02d4, FUTEX_WAKE_PRIVATE, 1) = 1
7972  <... futex resumed>)              = 0
7974  rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2],  <unfinished ...>
7972  rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2],  <unfinished ...>
7974  <... rt_sigprocmask resumed>[RTMIN], 8) = 0
7972  <... rt_sigprocmask resumed>[RTMIN], 8) = 0
7974  rt_sigprocmask(SIG_BLOCK, ~[],  <unfinished ...>
7972  futex(0x3f000c2e58, FUTEX_WAIT, 7974, NULL <unfinished ...>
7974  <... rt_sigprocmask resumed>~[KILL STOP RT_1 RT_2], 8) = 0
7974  munmap(0x7054a88000, 1585152)     = 0
7974  exit(0)                           = ?
7974  +++ exited with 0 +++
7972  <... futex resumed>)              = 0
7972  rt_sigprocmask(SIG_SETMASK, [RTMIN], NULL, 8) = 0
7972  writev(2, [{iov_base="", iov_len=0}, {iov_base="Failed to create CoreCLR, HRESULT: 0x8007054F", iov_len=45}], 2) = 45
7972  writev(2, [{iov_base="", iov_len=0}, {iov_base="\n", iov_len=1}], 2) = 1

sched_setaffinity 函数用于设置程序使用的cpu核心,但是只有在root下可用。
但是容器的root权限关闭了之后,仍然出这个问题。

一种方案:
使用 LD_PRELOAD 功能,重写 sched_setaffinity 为空函数

参考:
https://github.com/termux/termux-exec

如何复现

添加内置客户端即可复现

你期望发生的

正常运行

实际上发生的

Failed to create CoreCLR, HRESULT: 0x8007054F

日志文件

截图

No response

App版本

0.6.0

海豹核心版本

1.4.5

设备信息

红米12t hyperOS

帐号类型

QQ

使用协议

No response

附加内容

No response

@fy0 fy0 added the bug Something isn't working label Apr 5, 2024
@Szzrain
Copy link
Contributor

Szzrain commented Apr 6, 2024

看不懂(

@kenichiLyon
Copy link

follow up,目前仍然存在相关情况。(issue提到的设备为本人设备)

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

3 participants