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

bugpoint should fork processes with sane limits #1060

Closed
llvmbot opened this issue Jan 12, 2006 · 11 comments
Closed

bugpoint should fork processes with sane limits #1060

llvmbot opened this issue Jan 12, 2006 · 11 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla enhancement Improving things as opposed to bug fixing, e.g. new or missing feature tools:bugpoint

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 12, 2006

Bugzilla Link 688
Resolution FIXED
Resolved on Sep 26, 2007 01:35
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @lattner

Extended Description

When bugpoint runs something (gcc, or a probably-broken bit of code), it should
have some limits on disk and memory usage set, to add a bit of determinism and
be more polite. I just went through a bugpoint run where the code in question
was failing by exhausting swap - worked fine, just took 20x longer than it
should have.

This issue will probably become more serious if and when bugpoint gets
multithreaded.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jan 12, 2006

assigned to @asl

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jan 12, 2006

I would argue that such things are outside the scope of LLVM. If you want to
limit bugpoint's cpu/memory/disk, you should be able to do that prior to
invoking bugpoint from the environment of the operating system. I don't think we
should implement this unless there is a strong counter-argument.

@lattner
Copy link
Collaborator

lattner commented Jan 12, 2006

I don't really agree. Bugpoint can run for a long time and potentially consume a lot of time and memory.
The executed programs, however, should have well known time/space requirements that we want to
contain should they spin out of control.

-Chris

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jan 12, 2006

okay, care to define those limits? isn't the limit somewhat dependent on the input?

and, what about gccld, llvm-ld, or other programs which might execute for a whlie?

if we have to support this feature, then we have to do it on all platforms .. is
it worth the effort?

@lattner
Copy link
Collaborator

lattner commented Jan 12, 2006

I think that having bugpoint default to large but reasonable limits (e.g. 100M of memory and 1 minute of
run time), but allowing command line options to change the default is best.

Hosts that don't support the "setlimit" family of functions can just ignore the request.

-Chris

@asl
Copy link
Collaborator

asl commented Feb 16, 2007

Seems to be easy to add. Are there "setrlimit" call on Darwin?

@lattner
Copy link
Collaborator

lattner commented Feb 16, 2007

Yep, darwin has setrlimit,

-Chris

@lattner
Copy link
Collaborator

lattner commented Feb 16, 2007

One thing that I recently noticed is that the --timeout=N value only applies to the program when it is
being run. It does not apply to tool executions like llc or bugpoint when it forks itself to run
optimizations.

-Chris

@asl
Copy link
Collaborator

asl commented Feb 16, 2007

@lattner
Copy link
Collaborator

lattner commented Feb 16, 2007

Very nice!

Can you also investigate making sub-invocations of llc respect -timeout? If llc goes into an infinite loop,
bugpoint can't help. An easy way to test this is to add "while (1);" to llc's main, then do bugpoint-llc on
something. bugpoint should reduce it down to a single empty function.

-Chris

@lattner
Copy link
Collaborator

lattner commented Sep 26, 2007

anton implemented this.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
@Endilll Endilll added enhancement Improving things as opposed to bug fixing, e.g. new or missing feature and removed new-feature labels Aug 15, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla enhancement Improving things as opposed to bug fixing, e.g. new or missing feature tools:bugpoint
Projects
None yet
Development

No branches or pull requests

4 participants