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

runtime error: Json::Value::operator[](char const*)const: requires objectValue #145

Closed
smolkaj opened this issue Nov 10, 2016 · 1 comment

Comments

@smolkaj
Copy link
Member

smolkaj commented Nov 10, 2016

The following program compiles fine, but simple_switch raises the error

terminate called after throwing an instance of 'std::runtime_error'
  what():  in Json::Value::operator[](char const*)const: requires objectValue
Aborted (core dumped)

at runtime:

#include <core.p4>
#include <v1model.p4>
typedef standard_metadata_t std_meta_t;

header hash_t {
    bit<16> hash;
}

header ipv4_t {
    bit<32> lkp_ipv4_sa;
}

struct M {
    hash_t hash;
    ipv4_t ipv4;
}

struct H { }


parser ParserI(packet_in pk, out H hdr, inout M meta, inout std_meta_t std_meta) {
    state start {
        transition accept;
    }
}

control VerifyChecksumI(in H hdr, inout M meta) {
    apply { }
}

control ComputeChecksumI(inout H hdr, inout M meta) {
    apply { }
}

control IngressI(inout H hdr, inout M meta, inout std_meta_t std_meta) {

    action a() {
        hash(meta.hash.hash,
             HashAlgorithm.crc16,
             (bit<16>)0, 
             { meta.ipv4.lkp_ipv4_sa },
             (bit<32>)65536);
    }
    
    apply {
        a();
    }
}


control EgressI(inout H hdr, inout M meta, inout std_meta_t std_meta) {
    apply { }
}

control DeparserI(packet_out b, in H hdr) {
    apply { }
}

V1Switch(ParserI(), VerifyChecksumI(), IngressI(), EgressI(), ComputeChecksumI(), DeparserI()) main;
@smolkaj
Copy link
Member Author

smolkaj commented Nov 29, 2016

This is fixed (I lost track which pull request fixed it, unfortunately.)

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