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

Change the behaviour of core::run::Program.destroy to forcibly terminate the program #5761

Closed
wants to merge 4 commits into from

Conversation

Dretch
Copy link
Contributor

@Dretch Dretch commented Apr 6, 2013

As proposed in issue #5632.

I added some new stuff to libc - hopefully correctly. I only added a single signal constant (SIGKILL) because adding more seems complicated by differences between platforms - and since it is not required for issue #5632 then I figure that I can use a further pull request to flesh out the SIG* constants more.

gareth added 3 commits April 6, 2013 20:57
start_program(...) would cause a segfault when p went
out of scope due to out_file/err_file being closed twice.
forcibly terminate the program (as suggested in issue rust-lang#5632)
@thestinger
Copy link
Contributor

Perhaps this should use SIGTERM, with a more dangerous naming for SIGKILL (force_destroy?). I don't think SIGKILL is usually what you want.

@Dretch
Copy link
Contributor Author

Dretch commented Apr 7, 2013

@thestinger

That sounds reasonable. There is the question of how the SIGTERM equivalent should work on Windows, though - it looks like a can of worms to implement such a thing, and it only works for GUI apps (http://stackoverflow.com/questions/2055753/how-to-gracefully-terminate-a-process).

I suppose the Windows equivalent of the SIGTERM sender could either do nothing or alternatively just call TerminateProcess like the the SIGKILL equivalent does. It might be safer if it did nothing because on Unix SIGTERM may well be ignored by the target process.

force_destroy() that sends SIGKILL - as suggested by 
@thestinger.
@Dretch
Copy link
Contributor Author

Dretch commented Apr 11, 2013

@thestinger I have added a new commit with the changes you suggested.

Both destroy() and force_destroy() have identical behaviour on win32 (they both call TerminateProcess()) because on balance I think that behaviour is more predictable than destroy() simply not doing anything on win32.

bors added a commit that referenced this pull request Apr 13, 2013
As proposed in issue #5632.

I added some new stuff to libc - hopefully correctly. I only added a single signal constant (SIGKILL) because adding more seems complicated by differences between platforms - and since it is not required for issue #5632 then I figure that I can use a further pull request to flesh out the SIG* constants more.
@bors bors closed this Apr 13, 2013
bors added a commit that referenced this pull request Apr 14, 2013
This is a follow-up to #5761. Its purpose is to make core::libc more consistent - it currently only defines SIGKILL and SIGTERM, because they are the only values that happen to be needed by libcore.

This adds all the posix signal value constants, except for those that have different values on different architectures.

The output of the command `man 7 signal` was used to compile these signal values.
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 14, 2020
…1995

Improvements for `type_repetition_in_bounds` lint

Some improvements for `type_repetition_in_bounds`:
- add a configurable threshold to trigger the lint (rust-lang#4380). The lint won't trigger anymore if there are more bounds (strictly) than `conf.max_trait_bounds` on this type.
- take generic args into account over bounded type (rust-lang#4323)
- don't lint for predicates generated in macros (rust-lang#4326)

Fixes rust-lang#4380,
Fixes rust-lang#4323,
Fixes rust-lang#4326,
Closes rust-lang#3764

changelog: Fix multiple FPs in `type_repetition_in_bounds` and add a configuration option

Note: the rust-lang#3764 has already been fixed but not closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants