CN102937934B - Telemetry is caught by dynamic language engine - Google Patents

Telemetry is caught by dynamic language engine Download PDF

Info

Publication number
CN102937934B
CN102937934B CN201210480034.6A CN201210480034A CN102937934B CN 102937934 B CN102937934 B CN 102937934B CN 201210480034 A CN201210480034 A CN 201210480034A CN 102937934 B CN102937934 B CN 102937934B
Authority
CN
China
Prior art keywords
script
stack
code
action
engine
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.)
Active
Application number
CN201210480034.6A
Other languages
Chinese (zh)
Other versions
CN102937934A (en
Inventor
J·A·汉米尔顿
G·塞思
Y·屈
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.)
Microsoft Technology Licensing LLC
Original Assignee
Microsoft Technology Licensing LLC
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 Microsoft Technology Licensing LLC filed Critical Microsoft Technology Licensing LLC
Publication of CN102937934A publication Critical patent/CN102937934A/en
Application granted granted Critical
Publication of CN102937934B publication Critical patent/CN102937934B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/366Software debugging using diagnostics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45529Embedded in an application, e.g. JavaScript in a Web browser
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0709Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a distributed system consisting of a plurality of standalone computer nodes, e.g. clusters, client-server systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0748Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a remote unit communicating with a single-box computer node experiencing an error/fault
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • G06F11/0778Dumping, i.e. gathering error/state information after a fault for later diagnosis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/481Exception handling

Abstract

The present invention relates to catch telemetry by dynamic language engine.At least one embodiment described here relates to optionally catching the script code stack that the exception dished out with scripted code is associated.For undressed exception, script engine 1) in the way of host accessible, catch script code stack, by the way of this host accessible, the main frame hosting script engine can access caught script code stack, 2) expansion of script stack, and 3 are completed) to the script code stack that caught of host report hosting script engine.For at least one (scripted code self processes this exception) in the treated exception that scripted code is dished out, do not catch script code stack in host accessible mode.Equally, in the time of dishing out rather than at the call stack attribute creating time fill-error object.

Description

Telemetry is caught by dynamic language engine
Technical field
The present invention relates to catch the technology of telemetry, particularly relate to seizure multiple with what scripted code was dished out The technology of the script code stack being extremely associated.
Background technology
When developing software, catching the telemetry intelligence (TELINT) relevant with unexpected behavior when performing this software is to have side Help.The example of such telemetry intelligence (TELINT) includes function stack information.Such telemetry intelligence (TELINT) can the person of being developed be used Remove unexpected behavior thus to improve the quality of software.
Extraction to the telemetry intelligence (TELINT) of relevant script applications (such as, website or web application) is choosing of difficulty War, because such script applications operates in the hosted environment of such as operating system or browser etc.Open Originator uses extension and/or indirect script feature to extract and to process these in their user's script Information.This not the most well works under all scenes.Additionally, there is not permission main frame with host-specific Mode carry out Proterozoic and treat the easy way of this information.
Summary of the invention
At least one embodiment described here relates to optionally catching the exception dished out with scripted code The script code stack being associated.At least one undressed exception (script that scripted code is dished out Code does not process this exception), script engine: 1) in the way of host accessible, catch script code stack, Caught script code stack can be accessed by the main frame of which master control script engine, 2) complete script The expansion of stack, 3) script code stack caught to the host report of master control script engine.For script generation At least one treated exception (scripted code oneself is to process this exception) that code is dished out, the most not with master The addressable mode of machine catches script code stack.Therefore, the most later in the case of, with catch script Code stack makes this script code stack be accessible to hosts the expense being associated can be saved.
At least one embodiment described here relates to the execution of user's script, wherein can have and be associated not The error object filling call stack attribute is created.Scripted code dished out be associated with error object different Chang Hou, script code stack is captured in the time of dishing out and is used for the call stack attribute of fill-error object.By Being to be filled in the time of dishing out rather than the establishment time of error object in call stack attribute, therefore call stack belongs to Property with help assessment dish out the time exist dynamic binding more relevant.
There is provided present invention to introduce in simplified form and retouching the most further Some concepts stated.Present invention is not intended as identifying key feature or necessity of theme required for protection Feature, is intended to be used to assist in the scope of theme required for protection.
Accompanying drawing explanation
In order to describe the mode being obtained in that above and other advantages and feature, more specifically retouching of each embodiment State and present with reference to each accompanying drawing.It is appreciated that these accompanying drawings depict only example embodiment, and Therefore it is not considered limiting of its scope, by using accompanying drawing and supplementary features and details will be utilized to retouch State and explain each embodiment, in the accompanying drawings:
Fig. 1 shows the exemplary computing system that can be used to utilize embodiments described herein;
Fig. 2 illustrates and can be realized and include hosted environment and the ring of script edit environment by the calculating system of Fig. 1 Border;
Fig. 3 shows for optionally catching dished out with scripted code different in the way of host accessible The flow chart of the method for the script code stack being often associated;
Fig. 4 shows the flow chart of the method for catching script code stack when exception throws;And
Fig. 5 illustrate abstractively include dishing out conditional attribute and meet dish out condition time rather than to create mistake right As time the error object data structure of stack attribute filled.
Detailed description of the invention
According to each embodiment described here, at least one embodiment described here relates to optionally catching The script code stack that the exception dished out with scripted code is associated.For undressed exception, script draws Hold up 1) catch script code stack in host accessible mode, by this host accessible mode, master control script The script code stack that the host accessible of engine is caught, 2) expansion of script stack, and 3 are completed) to master The script code stack that the host report of control script engine is caught.For scripted code dished out treated At least one (scripted code self has processed this exception) in exception, does not comes in the non-mode of host accessible Catch script code stack.Equally, in embodiments more described here, error object is by user's foot Original establishment.The call stack attribute of error object was filled in the time of dishing out rather than establishment time.First First, some the introductory discussion about the system of calculating will be described with reference to Figure 1.Then, will be referring to figs. 2 to 5 describe the embodiment catching script code stack.
First, it is described with reference to Figure 1 the introductory discussion about the system of calculating.Calculating system is the most increasingly How to take diversified form.Such as, calculating system can be portable equipment, electrical equipment, on knee Computer, desk computer, large scale computer, distributed computing system or the most conventionally be not qualified as calculate The equipment of system.In this description and in the claims, term " calculating system " is broadly defined For including any equipment or system (or combinations thereof), it is tangible that this equipment or system comprise at least one physics Processor and can be containing tangible the depositing of physics of computer executable instructions that can be performed by processor on it Reservoir.Memorizer can be to take any form, it is possible to depends on characteristic and the form of calculating system.Calculate System can be distributed in a network environment, and can include multiple calculation system.
As it is shown in figure 1, in the configuration that it is most basic, calculating system 100 generally includes at least one and processes Unit 102 and memorizer 104.Memorizer 104 can be physical system memory, and this physical system stores Device can be volatibility, non-volatile or some combination of the two.Term " memorizer " also can be used at this Refer to the non-volatile mass storage storages such as such as physical storage medium.If calculating system is distributed, then Process, memorizer and/or storage capacity can also be distributed.The most like that, term " mould Block " or " assembly " software object or the routine that perform on a computing system can be referred to.Described herein not Same assembly, module, engine, and service can be implemented as the object or the process (example that perform on a computing system As, as separate thread).
In the description that follows, with reference to each enforcement of action description performed by one or more calculating systems Example.If such action is implemented in software, then one of the calculating system that is associated of execution action or Multiple processors are in response to having been carried out computer executable instructions to guide the operation of calculating system.So The example of operation relate to the manipulation to data.Computer executable instructions (and the data being manipulated by) can To be stored in the memorizer 104 of calculating system 100.Calculating system 100 also can comprise permission calculating system 100 communication channels 108 such as communicated with other message handling devices by network 110.
Each embodiment described herein can include or utilize special or general purpose computer, this special or general-purpose computations Machine includes the computer hardwares such as the most one or more processor and system storage, as more fully below Discuss.Each embodiment described herein also includes for carrying or store computer executable instructions and/or number Physics and other computer-readable mediums according to structure.Such computer-readable medium can be can be by general Or any usable medium that dedicated computer system accesses.The computer-readable of storage computer executable instructions Medium is physical storage medium.The computer-readable medium of load capacity calculation machine executable instruction is transmission medium. Thus, unrestricted as example, various embodiments of the present invention can include the calculating that at least two is dramatically different Machine computer-readable recording medium: computer-readable storage medium and transmission medium.
Computer-readable storage medium include RAM, ROM, EEPROM, CD-ROM or other optical disc storage, Disk storage or other magnetic storage apparatus or can be used for storing computer executable instructions or data structure form Required program code devices and any other medium that can be accessed by universal or special computer.In this explanation In book and claims, " computer program " includes having computer executable instructions thereon One or more computer-readable storage mediums, when these computer executable instructions by the one of computer system or When multiple processors perform, perform the function of computer program.
" network " is defined as allowing to pass between computer system and/or module and/or other electronic equipments One or more data link of transmission of electricity subdata.When information (is connected firmly by network or another communication connection Line, wireless or hardwired or wireless combination) when transmitting or be supplied to computer, this computer should Connect and be properly viewed as transmission medium.Transmission medium can include can be used for carrying computer executable instructions or number According to the required program code devices of version and the network that can be accessed by universal or special computer and/or number According to link.Combinations of the above also should be included within the scope of computer readable media.
Additionally, after arriving various computer system components, computer executable instructions or data structure shape The program code devices of formula can be automatically transferred to computer-readable storage medium (or vice versa as the same) from transmission medium. Such as, the computer executable instructions received by network or data link or data structure can be buffered in In RAM in Network Interface Module (such as, " NIC "), then it is ultimately transmitted to computer system The computer-readable storage medium of the less volatibility of RAM and/or computer systems division.Accordingly, it should be understood that Computer-readable storage medium can be included in the computer system also utilizing (or mainly utilizing) transmission medium In assembly.
Computer executable instructions such as includes, makes general purpose computer, special meter when performing at processor Calculation machine or dedicated treatment facility perform a certain function or the instruction and data of certain group function.Computer can perform Instruction can be intermediate format instructions or even source generation of such as binary code, such as assembler language etc Code.Although the language special by architectural feature and/or method action describes this theme, it is to be understood that, institute Theme defined in attached claims is not necessarily limited to features described above or action.On the contrary, features described above and action It is as realizing the exemplary forms of claim and disclosed.
It will be apparent to one skilled in the art that the present invention can have the most eurypalynous computer system configurations Network computing environment in put into practice, these computer system configurations include personal computer, desk computer, Laptop computer, message handling device, portable equipment, multicomputer system, based on microprocessor or Programmable consumer electronic device, network PC, minicomputer, mainframe computer, mobile phone, PDA, Pager, router, switch etc..The present invention also can pass through network linking wherein (or by hard Line data link, wireless data link, or by hardwired and the combination of wireless data link) basis Ground and remote computer system both perform to implement in the distributed system environment of task.In distributed system In environment, program module may be located in local and remote both memory storage device.
The environment 200 that the principle described herein that shows Fig. 2 can work wherein.Environment 200 can Realize with the calculating system by the calculating system 100 of such as Fig. 1 etc.Environment 200 includes hosted environment 201 and script edit environment 202.
Script edit environment 202 includes script engine 221, this script engine 221 can operationally read, Understand and perform script (such as, user's script 222).Most typically ground, script engine 221 understands basis The scripted code that particular script language is write.ECMAScript (ECMA script) is showing of script Example, but there are the many scripts that there is currently and principle described here is not even limited to currently to deposit Script.Many scripts are to there is not clearly defined type system and generally only exist The dynamic language of definition binding during operation.Depend on this realization, script engine 221 can perform compiling and/ Or explain, in order to understand user's script 222 rightly and calculating system (such as, calculating system 100) is provided The suitable machine code that performs of processor (such as, processor 102).
Hosted environment 201 includes the main frame 211 of the environment providing script engine 221 to run wherein.Script Border between environment 202 and hosted environment 201 is represented abstractively by barrier 203.The example of main frame 211 can Can be operating system or browser, but main frame 211 can be can any group of master control script environment 202 Part, application, system or a combination thereof.
In particular, main frame 211 carrys out master control script by retaining the control to performing the most when executed at script Environment.But, when main frame 211 runs into script, script is supplied to script engine 221 by main frame 211, And the control performed will be passed to script engine 221.When script engine 221 completes to process, script Execution control is passed back to main frame 211 by engine 211.As the result of execution script, main frame 211 is also from foot This engine 221 receives notice.Such as, some in those notices can be error message, and it may result in Throw exception in main frame 211.Other kinds of notice relates to the output of the normal operating of script.Main frame 211 To have the object model of their own, and the input that script performs can affect the object model at main frame 211 Middle establishment or filled object.
Although it need not, situation is the most all such, i.e. main frame 211 may also perform Such as user waits other functions alternately.Such as, main frame can via graphical interfaces and/or other input equipments by Graphical interfaces is shown to user and receives the input from user.
Main frame 211 may be that some function being harmful to come for performing script also by preventing execution code from performing Safe barrier is provided, because script is typically the code being externally received in the system of calculating, and can be by Multiple creators of various technology and intention create.Main frame 211 is perhaps also through filtering the institute that script is made There is request to ascertain whether to fulfil this request to provide safety.In some cases, perhaps the continuing of script Execution may be ascertained to be harmful, and in this case, main frame 211 can promote script engine 221 by right The execution of script 222 stops completely.
The operation of main frame 211, script engine 221 and user's script 222 can by calculate system in response to One or more processors (such as, processor 102) of calculating system (such as, calculating system 100) Perform to be present in one or more computer-readable mediums (such as, the computer representing computer program Storage medium) on computer executed instructions and perform.
With reference to the flow chart in Fig. 3 and Fig. 4, other references in Fig. 2, Fig. 3 and Fig. 4 will be described The environment 200 describing Fig. 2 causes the possibility in the case of being extremely spilled in the execution of scripted code 222 Operation.Therefore, the existing environment 200 by reference Fig. 2 continually describes Fig. 3 and Fig. 4.
Fig. 3 shows for optionally catching the script that the multiple exceptions dished out with scripted code are associated The flow chart of the method 300 of code stack.Such as, method 300 can be held by the script engine 221 of Fig. 2 OK.Shown method 300 starts from script engine and performs user's script (action 301).Such as, at figure In 2, script engine 221 performs user's script 222.
User's script throw exception subsequently (action 302).Extremely it is by partially in the normal operating of user's script From time be spilled over.In some cases, this might mean that the execution of user's script should terminate.Existence can Multiple reasons of throw exception, even and if sub-fraction in this enumerates these reasons be also unrealistic 's.But, some examples are probably user's script and attempt accessing property value or the use that there is not any value Family script attempts accessing disabled system resource or user's script is attempted solving to there is the most defined solution The certainly problem of scheme.
Especially when user's script is in exploitation, the execution of user's script may usually can throw exception.Distant Measurement information is the information of the operation about calculating system.Intelligent remote measuring system can be when application be in exploitation With application is deployed and differentiates between when using.Principle described here allows the creation of user's script Person collects the telemetry intelligence (TELINT) of the operation about calculating system so that creator can: determine abnormal being spilled over Reason, correction user's script cause any mistake of this exception and retry the execution of this scripted code. By repeating this process, user's script can be modified and improve, and contributes to being deployed in terminal by improvement Website and the reliability of web application on user's machine improve end-user experience.Collectable remote measurement is believed The example of breath includes the sample of user's script call stack (being also referred to as " script stack " at this).In some feelings Under condition, extremely can scripted code the term of execution be spilled over repeatedly, in this case, no matter when meet To abnormal, method 300 all can start to repeat forward from action 302.
In this manual, term "abnormal" will be construed broadly, unless the clearest and the most definite earth's surface Bright it includes that any of script performs the wrong form of expression.In some cases, extremely may be behaviour Make system occurs, but in any case as long as user's script shows that mistake there occurs, be then extremely spilled over, This is among implication described here.Such as, in certain embodiments, exception is probably and is existed by user's script The error condition of the error object being previously created is dished out when being satisfied.Fig. 5 illustrates error object abstractively The data structure of 500.Error object includes the condition 501 representing the condition of dishing out.If dished out condition once by Meet, then error object is spilled at that time.Such as, in ECMA script, there is the general of error object Reading, it is the standard object can with the error condition being associated, and this error condition being associated describes this Error object will be considered the situation being spilled over.
Other process of method 300 can be depending on and the most not processed or by user's script by user's script Process (decision box 310)." undressed exception " be to be dished out by user's script but not by with The exception that family script processes.Such as, in fig. 2, user's script 222 is dished out different as shown in arrow 231 Often.Pattern 232A represent abnormal the most not by user's script 222 to process time operator scheme.
" treated exception " is to be dished out by user's script but the exception that processed by user's script.Such as, In fig. 2, user's script 222 throw exception as shown in arrow 231.Pattern 232B represent abnormal by with Operator scheme when family script 222 processes.
In the case of undressed exception (in decision box 310 it is " undressed "), script Engine catches script code stack (action 311).When abnormal being spilled over, " script code stack " represent with The script stack that scripted code is associated at least some of.Script code stack can be the whole of script stack, or Person can represent the only a part of script stack.What the only a part of script stack further described below was captured shows Example.
But, in action 311, the seizure of script code stack can access with the main frame of master control script engine The mode of the script code stack caught occurs.Such as, with reference to Fig. 2, pattern 232A of execution makes script draw Hold up to catch and represent as user's script 222 is as shown in arrow 231 the script stack of existence during throw exception All or part of script code stack.Represent that script engine 221 makes caught use by interface 232 Main frame 211 can be used by family script.Main frame may take other to take action (as represented by arrow 236) afterwards Fully to access this script code stack caught.But, other action may will not occur, until foot This stack be unfolded and be no longer directly available in analysis (as by description to action 312 and 313 below, This will be apparent from).
As additional option, it is assumed that before extremely being dished out by user's script 222, user's script generates There is error object (such as, the figure of the condition of dishing out (such as, the condition of dishing out 501 of Fig. 5) being associated The error object 500 of 5), and assume that the satisfied user's of making script 222 of this condition of dishing out has been dished out different Often.Script engine 221 (as a part for pattern 232A of execution) also makes to notify to user's script 222 It is abnormal, even if user's script 222 may not process this exception.In one example, this can be by being used in Rather than exist when error object is created (when abnormal being spilled over) when the condition of error object is satisfied Script code stack carrys out attribute (such as, the stack attribute of the error object 500 of Fig. 5 of fill-error object 500 502) complete.With reference to Fig. 2, abnormal by arrow 234 and 235 to the report of user's script by error object Represent.
After capturing script code stack in the way of host accessible (action 311), but will caught Before the script code stack caught is delivered to main frame (action 313), the expansion that script engine completes script stack is (dynamic Make 312).
The script code stack (action 313) that script engine is caught with backward host report.Such as, reference Fig. 2, main frame 211 accesses the script code stack caught, as represented by arrow 236.Script code stack Seizure first there is (action 311), because script stack launches after abnormal being spilled over, and the most such as Fruit catches script code stack then this script code stack later and will not still can use.
It is treated exception (for treated in decision box 310) if abnormal, then this means this Extremely can be processed by user's script 222.In this case, foot is not caught in host accessible mode This code stack (action 321).With reference to Fig. 2, when undressed exception is generated, perform pattern 232A Promote in the way of host accessible, catch script code stack (as represented by arrow 232), and also Promote to be captured as script code stack to be used (as represented by arrow 234) by user's script 222.Cause This, pattern 232A that performs is to show script code stack to the main frame of master control script engine and user's script Mode catch this stack.
But, in the case of treated exception (in decision box 310 it is " treated "), holds Row mode 232B does not catch script code stack in the way of host accessible.On the contrary, pattern 232B that performs will Script code stack is captured as so that this script code stack can be used by user's script, such as arrow 237 and 235 institute Represent.Therefore, in the case of treated exception, making script engine 221 avoid must can with main frame The mode accessed catches script code stack.In the case of being given dynamic language characteristic, user's script is especially Can generate multiple exception when Run Script, this can be in terms of the calculating resource that script engine 221 is utilized There is provided and significantly save.
Referring again to Fig. 2, the script code stack caught in main frame 211 is to use by main frame 211 The data structure 241 that object model compiles represents.In one embodiment, this data structure 241 Can represent whole call stack, what this whole call stack was made in being included in main frame calling and being made by script stack Call.Main frame can perform multiple row that the scripted code stack data structure 241 that caught with this is relevant Dynamic (action 314).Such as, main frame 211 can display to the user that caught script code stack is (such as arrow Represented by 242).Main frame 211 can promote script engine to stop the execution to script, and may report Function stack (as represented by arrow 243).But, main frame 211 can use in any other manner The script code stack (as represented by arrow 244) caught.
Fig. 4 shows that the method 300 combining Fig. 3 implicitly describes but the present method that will be expressly recited The flow chart of 400.Method 400 illustrates how just creating error object (such as, Fig. 5 at user's script Error object 500) context in process a treated abnormal example.
Method 400 includes that script engine performs user's script (action 401).Such as, in fig. 2, foot This engine 221 performs user's script 222.User's script creates error object, and (such as, the mistake of Fig. 5 is right As 500).Error object have the condition of dishing out (its can be error object attribute or can be with other Mode is specified or implicit), this condition of dishing out represents the condition of error object of consideration being dished out.Right in mistake During as being spilled over, error object includes the script stack field (such as, the stack field 502 of Fig. 5) being filled through, The script stack field that this is filled through may be created or be created in the time of throw exception.
Although not every error object all can cause abnormal being spilled over, but hypothesis is the wrongest right The condition of dishing out of elephant is at a time satisfied.This cause user's script dish out be associated with error object different Often (action 403).Now, script engine catches and represents the script stack being associated with scripted code at least The script code stack (action 404) of a part.Note, owing to being thrown abnormal in this script code stack Existing when going out, rather than exist when the error object of bottom is created, therefore this script code stack is captured. Therefore, the script code stack caught to abnormal reason is evaluated the most relevant.Subsequently with being caught Script code stack fill call stack attribute (action 405).This represents with arrow 235 in fig. 2.
In this manual, script stack can be logic script stack and/or physics script stack, and logic script stack is also Do not reflect that the optimization that compiler and/or interpreter are made, physics script stack do not reflect compiler and/or interpreter Affected all optimizations.For example, it is assumed that write as original, user's script principal function X calls function Y, Function Y calls function Z.Physics call stack will be as follows:
X->Y->Z
It is now assumed that compiler or interpreter notice that X can be modified such that it can directly invoke Z, and without Use function Y.In this case, logic call stack will be as follows:
X->Z
Therefore script code stack can include all or part of of physics call stack, or includes the complete of logic call stack Portion or part.Alternatively, logic call stack (or its part) and physics call stack (or its portion can be caught Point) both.
Additionally, as previously mentioned, in the presence of the script code stack caught is when being extremely spilled over, should The script code stack caught can include the whole of script stack.But, when the script code stack caught is different In the presence of when being often spilled over, this script code stack caught is likely to include only one of script code stack Point.Will now be discussed in which the example of the helpful realization that a part for only script stack is captured, but its In the embodiment that is captured of the part of only script stack be not limited to the example below.
In one example, the size of script code stack can be configured by a user to such as focus on scripted code A part especially relevant with this user for stack.Such as, user can specify him/her to only want to the bottom of this stack Five layers (level) or only want to five layers of top or the bottom of this stack and the of this stack of this stack Three layers are arrived layer 6 etc..This configuration can on-demand when performing user's script every time be made.
Alternatively or in addition, the top section of the recursive component including stack can be removed.For example, it is assumed that letter Number A (principal function) calls function B.It is now assumed that function B calls function C.In this case, call Stack can behave as follows:
A->B->C
Assuming from here on, the execution of user's script enters recursive schema, and wherein function C recursively calls Function B, function B call the most again function C.In this case, call stack will be extended to as follows:
A->B->C->B->C
It is now assumed that before being extremely spilled over (perhaps due to unexpected recursion length), this recurrence one There occurs 13 times (such as, due to the mistake in user's script) altogether.This call stack will show as subsequently as Under:
A->B->C->B->C->B->C->B->C->B->C->B->C->B->C-> B->C->B->C->B->C->B->C->B->C->B->C->B->C
Along with call stack becomes much larger, human interpretation gets up the most difficult.Therefore, script engine can be configured For removing recursive component to be blocked by call stack as follows:
A->B->C
Alternatively, script engine can catch the first recursive call (to obtain A-> B-> C-> B) or Until (but not limited to) the second recursive call (to obtain A-> B-> C-> B-> C) so that user's quilt Give the instruction of the general characteristic of recurrence, without manual navigation through the institute occurred before abnormal being spilled over There is recursion cycle.In other amendment, recursive point may be strengthened the most visually, with display A certain amendment occurs.
Therefore, principle described here provides and guides abnormal rightly for script engine and calculate money to save The mode of the call stack information of source and seizure and user's height correlation catches effective machine of user's scripted code System.
The present invention can be embodied as other concrete form without departing from its spirit or essential characteristics.Described reality Execute example and the most all should be to be considered merely as illustrative and not restrictive.Therefore, the scope of the present invention by Appended claims rather than instruction described above.Fall into implication and the scope of the equivalents of claims Interior being changed is contained by the scope of claims.

Claims (8)

1. one kind is used for optionally catching what the multiple exceptions dished out with scripted code (222) were associated The method (300) of script code stack, described method includes:
Safe barrier is provided including, institute between the script environment of script engine and the hosted environment including main frame State main frame and retain the control that script is performed, described safety when script is not performed at described script engine Barrier includes the interface for transmitting script call stack between described script engine and described main frame;
At least one exception that described scripted code is dished out, that not processed by described scripted code In each is abnormal, perform following action:
Described script engine (221) catches (311) and represents and described foot when described exception is spilled over The action of at least one of script code stack of the script stack that this code is associated, wherein said seizure Action occur in the way of host accessible, by the way of described host accessible, described in master control The main frame (211) of script engine can access caught script code stack;
After the action of the described script code stack of described seizure, described script engine completes described foot The action of the expansion (312) of this stack;
Described script engine by described interface to the host report (313) of script engine described in master control The action of the script code stack caught;And
Main frame performs the action of the multiple action relevant with the script code stack caught;
It is that dished out for described scripted code, that itself process by described scripted code that at least one is different Often, exempt (321) in the way of described host accessible, catch the action of described script code stack;
Wherein, fill-error object is carried out when dishing out at least one exception described by the script code stack caught Call stack attribute.
2. the method for claim 1, it is characterised in that described main frame is operating system.
3. the method for claim 1, it is characterised in that described main frame is browser.
4. the method for claim 1, it is characterised in that described script code stack is at described abnormal quilt Described script stack is represented when dishing out.
5. the method for claim 1, it is characterised in that script described in described scripted code stack representation A part for stack, in the portion, the top section of described script stack is removed.
6. method as claimed in claim 5, it is characterised in that be retained in caught script code stack The base section of described script stack include the configurable multiple stack frames of user.
Method the most according to claim 5, it is characterised in that described top section includes recursive component.
8. the method for claim 1, it is characterised in that in the action catching described script code stack Described script engine afterwards completes the action of the expansion of described script stack at described script engine to master control institute Occur before stating the action of the script code stack that the host report of script engine is caught.
CN201210480034.6A 2011-11-23 2012-11-22 Telemetry is caught by dynamic language engine Active CN102937934B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US13/304,178 US9069897B2 (en) 2011-11-23 2011-11-23 Capturing telemetry data by dynamic language engine
US13/304,178 2011-11-23

Publications (2)

Publication Number Publication Date
CN102937934A CN102937934A (en) 2013-02-20
CN102937934B true CN102937934B (en) 2016-08-17

Family

ID=47696833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210480034.6A Active CN102937934B (en) 2011-11-23 2012-11-22 Telemetry is caught by dynamic language engine

Country Status (5)

Country Link
US (1) US9069897B2 (en)
EP (1) EP2783299A4 (en)
CN (1) CN102937934B (en)
HK (1) HK1180055A1 (en)
WO (1) WO2013078024A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8819631B2 (en) * 2011-01-13 2014-08-26 Hewlett-Packard Development Company, L.P. System and method for self dependent web automation
CN104598374B (en) 2013-10-30 2017-12-01 国际商业机器公司 The method and apparatus of correction failure script
US9189214B2 (en) 2013-10-30 2015-11-17 International Business Machines Corporation Code stack management
CN109739676B (en) * 2018-12-27 2022-06-24 努比亚技术有限公司 Operation monitoring method, mobile terminal and computer readable storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101794224A (en) * 2010-02-26 2010-08-04 中国人民解放军国防科学技术大学 Software run-time property monitoring method based on property specification mode

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6493834B1 (en) 1999-08-24 2002-12-10 International Business Machines Corporation Apparatus and method for dynamically defining exception handlers in a debugger
US7516441B2 (en) 2001-06-04 2009-04-07 Microsoft Corporation Method and system for program editing and debugging in a common language runtime environment
JP3790683B2 (en) 2001-07-05 2006-06-28 インターナショナル・ビジネス・マシーンズ・コーポレーション Computer apparatus, exception handling program thereof, and compiling method
US7155706B2 (en) * 2003-10-24 2006-12-26 Microsoft Corporation Administrative tool environment
US7836428B2 (en) 2004-03-15 2010-11-16 Bungee Labs, Inc. Declarative computer programming language method and system
US20080022267A1 (en) 2004-04-26 2008-01-24 Google Inc. Method and System for Dynamically Composing Distributed Interactive Applications from High-Level Programming Languages
US7716633B1 (en) * 2004-05-17 2010-05-11 Heath Chester A Method for extending the life and utility of an existing personal computer by adding instant-on embedded functions
US7412626B2 (en) * 2004-05-21 2008-08-12 Sap Ag Method and system for intelligent and adaptive exception handling
US7596780B2 (en) 2004-10-22 2009-09-29 Microsoft Corporation System and method for virtual catching of an exception
US20070294392A1 (en) * 2006-06-20 2007-12-20 International Business Machines Corporation Apparatus, system, and method for intelligent polling support for websphere adapters based on the self-configuration characteristic of an autonomic computing model
US7661113B2 (en) * 2006-09-28 2010-02-09 Sap Ag Method and system for data preparation and communication between software applications
US8352498B2 (en) * 2008-05-16 2013-01-08 Ricoh Company, Ltd. Managing to-do lists in a schedule editor in a project management system
US7681182B1 (en) 2008-11-06 2010-03-16 International Business Machines Corporation Including function call graphs (FCG) generated from trace analysis data within a searchable problem determination knowledge base
US9632909B2 (en) 2008-12-16 2017-04-25 Microsoft Technology Licensing, Llc Transforming user script code for debugging
US9111036B2 (en) * 2010-04-30 2015-08-18 Red Hat, Inc. Preloading unwind data for non-intrusive backtracing

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101794224A (en) * 2010-02-26 2010-08-04 中国人民解放军国防科学技术大学 Software run-time property monitoring method based on property specification mode

Also Published As

Publication number Publication date
US20130132930A1 (en) 2013-05-23
CN102937934A (en) 2013-02-20
EP2783299A4 (en) 2015-11-04
US9069897B2 (en) 2015-06-30
WO2013078024A1 (en) 2013-05-30
EP2783299A1 (en) 2014-10-01
HK1180055A1 (en) 2013-10-11

Similar Documents

Publication Publication Date Title
Ju et al. On fault resilience of openstack
CN101957791B (en) By for the test script modularization of graphic user interface and aspectual
CN105574411B (en) A kind of dynamic hulling method, device and equipment
Guo et al. Practical software model checking via dynamic interface reduction
Vekris et al. Towards Verifying Android Apps for the Absence of {No-Sleep} Energy Bugs
US7984332B2 (en) Distributed system checker
CN102937934B (en) Telemetry is caught by dynamic language engine
JP2021192254A (en) Function extension method and system for package file
CN105308578B (en) The diagnosis of state transformation
CN104346148A (en) Method, device and system for acquiring program performance consumption information
CN101379504B (en) Access control management method and system for composite application based on roles
Payet et al. An operational semantics for Android activities
CN110795091B (en) Modularized route decoupling method, storage medium, electronic equipment and system
CN111339529B (en) Management system, method and computing device for running low-code business arrangement component
Pecka et al. Privilege escalation attack scenarios on the devops pipeline within a kubernetes environment
CN112379871A (en) Data processing method and device
CN109388770B (en) Web page generation method and device
CN112784417B (en) Avionics distributed joint simulation method and system based on SysML
CN107808097A (en) JavaScript path enumerations
WO2021036987A1 (en) Method and device for achieving operation and maintenance monitoring
CN105094773B (en) The method for reusing and system of functions of modules
Makki et al. Scalable and manageable customization of workflows in multi-tenant saas offerings
CN103049306A (en) Simulation of static members and parameterized constructors on an interface-based api
Cheng et al. Sedalvik: A kernel-level android behavior forensic method
Gama et al. Applying dependability aspects on top of" aspectized" software layers

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1180055

Country of ref document: HK

ASS Succession or assignment of patent right

Owner name: MICROSOFT TECHNOLOGY LICENSING LLC

Free format text: FORMER OWNER: MICROSOFT CORP.

Effective date: 20150805

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20150805

Address after: Washington State

Applicant after: Micro soft technique license Co., Ltd

Address before: Washington State

Applicant before: Microsoft Corp.

C14 Grant of patent or utility model
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: GR

Ref document number: 1180055

Country of ref document: HK