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

p4c-bm2-ss crash when control instantiated but not apply'd #414

Closed
jafingerhut opened this issue Mar 31, 2017 · 2 comments
Closed

p4c-bm2-ss crash when control instantiated but not apply'd #414

jafingerhut opened this issue Mar 31, 2017 · 2 comments

Comments

@jafingerhut
Copy link
Contributor

In the attached P4_16 program, search for comment containing XXX. A control block instantiates an earlier control block. If it also calls apply() method on it, then p4c-bm2-ss compiles without errors.

If it does not also call apply() method on it, p4c-bm2-ss crashes.
crash2.p4.txt

@mihaibudiu
Copy link
Contributor

mihaibudiu commented Mar 31, 2017

The compiler front-end used to delete such dead code, but now it's leaving it in the program.
This causes a crash since the back-end does not expect them - all used instantiations should be inlined.
We are leaving instantiations in the program until the back-end even if they are unused, because they may have a bearing on the control-plane.
Note that the front-end still deletes unused tables; maybe we should change this fact as well.
I will submit a PR which fixes this crash.

@jafingerhut
Copy link
Contributor Author

I have tested the P4 program crash2.p4 causing the crash before this fix was committed: 52c5e1c

No crash after the commit, neither with p4test nor p4c-bm2-ss -- only a correct warning about an unused instance. Closing this issue.

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

2 participants