xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
10.14k stars 782 forks source link

arm64 (鲲鹏920) 下执行立即返回 wait events in poller failed! #5403

Closed walletiger closed 3 months ago

walletiger commented 3 months ago

Xmake 版本

v2.9.3

操作系统版本和架构

docker 环境, 文件系统为 ubuntu20.04

描述问题

xmake 成功安装 ,编译工程时出错 xmake -vD checking for platform ... linux checking for architecture ... arm64-v8a error: wait events in poller failed!

期待的结果

解决bug

工程配置

-- project set_project("libyuv")

-- set xmake minimum version set_xmakever("2.5.1")

-- set project version set_version("1.0.0", {build = "%Y%m%d%H%M"})

-- add build modes add_rules("mode.release", "mode.debug", "mode.profile", "mode.coverage")-- TODO, "mode.valgrind", "mode.asan", "mode.tsan", "mode.ubsan") -- for xmake v2.3.3

target("yuv") -- make as a static library set_kind("static")

-- set warning all as error
set_warnings("all", "error")

set_languages("c++11")
set_optimize("fastest")

-- disable some compiler errors
add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing", "-Wno-error=expansion-to-defined", "-Wno-unused-parameter", "-fPIC", "-DHAVE_JPEG")
add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing", "-Wno-error=expansion-to-defined", "-fPIC")

            -- add include directories
add_includedirs("./include", {public = true})

-- add the header files for installing
add_headerfiles("./include/*.h")

-- add the common source files
add_files("source/*.cc")

附加信息和错误日志

xmake -vD checking for platform ... linux checking for architecture ... arm64-v8a error: wait events in poller failed!

waruqi commented 3 months ago

这个你只能自己调下 core 层 poller wait 的实现了,看下为啥会失败。。通常是编译问题,先确认是否用上了 epoll,然后再看下为啥 epoll 失败。。

https://github.com/xmake-io/xmake/blob/a766d76d6b3f43c4fa2058f59c565c46a59b1118/core/src/xmake/io/poller_wait.c#L96 https://github.com/tboox/tbox/blob/master/src/tbox/platform/poller.c https://github.com/tboox/tbox/blob/8ada0ab7f7eb98fa5eb4928b61b7701b0126a721/src/tbox/platform/linux/poller_epoll.c#L240

Issues-translate-bot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically.


You can only adjust the core layer poller wait implementation yourself to see why it fails. . It is usually a compilation problem. First confirm whether epoll is used, and then look at why epoll fails. .

https://github.com/xmake-io/xmake/blob/a766d76d6b3f43c4fa2058f59c565c46a59b1118/core/src/xmake/io/poller_wait.c#L96 https://github.com/tboox/tbox/blob/master/src/tbox/platform/poller.c https://github.com/tboox/tbox/blob/8ada0ab7f7eb98fa5eb4928b61b7701b0126a721/src/tbox/platform/linux/poller_epoll.c#L240

walletiger commented 3 months ago

是系统 ulimit 的打开文件数特别大造成的,改成 65535 没问题了 core file size (blocks, -c) unlimited data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 59388 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1073741816 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) unlimited virtual memory (kbytes, -v) unlimited file locks (-x) unlimited

Issues-translate-bot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically.


It is caused by the extremely large number of open files in the system ulimit. Changing it to 65535 will solve the problem. core file size (blocks, -c) unlimited data segment size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 59388 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1073741816 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) unlimited virtual memory (kbytes, -v) unlimited file locks (-x) unlimited