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

Adding support for shutdown upon Ctrl+C on Windows for LLMP #1704

Merged
merged 16 commits into from
Dec 5, 2023

Conversation

mkravchik
Copy link
Contributor

This PR adds support shutdown upon Ctrl+C on Windows for LLMP. On Windows, Ctrl+C sent to console applications are not caught by the exception handler, but by a special CtrlHandler instead. I followed the design of Linux signal handlers and Windows exceptions handlers for the CtrlHandlers and integrated them in LLMP using the same approach as LlmpShutdownSignalHandler for unix

@domenukk
Copy link
Member

Thanks! This just needs a pass of cargo fmt and one of cargo clippy :)

libafl_bolts/src/llmp.rs Outdated Show resolved Hide resolved
libafl_bolts/src/llmp.rs Outdated Show resolved Hide resolved
libafl_bolts/src/llmp.rs Outdated Show resolved Hide resolved
libafl_bolts/src/os/windows_exceptions.rs Outdated Show resolved Hide resolved
libafl_bolts/src/llmp.rs Show resolved Hide resolved
@tokatoka
Copy link
Member

tokatoka commented Dec 3, 2023

can you format? then i can merge it.
i'll maybe change the location of hanlder installation later on my side

libafl_bolts/src/llmp.rs Outdated Show resolved Hide resolved
@domenukk
Copy link
Member

domenukk commented Dec 4, 2023

Somehow fmt still doesn't like you?

Diff in /home/runner/work/LibAFL/LibAFL/libafl/src/feedbacks/map.rs at line 547:
             }
         }*/
 
-
         let steps = size / VectorType::LEN;
         let left = size % VectorType::LEN;

@tokatoka
Copy link
Member

tokatoka commented Dec 4, 2023

there're more fmts to fix

@mkravchik
Copy link
Contributor Author

I ran fmt at the root and fixed what ever it found. Hope this time it is OK.

@tokatoka
Copy link
Member

tokatoka commented Dec 5, 2023

the log says you need to run it in ./fuzzers/tutorial

@mkravchik
Copy link
Contributor Author

What log?

@tokatoka
Copy link
Member

tokatoka commented Dec 5, 2023

https://github.com/AFLplusplus/LibAFL/actions/runs/7096462809/job/19315022927?pr=1704
I suppose you are not using nightly to fmt it

@mkravchik
Copy link
Contributor Author

Finally fixed (I had to use nightly toolchain explicitly)

@tokatoka tokatoka enabled auto-merge (squash) December 5, 2023 20:02
@tokatoka tokatoka disabled auto-merge December 5, 2023 20:02
@tokatoka tokatoka merged commit b336411 into AFLplusplus:main Dec 5, 2023
16 checks passed
@mkravchik mkravchik deleted the windows_ctrl_handler_llmp branch December 5, 2023 20:04
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