-
Notifications
You must be signed in to change notification settings - Fork 228
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
device_tree: Use PluginV1
#1028
Conversation
f707953
to
2430121
Compare
2430121
to
705e3a5
Compare
PluginV1
PluginV1
This is ready! |
86df387
to
5081618
Compare
a317446
to
2dd7b7c
Compare
705e3a5
to
d084823
Compare
8d96aee
to
edf4c71
Compare
9d25aa7
to
cbc00d3
Compare
edf4c71
to
4067c84
Compare
cbc00d3
to
1476694
Compare
2e5eff6
to
7f1b906
Compare
dbde681
to
503a753
Compare
7f1b906
to
4bef560
Compare
4bef560
to
50eba56
Compare
50eba56
to
d41c009
Compare
I tried running it and there seem to be problems with the "architecture_detection" plugin (which depends on the device_tree plugin) not expecting Traceback (most recent call last):
File "/usr/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "src/helperFunctions/process.py", line 91, in run
raise exception
File "src/helperFunctions/process.py", line 86, in run
Process.run(self)
File "/usr/lib/python3.11/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "src/analysis/PluginBase.py", line 196, in process_next_object
finished_task = self.analyze_file(task)
^^^^^^^^^^^^^^^^^^^^^^^
File "src/analysis/PluginBase.py", line 159, in analyze_file
fo = self.process_object(file_object)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "src/plugins/analysis/architecture_detection/code/architecture_detection.py", line 37, in process_object
arch_dict = construct_result(file_object, self._fs_organizer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "src/plugins/analysis/architecture_detection/code/architecture_detection.py", line 50, in construct_result
result.update(dt.construct_result(file_object))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "src/plugins/analysis/architecture_detection/internal/dt.py", line 76, in construct_result
for dt_dict in file_object.processed_analysis['device_tree'].get('result', {}).get('device_trees', []):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get' |
7747ebe
to
1b1b284
Compare
1b1b284
to
02638ec
Compare
Fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try to run it? I always got an Internal Server Error when trying it out:
File "src/web_interface/filter.py", line 439, in hide_dts_binary_data
device_tree = re.sub(r'\[[0-9a-f ]{32,}]', '(BINARY DATA ...)', device_tree)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/re/__init__.py", line 185, in sub
return _compile(pattern, flags).sub(repl, string, count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got 'Undefined'
I just ran the tests and totally forgot about the frontend. |
02638ec
to
3df2e7d
Compare
Everything should work now. |
I still get the error message when looking at old analysis results: File "<template>", line 6, in template
File "src/web_interface/filter.py", line 448, in hide_dts_binary_data
device_tree = re.sub(r'\[[0-9a-f ]{32,}]', '(BINARY DATA ...)', device_tree)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/re/__init__.py", line 185, in sub
return _compile(pattern, flags).sub(repl, string, count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Normally this should be intercepted by the version check, but since the version changed from 1.0.1 to 1.1.0, it is treated as compatible. So a "fix" would be to set the version to 2.0.0 (which would be kinda appropriate since there are breaking changes). Apart from that everything seems to work fine. |
3df2e7d
to
aa772bd
Compare
Bumped the version to 2.0.0. Sill the above question is unsolved. |
Major Version bumped because the schema changed. Defining the schema allowed us to clean up much of the logic. While there is some arguable code left this is a step in the right direction. Also required a change in the architecture_detection plugin to accomodate that the result can be None.
This is not a standart DeviceTree field, but aparently it appreas in some firmwares. So we just cargo cult the thing :)
25d5379
to
4479496
Compare
An oversight in rebasing fkie-cad#1028
An oversight in rebasing #1028
Simelar to #1022
The alembic commit is probably not needed and superseded by #1027