Method and device for detecting stack overflow position

A detection method and stack overflow technology, applied in software testing/debugging, platform integrity maintenance, etc.

CN104714885AActive Publication Date: 2015-06-17XIAOMI INC
5 Cites 13 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Publication Date
2015-06-17

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention relates to a method and device for detecting the stack overflow position. The method and device are used for rapidly and conveniently detecting the stack overflow position. The method comprises the steps that before a function to be detected is executed, the initial value of a randomly initialized figure in a program is determined, wherein the randomly initialized figure is located at the bite alignment address which is closest to and in front of the last element of an array buffering area of the program; the function to be detected is executed, and after the function to be detected is executed, the current value of the randomly initialized figure is obtained; whether the current value and the initial value are equal or not is judged; if the current value is equal to the initial value, it is determined that stack overflow does not happen to the function to be detected; if the current value is not equal to the initial value, it is determined that stack overflow happens to the function to be detected. By the adoption of the method, the stack overflow position can be rapidly and conveniently detected out.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The present disclosure relates to the technical field of terminal equipment development, and in particular to a method and a device for detecting a stack overflow location. Background technique

[0002] With the popularity of smart phones, there has been an upsurge in mobile development in recent years, especially the open source of the android system, which has made the cost of developing mobile phone systems for various manufacturers very low, and has also attracted more and more developers. Entering this embedded field development platform, the embedded field is mainly based on the embedded development of arm architecture. arm programming and debugging technology has increasingly become the core competitiveness of today's mobile development field. Developing and debugging programs quickly is a skill that every mobile developer desperately wants to master.

[0003] The stack overflow problem is very common in program development. However, programme...

Examples

Embodiment Construction

[0045] Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatuses and methods consistent with aspects of the present disclosure as recited in the appended claims.

[0046] Before describing the technical solutions provided by the embodiments of the present disclosure, firstly, the principle on which the technical solutions of the embodiments of the present disclosure are based is explained. The embodiment of the present disclosure is based on the principle of an arm compiler, and is an effective stack overflow position detection technology.

[00...