Another scenario analysis for Systemserver restart caused by Sensorservice crash under android5.0l

Source: Internet
Author: User

First, the scene of the problem

1. Sensorservice line is impersonating in processing Compass Sensor The process of the event, check the Buffer the validity of the pointer, and will be passed on later to the AKM gets the data used in the function interface

2. Sensorservice the process in which the thread is responsible for cross-process communication Binder Thread in Sensorservice thread Check Buffer after the pointer is not actually used,

Roger that.Disable Compass sensorthe request, fromLogcan be seen inCompass Sensorwas firstDisable,Disableat the same time will FreeaboveSensorservicechecked and in useBufferpointer, empty at the same timeBufferPointers

3. immediately Sensorservice thread continues execution AKM gets the function interface of the data and uses the Disable Empty The Buffer pointer, and then produces an exception


Second, the specific log and code

Disable Compass Sensor and Free buffer The code:

Free buffer 3ms after Sensorservice immediately because of access to null pointer exception Log :

Pass the buffer pointer and use the code:

Use the buffer pointer to generate an exception for the place log:

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Another scenario analysis for Systemserver restart caused by Sensorservice crash under android5.0l

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.