-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
GDS Fails To Launch With Unknown Types In Dictionary #2230
Comments
From: @JackNWhite I am trying out this modification. diff --git a/src/fprime_gds/common/loaders/xml_loader.py b/src/fprime_gds/common/loaders/xml_loader.py
index b7e8984..4cc0e0c 100644
--- a/src/fprime_gds/common/loaders/xml_loader.py
+++ b/src/fprime_gds/common/loaders/xml_loader.py
@@ -180,7 +180,13 @@ class XmlLoader(dict_loader.DictLoader):
arg_name = arg_dict[self.ARG_NAME_TAG]
arg_type_name = arg_dict[self.ARG_TYPE_TAG]
- arg_typ_obj = self.parse_type(arg_type_name, arg, xml_tree, context)
+
+ try:
+ arg_typ_obj = self.parse_type(arg_type_name, arg, xml_tree, context)
+
+ # Return nothing if the args are at least partly nonsense
+ except exceptions.GseControllerParsingException:
+ return []
arg_desc = None
if self.ARG_DESC_TAG in arg_dict: |
This would:
try:
arg_typ_obj = self.parse_type(arg_type_name, arg, xml_tree, context)
except exceptions.GseControllerParsingException as e:
LOGGER.warning(f"Unable to parse type {arg_type_name}: {str(e)}")
# Create placeholder type object that indicates unparseable data
arg_typ_obj = UnparseableType(arg_type_name) |
I think we will need something like this. Non-displayable types can appear in data product records, which aren't displayed in the real-time GDS output. @jwest115 discovered that these types are not correctly handled in the JSON dictionary. To fix this problem, we will need to represent non-displayable types in the dictionary, and the GDS will have to ignore them. |
Proposed approach for representing non-displayable types:
To use this solution:
This approach would solve the original issue while:
|
@jwest115 are you addressing this as part of your work? |
We decided to exclude non-displayable types from records in FPP, because they have no size information that is discoverable by the analyzer. See nasa/fpp#576. So allowing undefined types in the dictionary is not currently in the scope of planned work. In the current design, if a type appears in the dictionary and it has no definition, then the dictionary is malformed. Also, I agree that ideally the GDS shouldn't crash if it's given malformed JSON input. However, do we think that an undefined type is the only problem that could cause the GDS to crash? I suspect that hardening the GDS against malformed JSON would require more error checking and testing than that. |
Problem Description
The GDS crashes on launch when provided with a dictionary containing references to a handcoded type. See: #1643 (comment)
This may also apply to other complicated types like serlizables.
Expected Behavior
Instead of failing to launch, the GDS should launch but warn that it's unable to deserialize EVRs referencing the handcoded type.
The text was updated successfully, but these errors were encountered: