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

Enhance: Add macos support #76

Closed

Conversation

jakerenzella
Copy link
Contributor

@jakerenzella jakerenzella commented Jul 12, 2022

A very early WIP to get compile-time DCC checks working on MacOS, as well as a working installation process.

Although Valgrind does not seem to support MacOS, therefore I am not sure how fruitful this endeavour may turn out to be, however compile-time explanations now work:

Screen Shot 2022-07-12 at 4 52 54 pm

Potentially, usr/bin/leaks on MacOS could be used as a replacement for Valgrind, but would be a larger project

@jakerenzella
Copy link
Contributor Author

@andrew-taylor Let me know what you think, mostly a PoC. If we disabled DCC run-time checks on MacOS we would have something that worked at compile-time.

@jakerenzella
Copy link
Contributor Author

Not sure the proposed solution here ever worked: #42

@andrew-taylor
Copy link
Collaborator

If clang address & memory sanitizers work they potentially
could be run in tandem.
Memory sanitizer misses some error that valgrind catches but is useful.
Even if the address sanitizer run alone is very useful.
Could you try:

curl -sO https://raw.githubusercontent.com/COMP1511UNSW/dcc/master/tests/run_time_errors/illegal_malloc_array_index.c
clang -fsanitize-address illegal_malloc_array_index.c
a.out
curl -sO https://raw.githubusercontent.com/COMP1511UNSW/dcc/master/tests/run_time_errors/uninitialized-array-element-if.c
clang -fsanitize=memory uninitialized-array-element-if.c
a.out

@jakerenzella
Copy link
Contributor Author

Apple's Clang:

  • clang -fsanitize=address array_of_structs.c -o program 👍
  • clang -fsanitize=leak array_of_structs.c -o program 👎
  • clang -fsanitize=memory array_of_structs.c -o program 👎

llvm Clang via Brew:

  • clang -fsanitize=address array_of_structs.c -o program 👍
  • clang -fsanitize=leak array_of_structs.c -o program 👍
  • clang -fsanitize=memory array_of_structs.c -o program 👎

@andrew-taylor
Copy link
Collaborator

merged indirectly - thanks!

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.

2 participants