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

invalid boolean values in generated json for table entries #535

Closed
cc10512 opened this issue Apr 27, 2017 · 0 comments
Closed

invalid boolean values in generated json for table entries #535

cc10512 opened this issue Apr 27, 2017 · 0 comments

Comments

@cc10512
Copy link
Contributor

cc10512 commented Apr 27, 2017

From @vgurevich:
Attached is a program and the JSON, produced by p4c-bm2-ss that result in BMv2 termination with the following message:

$ sudo simple_switch -i 0@veth0 -i 1@veth2 -i 2@veth4 --log-console --dump-packet-data 64 l3_switch.json 
Thrift port was not specified, will use 9090
Calling target program-options parser
[16:31:18.454] [bmv2] [D] [thread 7495] Set default entry for table 'tbl_act': act - 
[16:31:18.454] [bmv2] [D] [thread 7495] Set default entry for table 'ipv4_lpm': drop - 
[16:31:18.455] [bmv2] [D] [thread 7495] Set default entry for table 'forward': drop - 
terminate called after throwing an instance of 'std::runtime_error'
  what():  Value is not convertible to bool.
Aborted (core dumped)

The problem is in the code that the compiler generates for the table initialization entries, e.g.

{
    "match_type" : "valid",
     "key" : "true"
},

The right way to generate it is to use booleans instead of strings. Removing the quotation marks around "true"s and "false"s fixes the problem.

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