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

Experiment with testing on OSX #1614

Merged
merged 49 commits into from
Jun 23, 2020
Merged

Experiment with testing on OSX #1614

merged 49 commits into from
Jun 23, 2020

Conversation

ehennenfent
Copy link
Contributor

Not committing to front-lining OSX support as a feature because there are some fundamental performance concerns, but I would like to see how the tests behave.

Eric Hennenfent added 4 commits February 19, 2020 12:53
Not committing to front-lining OSX support as a feature because there are some fundamental performance concerns, but I would like to see how the tests behave.
¯\_(ツ)_/¯
@ekilmer
Copy link
Contributor

ekilmer commented Feb 20, 2020

I believe one of the limiting factors with Manticore running Linux binaries on Mac is dynamic linking and loading the linked Linux libraries, right? Static compilations should be fine though, and it seems all of our test binaries are static 👍, so things should work okay for the tests.

One idea for supporting dynamic-linked Linux binaries on Mac would be to include directions to setup a mirror of some "standard" Linux library distribution and pass an option to Manticore to tell it where to look. But, even then, if the program is anything more complex than a standard libc-compiled program, the additional compiled libraries will need to be copied (or built) and placed in the correct place on Mac (within the standard Linux library distrib)

@ekilmer
Copy link
Contributor

ekilmer commented Feb 20, 2020

Also, looks like the failure is due to the fall-through statement in the bash script because of Mac using an outdated version of bash, according to this StackOverflow https://stackoverflow.com/a/14612719

@ehennenfent
Copy link
Contributor Author

I believe one of the limiting factors with Manticore running Linux binaries on Mac is dynamic linking and loading the linked Linux libraries, right?

Right. From slack:

Since Manticore is a python project it should be possible to run it on any platform in theory, but there are going to be some problems.
On the native side, several of the linux system calls rely on functions from the Python standard library that behave differently across platforms or don’t work at all outside of linux. We also load dynamic libraries from the disk instead of shipping them with Manticore, so trying to run it on OSX will load the darwin versions instead of the linux versions.
...
The most overarching issue is that the multiprocessing library Python uses for distributing tasks over processes or threads works best on Linux. OSX’s fork system call is broken so Python can’t create new processes as quickly as it can on Linux. Using the spawn API instead would require us to make ManticoreBase pickle-able, which I attempted in the past but had some trouble with. Instead, Manticore falls back to using threads if you try to run it on not-linux. Access to shared memory works differently depending on which model you use, so you might have to completely rewrite your script if you switch platforms. There's also the GIL to think about, so you won't get as much performance out of the threaded version.

@ekilmer
Copy link
Contributor

ekilmer commented Feb 20, 2020

I believe one of the limiting factors with Manticore running Linux binaries on Mac is dynamic linking and loading the linked Linux libraries, right?

Right. From slack:

I had not seen this!! Great summary 👍

@bradlarsen
Copy link
Contributor

One issue with testing on macOS is that we haven't been able to successfully build keystone there in GitHub Actions.

Just leaving a note here, that it ought to be possible to get keystone installed on their macOS runners -- keystone definitely builds on macOS. However, figuring out how to do it in GitHub CI will likely involve finding out the right incantation to install whatever needed dependencies there are on the macOS runners.

@MatthewARinehart MatthewARinehart added this to In progress in Manticore via automation Jun 11, 2020
@ehennenfent ehennenfent linked an issue Jun 19, 2020 that may be closed by this pull request
@ehennenfent ehennenfent removed this from In progress in Manticore Jun 19, 2020
tests/wasm/generate_tests.sh Outdated Show resolved Hide resolved
tests/wasm_sym/generate_symbolic_tests.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@ekilmer ekilmer left a comment

Choose a reason for hiding this comment

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

Seem to be working for me locally as well 👍

@ehennenfent ehennenfent merged commit 61909a1 into master Jun 23, 2020
@ehennenfent ehennenfent deleted the exp-test-osx branch June 23, 2020 19:09
ekilmer added a commit that referenced this pull request Jul 17, 2020
* master:
  Create a model for strncpy (#1770)
  Add doc, fix output bugs (#1769)
  Update EVM usage example (#1772)
  New working model of strlen (#1725)
  Typo (#1768)
  Specialized iterative serialization for Array (#1756)
  Enable nightly uploads to PyPI (#1757)
  Manticore 0.3.4 (#1720)
  Manticore verifier (#1717)
  Nightly MacOS Tests (#1614)
  Remove/procrastinate solver query in ether leak detector (#1727)
  Fix constant folding & constraint set slicing (#1706)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Manticore EVM is tested against macOS every night
3 participants