-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Ban variables whose capability is unsound to alias #3953
Conversation
I don't really understand the usage of |
I believe after reading the error closing for a while is that we are getting a fatal error like a segfault or something from some of the tests apparently perhaps when run in conjunction with others. It makes me think there's some memory clobbering or something going on. |
Ok so has a fatal error:
when I have it set to only go through the "syntax" path. From this I conclude that the vast majority of the code in this PR "can't be at fault". I don't know if the alias.c changes would impact if we go through syntax. So I'm left with a few possible conclusions given that the same code when compiled with ponyc works fine without a kaboom.
It can't be internal to itself as I tried with only that test in the stable type tests.
But I don't think they impact at the syntax stage
|
It's not this as it still happens if it is THE ONLY test at all for libponyc.tests |
This fails:
So I'm horribly confused at this point. It fails by itself after |
Ok so test compile requires there to be a main actor. That explains some of that. |
I think I know what might be going on. This parameter code path isnt generating errors in the way expected. |
Yup, issue confirmed look at the output when run with ponyc:
We made it to link AND we reported an error. That means the error isnt reported correctly "as an error". |
I need to do some stuff now, but Ill continue fixing up later and push changes. |
Ok I have the tests passing. |
I fixed what I believe was a bug in the new code in viewpoint.c. You had
but a_with is already with as I assume that was what you intended. I removed the verify_definitions that you noted wasn't needed. Did some small cleanup. Added what appeared to be some missing frame appending for errors There's still some cleanup but I think this should be much further along. I've pushed to the branch so you'll need to pull. |
(This should be rejected earlier but in case the compiler has a bug it's the code's fault)
ab0cad5
to
69e607c
Compare
I'll be doing the last of the fixes for this soon-ish. |
@jasoncarr0 do you have time to give this a quick review to make sure it looks good? if not, i can move ahead as i believe i got everything from our conversations handled. i feel "pretty darn confident" on that. |
* Normalizes the capability and alias modifier to apply aliasing | ||
* and remove unnecessary ephemeral modifiers. | ||
*/ | ||
void cap_aliasing(token_id* cap, token_id* eph); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this worth leaving in? Or should we revert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is still used elsewhere.
Hi @jasoncarr0, The changelog - fixed label was added to this pull request; all PRs with a changelog label need to have release notes included as part of the PR. If you haven't added release notes already, please do. Release notes are added by creating a uniquely named file in the The basic format of the release notes (using markdown) should be:
Thanks. |
This reverts commit 3ea2647.
This PR introduces checks around variables and other unaliasing points, to reject programs which attempt to create variables whose capabilities are inherently unsound. The checks about comptability of intersections have been moved to this check after investigation of the origin, as it is not needed for soundness, but this can be reinstated in the original location if helpful for engineering purposes.
Fixes #3931
Some generic code may still produce unsoundness after instantiating, but this change is hopefully a step-forwarding to introducing the necessary constraints.