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

Add testcase for finding crash offset #4112

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ConnorNelson
Copy link
Member

This functionality currently works. I want to guarantee that it continues to work. If the current approach should be changed at all, please let me know.

@ConnorNelson
Copy link
Member Author

CC @Cl4sm

@github-actions
Copy link
Contributor

github-actions bot commented Aug 30, 2023

Test Results

     86 files  ±0       86 suites  ±0   1h 46m 24s ⏱️ + 5m 30s
1 203 tests +2  1 172 ✔️ +1  30 💤 ±0  0 ±0  1 🔥 +1 
1 209 runs  +2  1 178 ✔️ +1  30 💤 ±0  0 ±0  1 🔥 +1 

For more details on these errors, see this check.

Results for commit 77f6455. ± Comparison against base commit f10b145.

♻️ This comment has been updated with latest results.

@ltfish
Copy link
Member

ltfish commented Aug 30, 2023

Fix the linting issues and I will click merge!


binary_path = tempfile.mktemp()

subprocess.run(["gcc", program_path, "-o", binary_path, "-fno-stack-protector"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this test only intended to run on linux? This is gonna fail nightlies on macos and windows

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It honestly may be a better idea to pre-compile binaries and put them in the binaries repo rather than compiling this every time the test is run, especially since nowhere does angr explicitly depend on gcc,

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this going to fail on macos/windows?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you really rather ship a bunch of precompiled binaries for this? The very small source code being included here makes the testcase much more readable.

Can we make angr testcases explicitly depend on gcc? I don't think angr needs to, just angr testcases.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose gcc is aliased to clang by default on mac, but on windows it is not standard. I would not expect gcc to be in a user's path on windows. angr users msvc on windows.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prevailing wisdom on the angr team is that it's better to ship binaries so we don't have to deal with testcase failures when gcc updates :)

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.

None yet

4 participants