Movatterモバイル変換


[0]ホーム

URL:


CN106294134A - The collapse localization method of code and device - Google Patents

The collapse localization method of code and device
Download PDF

Info

Publication number
CN106294134A
CN106294134ACN201610619744.0ACN201610619744ACN106294134ACN 106294134 ACN106294134 ACN 106294134ACN 201610619744 ACN201610619744 ACN 201610619744ACN 106294134 ACN106294134 ACN 106294134A
Authority
CN
China
Prior art keywords
information
collapse
code
exception
project
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610619744.0A
Other languages
Chinese (zh)
Other versions
CN106294134B (en
Inventor
黄斌
魏学峰
严明
袁明凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Tencent Cloud Computing Beijing Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co LtdfiledCriticalTencent Technology Shenzhen Co Ltd
Priority to CN201610619744.0ApriorityCriticalpatent/CN106294134B/en
Publication of CN106294134ApublicationCriticalpatent/CN106294134A/en
Application grantedgrantedCritical
Publication of CN106294134BpublicationCriticalpatent/CN106294134B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The invention discloses collapse localization method and the device of a kind of code, belong to field of computer technology.Described method includes: obtain exception stack information, each collapse object that described exception stack information reports during running item destination code for indicating each terminal;Obtaining the first abnormality code information being scanned obtaining to described item destination code, described first abnormality code information is for indicating each exception object that there is code error in described item destination code;According to described exception stack information and described first abnormality code information, determine the exception object associated by each collapse object;Position the position in described code of the exception object associated by each collapse object.Collapse object is associated by the present invention with exception object, determine and collapse exception object that object the is associated position in code, solve code content more and cause the relatively low problem of the collapse location efficiency of code, reach the effect of the collapse location efficiency improving code.

Description

The collapse localization method of code and device
Technical field
The present invention relates to field of computer technology, particularly to collapse localization method and the device of a kind of code.
Background technology
Along with the raising of the complexity of application program, in the running of application program, often there is application programThe problem of collapse.When application crash, developer needs to position, the code causing collapse to repair in time in timeThis partial code multiple.
At present, application program uploads exception stack information to server after collapse, and this exception stack information at least includesCode call relation during application crash, the code call relation in exception stack information is carried out by developer artificiallyAnalyze, determine the code causing collapse, then to the code of application program positions the position of this code.
The code of collapse is caused owing to developer needs first artificially to analyze, then to code positions the position of this codePutting, when the code content of code is more, developer cannot quickly orient the position of code, thus causes the collapse of codePosition is inefficient.
Summary of the invention
More and cause the relatively low problem of the collapse location efficiency of code in order to solve code content, the embodiment of the present invention carriesCollapse localization method and the device of a kind of code are supplied.Described technical scheme is as follows:
First aspect, it is provided that the collapse localization method of a kind of code, described method includes:
Obtaining exception stack information, described exception stack information is for indicating each terminal in the mistake running item destination codeEach collapse object reported in journey, described collapse causes the object of collapse to liking in described code;
Obtain the first abnormality code information being scanned obtaining, described first abnormality code letter to described item destination codeBreath is for indicating each exception object that there is code error in described item destination code;
According to described exception stack information and described first abnormality code information, determine associated by each collapse object is differentOften object;
Position the position in described code of the exception object associated by each collapse object.
Second aspect, it is provided that the collapse positioner of a kind of code, described device includes:
Stack information acquisition module, is used for obtaining exception stack information, and described exception stack information is used for indicating each eventuallyHolding each collapse object reported during running item destination code, described collapse causes collapse to liking in described codeObject;
First information acquisition module, for obtaining the first abnormality code letter being scanned obtaining to described item destination codeBreath, described first abnormality code information is for indicating each exception object that there is code error in described item destination code;
Exception object determines module, for according to described stack information acquisition module obtain described exception stack information andThe described first abnormality code information that described first information acquisition module obtains, determines that the exception associated by each collapse object is rightAs;
For positioning the described exception object associated by each collapse object, exception object locating module, determines that module determinesException object position in described code.
The technical scheme that the embodiment of the present invention provides provides the benefit that:
By obtaining exception stack information, this exception stack information is running item destination code for indicating each terminalDuring report each collapse object;Obtaining the first abnormality code information that obtains of being scanned item destination code, this is the years oldEach exception object of code error is there is in one abnormality code information in indication item destination code;According to exception stack informationWith the first abnormality code information, position the position in code of the exception object associated by each collapse object, so, will collapseObject is associated with exception object, it is determined that the exception object being associated with collapse object position in code, solves generationDigital content is more and causes the relatively low problem of the collapse location efficiency of code, has reached the effect of the collapse location efficiency improving codeReally.
Accompanying drawing explanation
For the technical scheme being illustrated more clearly that in the embodiment of the present invention, in embodiment being described below required for makeAccompanying drawing be briefly described, it should be apparent that, below describe in accompanying drawing be only some embodiments of the present invention, forFrom the point of view of those of ordinary skill in the art, on the premise of not paying creative work, it is also possible to obtain other according to these accompanying drawingsAccompanying drawing.
Fig. 1 is the method flow diagram of the collapse localization method of the code that one embodiment of the invention provides;
Fig. 2 is the method flow diagram of the collapse localization method of the code that another embodiment of the present invention provides;
Fig. 3 is the method flow diagram that the code information that one embodiment of the invention provides obtains;
Fig. 4 is the project information configuration interface that one embodiment of the invention provides;
Fig. 5 is the method flow diagram that the exception object that one embodiment of the invention provides determines;
Fig. 6 is the schematic diagram of the server interaction that one embodiment of the invention provides;
Fig. 7 is that a kind of of one embodiment of the invention offer collapses the interface schematic diagram that object associates with exception object;
Fig. 8 is the structured flowchart of the collapse positioner of the code that one embodiment of the invention provides;
Fig. 9 is the structured flowchart of the collapse positioner of the code that yet another embodiment of the invention provides.
Detailed description of the invention
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present inventionFormula is described in further detail.
Refer to Fig. 1, it illustrates the method flow of the collapse localization method of the code that one embodiment of the invention providesFigure.The collapse localization method of this code can apply in server, and the collapse localization method of this code includes:
Step 101, obtains exception stack information, and exception stack information is used for indicating each terminal running item destination codeDuring each collapse object of reporting, collapse to as if code in cause the object of collapse.
Step 102, obtains the first abnormality code information being scanned obtaining, the first abnormality code letter to item destination codeEach exception object of code error is there is in breath in indication item destination code.
Step 103, according to exception stack information and the first abnormality code information, determine associated by each collapse object is differentOften object.
Step 104, positions the position in code of the exception object associated by each collapse object.
In sum, the collapse localization method of the code that the embodiment of the present invention provides, by obtaining exception stack information, shouldEach collapse object that exception stack information reports during running item destination code for indicating each terminal;It is right to obtainItem destination code is scanned the first abnormality code information obtained, and this first abnormality code information is used for indication item destination codeMiddle each exception object that there is code error;According to exception stack information and the first abnormality code information, determine each collapseException object associated by object;Position the position in code of the exception object associated by each collapse object, so, will collapseObject of bursting is associated with exception object, it is determined that the exception object being associated with collapse object position in code, solvesCode content is more and causes the relatively low problem of the collapse location efficiency of code, has reached to improve the collapse location efficiency of codeEffect.
Refer to Fig. 2, it illustrates the method flow of the collapse localization method of the code that another embodiment of the present invention providesFigure.The collapse localization method of this code can apply in server, and the collapse localization method of this code includes:
Step 201, obtains exception stack information, and exception stack information is used for indicating each terminal running item destination codeDuring each collapse object of reporting, collapse to as if code in cause the object of collapse.
In the present embodiment, project is the application program being made up of code.Such as, project can be game, chat tool, purchaseThe application programs such as thing website.Terminal from server download items, and can run item destination code in the terminal, thus to terminalUser function is provided.
Owing to item destination code there may be code error, therefore, may during terminal operating item destination codeThere will be the phenomenon of collapse, the object causing collapse in code is referred to as collapsing object by the present embodiment.Such as, when the generation of projectWhen in Ma, certain pointer is not directed to significant internal memory, terminal is meeting nothing when reading data by this pointer of certain function callMethod determines and reads data wherefrom, thus causes collapse, and this function is referred to as collapsing object by the present embodiment.
In order to be able to make developer quickly find collapse object, to repair collapse object, terminal can also beWhen collapse phenomenon occurs in code, record collapses the object of position and calls the object of this object, by the information of these objectsIt is recorded as stack information, stack information is reported server.In the present embodiment, the heap that a project is reported by multiple terminalsStack information is referred to as exception stack information.Wherein, object can be file or function, it is also possible to is at least in file and functionPlant and function parameter.Wherein, file can be libNativeRQD.so, and function can be OnMoveNext (), and function parameter canTo be k.
In an example, stack information can be such that
#00pc 00007807/data/app-lib/com.tencent.rqd.rqdtest-1/libNativeRQD.so(doACrash+55)
#01pc 0000787b/data/app-lib/com.tencent.rqd.rqdtest-1/libNativeRQD.so(Java_com_tencent_feedback_eup_jni_NativeExceptionUpload_doNativeCrashForTest+59)
#02pc 0007bb9f/system/lib/libdvm.so(dvmPlatformInvoke+79)
#03pc 000056af<unknown>
#04pc 000d9eac/system/lib/libdvm.so(dvmCallJNIMethod(unsigned intconst*,JValue*,Method const*,Thread*)+412)
#05pc 00212eb9/system/lib/libdvm.so
#06pc 00008c9f<unknown>
#07pc 00091219/system/lib/libdvm.so(dvmInterpret(Thread*,Methodconst*,JValue*)+201)
In the present embodiment, after server gets exception stack information, need exception stack information is analyzed, fromAnd determine collapse object.In one implementation, all stack informations in exception stack information are analyzed by server,To determine collapse object.
Owing to some collapse is to be caused by the exception object in code, some collapse is not caused by exception object,And the collapse only caused by exception object could be revised code by developer and repair, therefore, in order to avoid to not leading toCross and repair the collapse object that exception object repairs and be analyzed wasted resource, in another kind of implementation, serverBefore exception stack information is analyzed, it is also possible to filtering out is not the stack information of the collapse caused by exception object.Wherein, there is the object of code error in exception object in being a destination code.Such as, when in item destination code, certain pointer is notWhen pointing to significant internal memory, server determines that the function calling this pointer writes mistake, and the present embodiment is by the most different for this functionOften object.
Generally, exception object the collapse caused has fixed type, and server can read institute from exception stack informationThere is the collapse type of stack information, be that the stack information of the first kind retains to collapse type, be non-the to collapse typeThe stack information of one type is deleted, and obtains exception stack information.That is, exception stack information is obtained, including: obtain collapse classType is the exception stack information of the first kind, and the first kind is the type of the collapse caused by exception object.
Wherein, the first kind can include SIGSEGV and SIGBUS.When SIGSEGV is to quote invalid address in codeThe collapse type of the collapse caused, the type of the collapse that SIGBUS causes when being and quote illegal address in code.
Step 202, obtains the first abnormality code information being scanned obtaining, the first abnormality code letter to item destination codeEach exception object of code error is there is in breath in indication item destination code.
In the present embodiment, server uses the code scans instrument preset to be scanned item destination code, scanning is tiedFruit is as the first abnormality code information.Wherein, server can first scan code, the first abnormality code information obtained is carried outCaching, reads the first abnormality code information again when getting exception stack information;Can also first obtain exception stack information, thenScan code obtains the first abnormality code information;Abnormal heap can also be obtained when scan code obtains the first abnormality code informationStack information, the present embodiment is not construed as limiting.
In the present embodiment, code that exception stack information is corresponding and code corresponding to the first abnormality code information need phaseWith, therefore, refer to Fig. 3, obtain the first abnormality code information being scanned item destination code obtaining, also include:
Step 2021, reads the project label that exception stack information is corresponding.
Project label is for identifying project during code scans, and project label can be that server creates the project time-divisionJoin, it is also possible to being server distribution when the project of issue, the present embodiment is not construed as limiting.Wherein, project label can beapp_id。
Step 2022, determines that in the first incidence relation the project key assignments corresponding with project label, the first incidence relation are usedIn the corresponding relation recorded between different project labels and different project key assignments.
Project key assignments is for identifying project during collapse reports, and project key assignments can be that server is when the project of establishmentDistribution, it is also possible to being server distribution when receiving the collapse object of terminal to report, the present embodiment is not construed as limiting.ItsIn, project key assignments can be project key.
In the present embodiment, user also needs to set up the first incidence relation for project label and project key assignments, abnormal to associateStack information and the first abnormality code information.Therefore, the first incidence relation determines the project key assignments corresponding with project labelBefore, also include: receive the configuration operation that user triggers when the first abnormality code information of the project of checking;Display includes projectThe configuration interface of project key assignments;Receive the project label that user inputs in configuration interface;By project key assignments and project labelCorrespondence is added in the first incidence relation.
Refer to Fig. 4, after code scans instrument obtains the first abnormality code information, server display configuration is different with firstThe configuration interface of the exception stack information that often code information is associated, now, configuration interface includes that this first abnormality code is believedThe project key assignments that breath is corresponding, also includes the input frame of project label, when user's cuit in this input frame in configuration interfaceMark, and when triggering association control, server sets up the first incidence relation of project key assignments and project label.
Optionally, configuration interface also includes the information such as project name, language form, version number, the most regularly association, itsIn, project name is used for described project, and language form is for the language of the code of described project, and version number is for described projectVersion, if whether timing associates the first abnormality code information and exception stack information for describing in fixed pattern association.
Step 2023, the item destination code indicated by key assignments of identifying project.
Step 2024, obtains the first abnormality code information being scanned obtaining to item destination code.
After item destination code is scanned by code scans instrument, the corresponding exception of every scanning result obtained is rightAs, and a scanning result includes exception object, type of error, line number etc..
In the present embodiment, after server gets the first abnormality code information, need the first abnormality code information is enteredRow is analyzed, so that it is determined that exception object.In one implementation, server is to all scannings in the first abnormality code informationResult is analyzed, to determine exception object.
Owing to some exception object can't cause collapse, and the collapse only caused by exception object could be by exploit personMember's amendment code is repaired, therefore, in order to avoid the exception object that can not cause collapse being analyzed wasted resource,In another kind of implementation, server is before being analyzed the first abnormality code, it is also possible to filters out and will not cause collapseThe scanning result of exception object.
Generally, it is possible to cause the exception object of collapse to have fixed type, server can be from the first abnormality code informationRead the type of error in all scanning results, the scanning result that type of error is Second Type is retained, to mistake classThe scanning result of the non-Second Type of type is deleted, and obtains exception stack information.That is, item destination code is scanned by acquisitionThe the first abnormality code information arrived, including: being scanned item destination code, obtaining type of error from scanning result is secondFirst abnormality code information of type, Second Type is the type of the exception object causing collapse.
Wherein, Second Type is relevant to the code speech of code.When code speech is C++, Second Type can includeNull pointer and crossing the border.Null pointer refers to that code pointer is not directed to significant internal memory, cross the border refer to code is not the mostThis pointer storage allocation space.When code speech is C#, Second Type can include that overflow exception, index range are abnormal and emptyQuote exception.Overflow exception refers to that the arithmetical operation conducted in the context chosen in code, type conversion or conversion operateCause overflowing, when index range refers to pass through index accesses data in code extremely, index beyond the index range set, emptyQuoting the content referring to quote in code is sky.
Step 203, according to exception stack information and the first abnormality code information, determine associated by each collapse object is differentOften object.
Refer to Fig. 5, according to exception stack information and the first abnormality code information, determine associated by each collapse objectException object, including:
Step 2031, extracts the first mark of each collapse object from exception stack information.
First mark is used for indicating collapse object.Such as, when collapse is to the function liked in file, the first mark is permissibleIt is filename and function name, it is also possible to be the first cryptographic Hash calculated according to filename and calculate according to function name secondCryptographic Hash, the present embodiment is not construed as limiting.
Specifically, from exception stack information, extract the first mark of each collapse object, including: read exception stack letterEvery stack information in breath, every stack information includes the n-layer information recorded in a storehouse of correspondence, and record in storehouseThe 0th layer of information be the information of collapse position object, in storehouse, the i+1 layer information of record is call i-th layer of object rightThe information of elephant, 0≤i≤n;For every stack information, in detection stack information, whether the object in jth layer information is that collapse is rightAs, when in jth layer information to as if during collapse object, read the first mark of object in jth layer information;When jth layer is believedWhen object in breath is not collapse object, j is updated to j+1, continues executing with the object in jth layer information in detection stack informationWhether it is the step collapsing object, 0≤j≤n.
As a example by stack information in step 201, #00 record is the 0th layer of information, and #01 record is the 1st layer of information,The like, #07 record is the 7th layer of information.Wherein, in example, one layer of information can include terminal type, memory address,File and function side-play amount hereof.Certainly, every layer of information can also include other information such as function, function parameter,The present embodiment is not construed as limiting.
Call relation is there is in stack information, i.e. i+1 layer information between i+1 layer object and i-th layer of object of recordIt is the information of the object calling i-th layer of object.
Such as, stack information have recorded 4 layers of information, respectively the 0th layer information, the 1st layer of information, the 2nd layer of information and the 3rd layerInformation.1st layer of information is the information of the object that have invoked the 0th layer of object, and the 2nd layer of information is to have invoked the object of the 1st layer of objectInformation, the 3rd layer of information is the information of the object that have invoked the 2nd layer of object.
When stack information is analyzed by server, first whether the object in the 0th layer of information of detection is collapse object, ifIn 0th layer of information to as if collapse object, then read this collapse object first mark, terminate analysis process;If the 0th layer of letterObject in breath is not collapse object, then whether the object in the 1st layer of information of detection is collapse object, if in the 1st layer of informationTo liking collapse object, then read the first mark of this collapse object, terminate analysis process;If the object in the 1st layer of information is notBe collapse object, then whether the object in the 2nd layer of information of detection is collapse object, and the rest may be inferred, until collapse object being detectedTill.
Wherein, whether when detecting object and being collapse object, server can detect whether object is to get specificallyThe object of code;When to as if when can get the object of specific code, determine this to as if collapse object;When object is notThe function of specific code can be got, such as, during to the function liked in function library, determine that this object is not collapse object.
During reality realizes, owing to the numerical value of i is the biggest, the object of i-th layer of object reference is the most, now, analyzes i-thThe reason of layer object collapse is the most complicated, and therefore, generally, server only analyzes the 0th layer of object and the 1st layer of object.
Step 2032, extracts the second mark of each exception object from the first abnormality code information.
Second mark is used for indicating exception object.Such as, when function during exception object is file, the second mark is permissibleIt is filename and function name, it is also possible to be the first cryptographic Hash calculated according to filename and calculate according to function name secondCryptographic Hash, the present embodiment is not construed as limiting.
Step 2033, when there is the first mark and the second mark that match, by right for the exception indicated by the second markAs being defined as the exception object associated by the collapse object indicated by the first mark.
With the second mark coupling, first mark refers to that the first mark is identical with the second mark, or, the Hash of the first markIt is worth identical with the cryptographic Hash of the second mark.Such as, the first mark is OnMoveNext (), and the second mark is OnMoveNext (),Then server determines that the first mark and the second mark match.
With the first mark and the second mark, the present embodiment all includes that filename and function name are to coupling the first mark and secondThe process of mark illustrates, and it is the most identical, at literary composition with the filename in the second mark that server can first detect the first markThe while of part famous prime minister, then it is the most identical with the function name in the second mark to detect the first mark, when function name is identical, determines firstMark and the second mark match.
Step 204, positions the position in code of the exception object associated by each collapse object.
Owing to exception object line number in code determines that, therefore, the exception associated by collapse object is being determinedAfter object, developer can be directly targeted to the code indicated by this line number, modifies this code, right to repair collapseAs.
Owing to server may orient the position in code of the exception object associated by multiple collapse object, and serviceDevice is probably repairs collapse object according to tab order prompting developer, and now, collapse object is entered by developer successivelyRow is repaired.Owing to the number of users of some collapse object influences is many, the number of users of some collapse object influences is few, therefore, and serverAccording to the number of users that collapse object is affected, collapse object can also be ranked up, to point out developer preferentially to repair impactThe collapse object that number of users is many, to ensure that most of user can normally use project, now performs step 205.
Step 205, for each collapse object, obtains the quantity of the terminal reporting collapse object.
Wherein, the quantity reporting the terminal of collapse object is the number of users of collapse object influences.
Step 206, according to the order that the quantity of the terminal reported is descending, is ranked up each collapse object.
Step 207, shows that the first information, the first information are used for pointing out the preferential reparation preceding collapse of sequence rightAs.
In one implementation, server can from the quantity of sequence the selected and sorted quantity in front n position, and generateFor indicating the first information of collapse object corresponding to every kind of quantity.Wherein, n is positive integer, and such as, n is 10,50,100Etc..
Such as, the quantity reporting the terminal of collapse object 1 is 500, and the quantity reporting the terminal of collapse object 2 is 1500,The quantity reporting the terminal of collapse object 3 is 2500, and the quantity reporting the terminal of collapse object 4 is 2000, and n is 2, then serviceDevice generates for indicating collapse object 3 and the first information of collapse object 4.
In the present embodiment, server can also there may be in project according to the exception object associated by collapse objectCollapse object be predicted, with reduce collapse probability of happening, improve code quality.Now, each collapse object is being positionedAfter associated exception object position in code, also include: obtain what the code to sundry item was scanned obtainingSecond abnormality code information, to there is each of code error in the code of sundry item different for indicating for the second abnormality code informationOften object;The second incidence relation according to the collapse object determined in project with exception object, it was predicted that will in each exception objectCause the exception object of collapse;Show the second information, for pointing out to repair, the second information predicts that the exception obtained is rightAs.
Such as, collapsing object 1 and associate with exception object 1 in project 1, now, the second incidence relation includes collapsing object 1With the incidence relation of exception object 1, then, after determining exception object 1 in project 2, server can be according to the second incidence relationDoping exception object 1 and may cause collapse, and the object of collapse is probably collapse object 1, now, server prompts is developedCollapse object 1 is repaired by personnel.
Certainly, server can also extract the general character between each exception object causing collapse, when from sundry itemWhen scanning the exception object with general character, then predict that this has the collapse object of the exception object of general character association, pre-to improveThe accuracy surveyed.
In the present embodiment, refer to Fig. 6, server can include bugly server, TSC match server, and TSC scansServer, TSC web page server, and TSC match server respectively with bugly server, TSC scanning server, TSC webpage clothesBusiness device is connected.Wherein, bugly server is the background server of bugly platform, and bugly platform is the different of reception terminal to reportThe often platform of stack information, TSC scanning server is the background server of TSC scanning platform, and TSC scanning platform is to useTscanCode (code scans instrument) is scanned the platform of the first abnormality code information that obtains to item destination code, and TSC matesServer is the server mating exception object information and the first abnormality code information, TSC web page server be forShow the server of the association of collapse object and exception object.
Refer to Fig. 7, it illustrates a kind of schematic diagram that collapse object associates with exception object, wherein, aobvious in region 701Show is collapse object, is shown that collapsing the exception object of object association in region 702.
In sum, the collapse localization method of the code that the embodiment of the present invention provides, by obtaining exception stack information, shouldEach collapse object that exception stack information reports during running item destination code for indicating each terminal;It is right to obtainItem destination code is scanned the first abnormality code information obtained, and this first abnormality code information is used for indication item destination codeMiddle each exception object that there is code error;According to exception stack information and the first abnormality code information, determine each collapseException object associated by object;Position the position in code of the exception object associated by each collapse object, so, will collapseObject of bursting is associated with exception object, it is determined that the exception object being associated with collapse object position in code, solvesCode content is more and causes the relatively low problem of the collapse location efficiency of code, has reached to improve the collapse location efficiency of codeEffect.
The quantity of the terminal of collapse object is reported by acquisition;According to the order that the quantity of the terminal reported is descending,Each collapse object is ranked up;Show that the first information, the first information are used for pointing out preferential reparation to sort frontCollapse object, developer can be pointed out preferentially to repair the collapse object that the terminal quantity reported is big, with ensure great majority useFamily can normally use project.
By obtaining the second abnormality code information that the code to sundry item is scanned obtaining;Determine according in projectThe second incidence relation of collapse object and exception object, it was predicted that each exception object will cause the exception object of collapse;AobviousShowing the second information, the second information repairs, for pointing out, the exception object that prediction obtains, as such, it is possible to according to scanningException object predict the collapse object that may exist, to point out developer to repair this collapse object in advance, it is to avoid collapseThe generation burst, to improve code quality.
Refer to Fig. 8, it illustrates the structured flowchart of the collapse positioner of the code that one embodiment of the invention provides.The collapse positioner of this code can apply in server, the collapse positioner of this code, including:
Stack information acquisition module 810, is used for obtaining exception stack information, and exception stack information is used for indicating each terminalEach collapse object reported during running item destination code, collapses liking the object causing collapse in code;
First information acquisition module 820, for obtaining the first abnormality code letter being scanned obtaining to item destination codeBreath, there is each exception object of code error in the first abnormality code information in indication item destination code;
Exception object determines module 830, for the exception stack information obtained according to stack information acquisition module 810 and theThe first abnormality code information that one data obtaining module 820 obtains, determines the exception object associated by each collapse object;
For positioning the exception object associated by each collapse object, exception object locating module 840, determines that module 830 is trueFixed exception object position in code.
In sum, the collapse positioner of the code that the embodiment of the present invention provides, by obtaining exception stack information, shouldEach collapse object that exception stack information reports during running item destination code for indicating each terminal;It is right to obtainItem destination code is scanned the first abnormality code information obtained, and this first abnormality code information is used for indication item destination codeMiddle each exception object that there is code error;According to exception stack information and the first abnormality code information, determine each collapseException object associated by object;Position the position in code of the exception object associated by each collapse object, so, will collapseObject of bursting is associated with exception object, it is determined that the exception object being associated with collapse object position in code, solvesCode content is more and causes the relatively low problem of the collapse location efficiency of code, has reached to improve the collapse location efficiency of codeEffect.
Refer to Fig. 9, it illustrates the structured flowchart of the collapse positioner of the code that yet another embodiment of the invention provides.The collapse positioner of this code can apply in server, the collapse positioner of this code, including:
Stack information acquisition module 910, is used for obtaining exception stack information, and exception stack information is used for indicating each terminalEach collapse object reported during running item destination code, collapses liking the object causing collapse in code;
First information acquisition module 920, for obtaining the first abnormality code letter being scanned obtaining to item destination codeBreath, there is each exception object of code error in the first abnormality code information in indication item destination code;
Exception object determines module 930, for the exception stack information obtained according to stack information acquisition module 910 and theThe first abnormality code information that one data obtaining module 920 obtains, determines the exception object associated by each collapse object;
For positioning the exception object associated by each collapse object, exception object locating module 940, determines that module determinesException object position in code.
Optionally, exception object determines module 930, including:
First marker extraction unit 931, for extracting the first mark of each collapse object from exception stack information;
Second marker extraction unit 932, for extracting the second mark of each exception object from the first abnormality code informationKnow;
Exception object determines unit 933, for when there is the first mark that the first marker extraction unit 931 matched extractsWhen knowing the second mark extracted with the second marker extraction unit 932, the exception object indicated by the second mark is defined as firstThe collapse indicated by mark exception object associated by object.
Optionally, the first marker extraction unit 931, it is additionally operable to:
Reading every stack information in exception stack information, every stack information includes record in a corresponding storehouseN-layer information, and in storehouse, the 0th layer of information of record is the information of collapse position object, the i+1 layer letter of record in storehouseBreath is the information of the object calling i-th layer of object, 0≤i≤n;
For every stack information, in detection stack information, whether the object in jth layer information is collapse object, works as jthIn layer information to as if during collapse object, read the first mark of object in jth layer information;Right when in jth layer informationDuring as not being collapse object, j being updated to j+1, whether the object continued executing with in detection stack information in jth layer information collapsesThe step of routed object, 0≤j≤n.
Optionally, stack information acquisition module 910, it is additionally operable to obtain the exception stack letter that collapse type is the first kindBreath, the first kind is the type of the collapse caused by exception object;
First information acquisition module 920, is additionally operable to be scanned item destination code, obtains mistake class from scanning resultType is the first abnormality code information of Second Type, and Second Type is the type of the exception object causing collapse.
Optionally, device also includes:
Report quantity acquisition module 950, for for each collapse object, obtaining the number of the terminal reporting collapse objectAmount;
Collapse object order module 960, for according to the terminal reported reporting quantity acquisition module to obtain quantity byBig to little order, each collapse object is ranked up;
First prompting display module 970, for display the first information, the first information is used for pointing out preferential reparationSort preceding collapse object.
Optionally, first information acquisition module 920, including:
Project key assignments reads unit 921, for reading the project key assignments that exception stack information is corresponding;
Project label determines unit 922, for determining that in the first incidence relation reading unit 921 with project key assignments readsThe project label answered of project key-value pair, the first incidence relation for record different project key assignments and different project labels itBetween corresponding relation;
Item code determines unit 923, and for identifying project, mark determines indicated by the project label that unit 922 determinesItem destination code;
To item code, first information acquiring unit 924, determines that the item destination code that unit 923 determines is carried out for obtainingThe first abnormality code information that scanning obtains.
Optionally, first information acquisition module 920, also include:
Configuration operation receives unit 925, for receiving the configuration that user triggers when the exception stack information of the project of checkingOperation;
Configuration interface display unit 926, includes the configuration interface of the project key assignments of project for display;
Project label receives unit 927, for receiving the project label that user inputs in configuration interface;
Incidence relation adding device 928, for connecing project key assignments and the project label of configuration interface display module configurationThe project label correspondence receiving module reception is added in the first incidence relation.
Optionally, device also includes:
Second data obtaining module 980, for obtaining the second abnormal generation that the code to sundry item is scanned obtainingCode information, there is each exception object of code error in the second abnormality code information in the code indicating sundry item;
Exception object prediction module 990, for associating with the second of exception object according to the collapse object determined in projectRelation, it was predicted that the exception object of collapse will be caused in each exception object;
Second prompting display module 991, for display the second information, the second information is used for pointing out reparation predictionThe exception object obtained.
In sum, the collapse positioner of the code that the embodiment of the present invention provides, by obtaining exception stack information, shouldEach collapse object that exception stack information reports during running item destination code for indicating each terminal;It is right to obtainItem destination code is scanned the first abnormality code information obtained, and this first abnormality code information is used for indication item destination codeMiddle each exception object that there is code error;According to exception stack information and the first abnormality code information, determine each collapseException object associated by object;Position the position in code of the exception object associated by each collapse object, so, will collapseObject of bursting is associated with exception object, it is determined that the exception object being associated with collapse object position in code, solvesCode content is more and causes the relatively low problem of the collapse location efficiency of code, has reached to improve the collapse location efficiency of codeEffect.
The quantity of the terminal of collapse object is reported by acquisition;According to the order that the quantity of the terminal reported is descending,Each collapse object is ranked up;Show that the first information, the first information are used for pointing out preferential reparation to sort frontCollapse object, developer can be pointed out preferentially to repair the collapse object that the terminal quantity reported is big, with ensure great majority useFamily can normally use project.
By obtaining the second abnormality code information that the code to sundry item is scanned obtaining;Determine according in projectThe second incidence relation of collapse object and exception object, it was predicted that each exception object will cause the exception object of collapse;AobviousShowing the second information, the second information repairs, for pointing out, the exception object that prediction obtains, as such, it is possible to according to scanningException object predict the collapse object that may exist, to point out developer to repair this collapse object in advance, it is to avoid collapseThe generation burst, to improve code quality.
It should be understood that the collapse positioner of the code of above-described embodiment offer positions in the collapse carrying out codeTime, only it is illustrated with the division of above-mentioned each functional module, in actual application, can as desired above-mentioned functions be dividedJoin and completed by different functional modules, will code collapse positioner internal structure be divided into different functional modules,To complete all or part of function described above.It addition, the collapse positioner of the code of above-described embodiment offer and generationThe collapse localization method embodiment of code belongs to same design, and it implements process and refers to embodiment of the method, repeats no more here.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can pass through hardwareCompleting, it is also possible to instruct relevant hardware by program and complete, described program can be stored in a kind of computer-readableIn storage medium, storage medium mentioned above can be read only memory, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all spirit in the present invention andWithin principle, any modification, equivalent substitution and improvement etc. made, should be included within the scope of the present invention.

Claims (16)

CN201610619744.0A2016-07-292016-07-29The collapse localization method and device of codeActiveCN106294134B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201610619744.0ACN106294134B (en)2016-07-292016-07-29The collapse localization method and device of code

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201610619744.0ACN106294134B (en)2016-07-292016-07-29The collapse localization method and device of code

Publications (2)

Publication NumberPublication Date
CN106294134Atrue CN106294134A (en)2017-01-04
CN106294134B CN106294134B (en)2018-02-23

Family

ID=57663960

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201610619744.0AActiveCN106294134B (en)2016-07-292016-07-29The collapse localization method and device of code

Country Status (1)

CountryLink
CN (1)CN106294134B (en)

Cited By (18)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107168881A (en)*2017-06-072017-09-15成都四象联创科技有限公司Code positioning and processing method extremely
CN107506256A (en)*2017-09-072017-12-22北京京东尚科信息技术有限公司A kind of method and apparatus of crash data monitoring
CN108132850A (en)*2017-12-222018-06-08北京比特大陆科技有限公司Code location method, apparatus and electronic equipment
CN108170609A (en)*2018-01-112018-06-15五八有限公司Localization method, device, computer equipment and the readable storage medium storing program for executing of program bug
CN108647106A (en)*2018-05-112018-10-12深圳市腾讯网络信息技术有限公司Using abnormality eliminating method, storage medium and computer equipment
WO2019029627A1 (en)*2017-08-102019-02-14广州神马移动信息科技有限公司Webpage abnormality monitoring method, device and system, computing device and storage medium
CN109445973A (en)*2018-09-262019-03-08中国平安人寿保险股份有限公司Position the method and device of application crash
CN109491923A (en)*2018-12-142019-03-19东软集团股份有限公司Determination method, apparatus, medium and the electronic equipment of newly-increased abnormality code
CN109800100A (en)*2018-12-252019-05-24福建天晴在线互动科技有限公司A kind of method and terminal for preventing IOS project from collapsing
CN110413509A (en)*2019-06-272019-11-05武汉大学 A software crash reproduction method and system based on test generation
CN110795259A (en)*2018-08-012020-02-14北京京东尚科信息技术有限公司Method and device for analyzing application collapse
CN110908819A (en)*2018-09-172020-03-24千寻位置网络有限公司Method and device for locating code operation crash, terminal and memory
CN111367796A (en)*2020-02-262020-07-03浪潮通用软件有限公司Application program debugging method and device
CN112882943A (en)*2021-03-112021-06-01腾讯音乐娱乐科技(深圳)有限公司Interface updating collapse risk detection method and device, electronic equipment and storage medium
CN114138533A (en)*2021-12-022022-03-04深圳市优必选科技股份有限公司Intelligent fault analysis method and device, cloud platform and readable storage medium
CN114490368A (en)*2022-01-192022-05-13上海驻云信息科技有限公司Method for filtering user-defined Python script function call stack
CN114528201A (en)*2021-11-162022-05-24平安银行股份有限公司Abnormal code positioning method, device, equipment and medium
CN114756272A (en)*2021-01-082022-07-15北京字跳网络技术有限公司 Method, system, device, device and storage medium for processing faulty components

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102768639A (en)*2012-06-112012-11-07北京奇虎科技有限公司 Method and device for locating operating system kernel-level errors
CN103164322A (en)*2013-04-152013-06-19腾讯科技(深圳)有限公司Signature method and signature device for program crashing
CN105224463A (en)*2015-10-282016-01-06南京大学A kind of software defect Code location method based on collapse stack data

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102768639A (en)*2012-06-112012-11-07北京奇虎科技有限公司 Method and device for locating operating system kernel-level errors
CN103164322A (en)*2013-04-152013-06-19腾讯科技(深圳)有限公司Signature method and signature device for program crashing
CN105224463A (en)*2015-10-282016-01-06南京大学A kind of software defect Code location method based on collapse stack data

Cited By (23)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107168881A (en)*2017-06-072017-09-15成都四象联创科技有限公司Code positioning and processing method extremely
WO2019029627A1 (en)*2017-08-102019-02-14广州神马移动信息科技有限公司Webpage abnormality monitoring method, device and system, computing device and storage medium
CN107506256A (en)*2017-09-072017-12-22北京京东尚科信息技术有限公司A kind of method and apparatus of crash data monitoring
CN108132850A (en)*2017-12-222018-06-08北京比特大陆科技有限公司Code location method, apparatus and electronic equipment
CN108132850B (en)*2017-12-222021-06-01蚂蚁矿池科技有限公司 Code positioning method, device and electronic device
CN108170609A (en)*2018-01-112018-06-15五八有限公司Localization method, device, computer equipment and the readable storage medium storing program for executing of program bug
CN108647106A (en)*2018-05-112018-10-12深圳市腾讯网络信息技术有限公司Using abnormality eliminating method, storage medium and computer equipment
CN110795259A (en)*2018-08-012020-02-14北京京东尚科信息技术有限公司Method and device for analyzing application collapse
CN110908819A (en)*2018-09-172020-03-24千寻位置网络有限公司Method and device for locating code operation crash, terminal and memory
CN110908819B (en)*2018-09-172023-07-04千寻位置网络有限公司Method and device for locating code operation breakdown, terminal and memory
CN109445973A (en)*2018-09-262019-03-08中国平安人寿保险股份有限公司Position the method and device of application crash
CN109491923A (en)*2018-12-142019-03-19东软集团股份有限公司Determination method, apparatus, medium and the electronic equipment of newly-increased abnormality code
CN109800100A (en)*2018-12-252019-05-24福建天晴在线互动科技有限公司A kind of method and terminal for preventing IOS project from collapsing
CN109800100B (en)*2018-12-252023-02-28福建天晴在线互动科技有限公司Method and terminal for preventing IOS project from being crashed
CN110413509B (en)*2019-06-272021-08-03武汉大学Software crash reproduction method and system based on test generation
CN110413509A (en)*2019-06-272019-11-05武汉大学 A software crash reproduction method and system based on test generation
CN111367796A (en)*2020-02-262020-07-03浪潮通用软件有限公司Application program debugging method and device
CN111367796B (en)*2020-02-262023-06-16浪潮通用软件有限公司Application program debugging method and device
CN114756272A (en)*2021-01-082022-07-15北京字跳网络技术有限公司 Method, system, device, device and storage medium for processing faulty components
CN112882943A (en)*2021-03-112021-06-01腾讯音乐娱乐科技(深圳)有限公司Interface updating collapse risk detection method and device, electronic equipment and storage medium
CN114528201A (en)*2021-11-162022-05-24平安银行股份有限公司Abnormal code positioning method, device, equipment and medium
CN114138533A (en)*2021-12-022022-03-04深圳市优必选科技股份有限公司Intelligent fault analysis method and device, cloud platform and readable storage medium
CN114490368A (en)*2022-01-192022-05-13上海驻云信息科技有限公司Method for filtering user-defined Python script function call stack

Also Published As

Publication numberPublication date
CN106294134B (en)2018-02-23

Similar Documents

PublicationPublication DateTitle
CN106294134A (en)The collapse localization method of code and device
Xiao et al.Iconintent: automatic identification of sensitive ui widgets based on icon classification for android apps
CN107193750B (en)Script recording method and device
CN104484273B (en)The method of testing of application program, equipment and system
CN108628751B (en)Useless dependency item detection method and device
US10409892B2 (en)Formatting data by example
CN104657140B (en)Code generating method and device
CN113515271B (en)Service code generation method and device, electronic equipment and readable storage medium
CN107133174A (en)Test case code automatically generating device and method
CN109871319A (en)Item code scan method, device, computer equipment and storage medium
US20150089415A1 (en)Method of processing big data, apparatus performing the same and storage media storing the same
CN108459964A (en)Test cases selection method, apparatus, equipment and computer readable storage medium
CN104899016A (en)Call stack relationship obtaining method and call stack relationship obtaining device
CN107807841B (en)Server simulation method, device, equipment and readable storage medium
CN113204345A (en)Page generation method and device, electronic equipment and storage medium
CN111258875A (en)Interface test method and system, electronic device and storage medium
CN113392014A (en)Test case generation method and device, electronic equipment and medium
CN116484131A (en)Buried point processing method and device
CN106446064A (en)Data conversion method and device
CN108563578A (en)SDK compatibility detection method, device, equipment and readable storage medium
CN115481025A (en)Script recording method and device for automatic test, computer equipment and medium
CN110968513B (en)Recording method and device of test script
CN110764745B (en)Variable transmission and collection method, device and computer readable storage medium
CN113805861B (en)Code generation method based on machine learning, code editing system and storage medium
CN104142885A (en)Method and device for carrying out abnormality test on tested program

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant
TR01Transfer of patent right
TR01Transfer of patent right

Effective date of registration:20230919

Address after:518057 Tencent Building, No. 1 High-tech Zone, Nanshan District, Shenzhen City, Guangdong Province, 35 floors

Patentee after:TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.

Patentee after:TENCENT CLOUD COMPUTING (BEIJING) Co.,Ltd.

Address before:2, 518000, East 403 room, SEG science and Technology Park, Zhenxing Road, Shenzhen, Guangdong, Futian District

Patentee before:TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.


[8]ページ先頭

©2009-2025 Movatter.jp