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

Segfault when running elkhound/elkhound elkhound/examples/crash1.gr on Mac OS X #18

Open
sam-ellis opened this issue Oct 15, 2016 · 0 comments

Comments

@sam-ellis
Copy link
Contributor

sam-ellis commented Oct 15, 2016

Receive a segfault when running elkhound/elkhound elkhound/examples/crash1.gr on Mac OS X. Have built the tools using Apple LLVM version 8.0.0 (clang-800.0.38). Debegging segfault reveals the cause to be dereferencing a null pointer when calling LocString::<< operator (loc.str is NULL). From the comments in ast/locstr.h I see that the loc.str is permitted to be NULL:

  // experimenting with allowing 'str' to be null, which is convenient
  // when the string table isn't available

In that case, the << operators should deal gracefully with str==NULL.

sam-ellis added a commit to sam-ellis/oink-stack that referenced this issue Oct 15, 2016
Fix for issue dsw#18. As per the comments in locstr.h the str field is permitted to be NULL. This fix protects against NULL pointer dereference in the << operators. This allows elkhound/elkhound elkhound/examples/crash1.gr to pass (not segfault) on Mac OS X.
dsw added a commit that referenced this issue Oct 21, 2016
Update locstr.h to fix issue #18.
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

No branches or pull requests

1 participant