RootCanal: Improve handling of packet parsing errors
Previously simply crashed with ASSERT when an invalid packet was received. This was problematic for a couple reasons: - ASSERT is not always enabled, i.e. some code could be executed with invalid packets as input - in the android emulator context it is not desirable to crash the emulator when receiving an invalid packet Instead, this patch uses the following handling code when a parsing error is found - report the packet through the invalid packet handler (same as generating a bug report with a triggered ASSERT) - send a Hardware Error event to the Host to signal invalid behavior - if in debug mode trigger ASSERT, else ignore the packet Bug: 323226412 Test: m root-canal Flag: EXEMPT, tool change Change-Id: Ibcb89b0fc7f405e3646cfd249a3fad88a668302b
Showing
- tools/rootcanal/Android.bp 3 additions, 0 deletionstools/rootcanal/Android.bp
- tools/rootcanal/model/controller/dual_mode_controller.cc 202 additions, 186 deletionstools/rootcanal/model/controller/dual_mode_controller.cc
- tools/rootcanal/model/controller/dual_mode_controller.h 20 additions, 2 deletionstools/rootcanal/model/controller/dual_mode_controller.h
- tools/rootcanal/test/invalid_packet_handler_unittest.cc 82 additions, 0 deletionstools/rootcanal/test/invalid_packet_handler_unittest.cc
Loading
Please register or sign in to comment