Garbage characters in bmv2 log message during table error
During a CI pipeline run the following console output was observed:
docker exec -w /tests/vnet_out simple_switch-runner ./vnet_out
GRPC call SetForwardingPipelineConfig 0.0.0.0:9559 => /etc/dash/dash_pipeline.json, /etc/dash/dash_pipeline_p4rt.txt
GRPC call Write::add_one_entry OK: GRPC call Write::add_one_entry OK: GRPC ERROR[2]: , `
type.googleapis.com/p4.v1.Error=&Missing non-ternary field in match keyALL-sswitch-p4orgGRPC call Write::add_one_entry ERROR:
table_id: 34579306 action { action { action_id: 17187022 params { param_id: 1 value: "\t\000\000" } } }double free or corruption (fasttop)
We need to clean up the output, make it more sensible and suppress binary junk from appearing on the console if possible. This might take some effort if the output is coming from existing P4RT libraries.
UTF-8 ?, maybe take the source file and convert it to ASCII and see if you get any errors about chars that cannot be converted.
I think it's emitting raw octet streams from the gRPC P4Runtime message, needs some exploring.
@chrispsommers Do you still see the same binary junk? I'm seeing a case of failed programming from P4Runtime gRPC but there is no non-ascii char in the output.
e:- mutateTableEntry: GRPC ERROR[2]: ,L type.googleapis.com/p4.v1.ErrorInvalid match typeALL-sswitch-p4org e:- mutateTableEntry: GRPC call Write::INSERT ERROR: table_id: 38920290 match { field_id: 1 exact { value: "\0003" } } match { field_id: 2 exact { value: "\000\000e" } } match { field_id: 3 } action { action { action_id: 27844834 } }
@ashutosh-agrawal I haven't tried it in a long time, but @kcudnik did some changes in this area some months ago if I recall; it might have fixed the error. If you don't see it anymore we can close it.
@KrisNey-MSFT to see if this issue can be closed.
Do we need to test it during a CI pipeline run?
@ashutosh-agrawal and @chrispsommers
We would need to add a negative test to expose this.
i think i corrected that when i updated logging mechanism
but maybe its not a log problem but return value problem? it was:
LOG("GRPC call Write::" << updateTypeStr(updateType) << " OK" << entry->ShortDebugString() << std::endl);
now its:
DASH_LOG_NOTICE("GRPC call Write::%s OK %s", updateTypeStr(updateType).c_str(), entry->ShortDebugString().c_str());
Agreed, I think using c_str() was the solution. LOG macro is fine, it just didn't get the right types to fill the format strings.
so ok to close then? thank you, Kristina