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

Compiler Bug : Null firstCall #2597

Closed
robotrobo opened this issue Oct 30, 2020 · 2 comments · Fixed by #2598
Closed

Compiler Bug : Null firstCall #2597

robotrobo opened this issue Oct 30, 2020 · 2 comments · Fixed by #2598
Assignees
Labels
bug This behavior is unintended and should be fixed. fixed This topic is considered to be fixed.

Comments

@robotrobo
Copy link
Contributor

The following program crashes when trying to inline two controls and one of the controls is being called in an action.

p4test --Wdisable control_apply_action.p4.txt
In file: p4c/frontends/p4/inlining.cpp:521                                                
Compiler Bug: p4c/frontends/p4/inlining.cpp:521: Null firstCall      

control_apply_action.p4.txt

I'm filing this on behalf of @fruffy

@mihaibudiu mihaibudiu self-assigned this Oct 30, 2020
@mihaibudiu mihaibudiu added the bug This behavior is unintended and should be fixed. label Oct 30, 2020
@mihaibudiu
Copy link
Contributor

We should probably forbid control invocation in actions if the invoked control contains any tables.

@jafingerhut
Copy link
Contributor

jafingerhut commented Oct 30, 2020

The P4_16 language spec, appendix F, the last of the tables in that appendix: https://p4.org/p4-spec/docs/P4-16-v1.2.1.html#sec-calling-restrictions

has restricted that controls cannot be applied from within actions ever since that section was added a few years ago. I remember I initially had proposed allowing actions calling controls if the control did not invoke any tables, but I think you, Mihai, recommended against it then, I thought in general, and hence that is why that table has "no" for that entry.

Note: I am not here arguing for generalizing what is in the spec at this time. It seems perfectly reasonable if p4c follows what the spec says, and forbids calling controls from within action bodies, regardless of whether the control has tables or not.

@mihaibudiu mihaibudiu added the fixed This topic is considered to be fixed. label Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This behavior is unintended and should be fixed. fixed This topic is considered to be fixed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants