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

fixing crashes related to Repeated NestedMessage Parsing and bugs in PackToAny API #352

Merged
merged 4 commits into from
Mar 13, 2024

Conversation

ni-sujain
Copy link
Collaborator

fix for ni/measurement-plugin-labview#485, #351

Issue
Given a proto file having repeated NestedMessage

e.g.

syntax = "proto3";

package mytest;

service RouteGuide {
    rpc GetFeature(Name) returns (MyFeatureList) {}
}

message Name {
    string name = 1;
}

message MyFeatureList
{
  repeated Feature feature = 1;    
}

message Feature {
    repeated string res = 1;
}

LV client was crashing. This started happening after #335 where we added some client-side performance improvements. It turns out that while parsing repeated Nested Messages/Strings

DSNewHandle does not work properly can lead to access violations in tdcore.

Fix

  • Main fix was to use NumericArrayResize instead of DSNewHandle; this might degrade performance a little bit.
  • Fixed a bug with duplicate copies in _repeatedStringValuesMap . Used continueIndex from parent NestedMessage to formulate unique key for _repeatedStringValuesMap
  • Fixed the LVRepeatedNestedMessageMessageValue::ByteSizeLong to calculate the tag size based on protobuf index rather passing fixed 1UL.

@ni-sujain ni-sujain merged commit 6296b8d into ni:master Mar 13, 2024
5 checks passed
@ni-sujain ni-sujain deleted the master-fork-dev branch March 13, 2024 09:52
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

Successfully merging this pull request may close these issues.

2 participants