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

Declaring an action profile as a control local crashes the BMV2 backend #297

Closed
sethfowler opened this issue Feb 11, 2017 · 0 comments
Closed
Labels
bmv2 Topics related to BMv2 or v1model bug This behavior is unintended and should be fixed.

Comments

@sethfowler
Copy link
Contributor

In #296 there was discussion of the fact that a table's implementation property could refer to a Declaration_Instance. The attached file is a modified version of an existing test case, action_profile-bmv2.p4, which declares an action profile as a control local. It crashes the BMV2 backend with this message:

../testdata/p4_16_samples/action_profile-bmv2.p4(41): error: implementation: expected constructor call for property
        implementation = ap;
        ^^^^^^^^^^^^^^
../testdata/p4_16_samples/action_profile-bmv2.p4(37): warning: Target does not support default_action for indirect (due to action profiles)
    table indirect {
          ^^^^^^^^
../testdata/p4_16_samples/action_profile-bmv2.p4(44): warning: Target does not support default_action for indirect_ws (due to action profiles)
    table indirect_ws {
          ^^^^^^^^^^^
libc++abi.dylib: terminating with uncaught exception of type Util::CompilerBug: COMPILER BUG: ../backends/bmv2/jsonconverter.cpp:1685
../testdata/p4_16_samples/action_profile-bmv2.p4(33): @name("ap") action_profile ap(128): not yet handled
    action_profile(32w128) ap;
                           ^^

Note that even ignoring the crash, the error implementation: expected constructor call for property suggests that we are currently not prepared to handle this case, at least in the BMV2 backend.

action_profile-bmv2.p4.txt

@antoninbas antoninbas added bmv2 Topics related to BMv2 or v1model bug This behavior is unintended and should be fixed. labels Feb 27, 2017
mihaibudiu pushed a commit to mihaibudiu/p4c-clone that referenced this issue Mar 1, 2017
mihaibudiu pushed a commit to mihaibudiu/p4c-clone that referenced this issue Mar 1, 2017
mihaibudiu pushed a commit to mihaibudiu/p4c-clone that referenced this issue Mar 1, 2017
mihaibudiu pushed a commit to mihaibudiu/p4c-clone that referenced this issue Mar 1, 2017
ChrisDodd pushed a commit that referenced this issue Mar 1, 2017
* Fix for issue #297

* Removed useless map

* cpplint fix

* Second fix for issue #297
mihaibudiu pushed a commit to mihaibudiu/p4c-clone that referenced this issue Mar 4, 2017
ChrisDodd pushed a commit that referenced this issue Mar 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bmv2 Topics related to BMv2 or v1model bug This behavior is unintended and should be fixed.
Projects
None yet
Development

No branches or pull requests

2 participants