Method and device for detecting stack overflow position

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

CN104714885BActive Publication Date: 2017-12-01XIAOMI INC
5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Publication Date
2017-12-01

Smart Images

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

Abstract

The disclosure relates to a detection method and device for a stack overflow location, which are used to quickly and easily detect the stack overflow location. The method includes: before executing the function to be tested, determining the initial value of the random initialization number in the program, wherein the random initialization number is at a byte-aligned address before the last element of the array buffer of the program; executing The function to be tested, and after executing the function to be tested, obtain the current value of the random initialization number; judge whether the current value is the same as the initial value; when the current value is the same as the initial value At the same time, it is determined that a stack overflow does not occur in the function to be tested; when the current value is different from the initial value, it is determined that a stack overflow occurs in the function to be tested. The method realizes quick and easy detection of stack overflow position.
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 explaining the technical solutions provided by the embodiments of the present disclosure, the principle on which the technical solutions of the embodiments of the present disclosure are based is firstly 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.

[004...