-
-
Notifications
You must be signed in to change notification settings - Fork 475
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
increase file limit when hit the ulimit #1363
base: main
Are you sure you want to change the base?
Conversation
Well I don't think any program should automagically increase the ulimit. Can you file a bug to LLVM instead? If GCC can handle the same thing without hitting the ulimit, LLVM should be able to do the same thing without hitting it, too. |
Stracing
LLD seems to follow the pattern of [open] -> [mmap] -> [close] without keeping too mant fds.
I could imagine the issue can't be easily fixed on llvm side, as changing the ownership of |
I just tried LTO with Clang, and it seems it works just fine without closing the FDs. Can you try again with the following change?
|
I tried the same and the link succeed, however the code for LLVMGOLD suggested that it is using the fd information to track the orgin of file if multiple "handle" is from the same file. I believe it will cause the backend treat all object file as they have same source. Sorry but I know nearly nothing about how thinLTO works, so I don't know if this will case any potenial issue. |
Do you mind if I ask you to try to fix the issue on the LLVM plugin side rather than on the linker side? If you don't have enough bandwidth, I can take a look later. But it seems you have already started reading the source code of the plugin. |
I've no idea how should I test a change in llvm, so I'd appreciate it if you can take time fix the issue in LLVM side. But from my understanding of the code in llvmgold I could tell the leading handle thing only wants uniqueness and this could be done by using file path instead of FD. (since if we close the file the fd will no longer be unique) With the change the FD could be closed after https://github.com/llvm/llvm-project/blob/6e0b0038cd65ce726ce404305a06e1cf33e36cca/llvm/tools/gold/gold-plugin.cpp#L546 |
Fixes #1362 #851
It seems that with llvm lto we don't have much way to fix the issue than increasing the ulimit. (I strace'd bfd and it is calling setprlimit when it gets any
EMFILE
)