Patent ID: 8141059
Filing Date: 2012-03-20
Classification: G06F

Abstract:
1. A method for avoiding software conflicts when a program calls at least one library, said at least one library being divided into layer 1 to layer M according to dependency among the at least one library, with each layer containing at least one library and M≧1, said method comprising: performing a library installer step comprising: moving all libraries to a libraries database to install the software; according to a reference table of the program and reference tables of libraries he program calls, determining M layers of libraries involved in the calling by the binary executable code of the program, and determining dependency among the program and the M layers; recording in a tree dependency between the program and at least one library the program calls; (a) before the program runs, prescanning calling functions of the binary executable code of the program and called functions that belong to libraries of layer (b) if there exists at least one conflict, storing at least one piece of conflict information individually indicating the at least one conflict; and executing said program, wherein executing comprises: loading libraries from the libraries database; (c) when there appears that the calling function calls the corresponding called function in a call sequence of the program in execution, abandoning loading of the library containing the called function if the conflict information indicating that the call conflicts has been stored, or loading the library containing the called function otherwise; prompting a user whether to close a process containing the call sequence leading to the conflict; (d) when running the binary executable code of the program, monitoring a piece of executable code currently running in a call sequence of the binary executable code of the program, the call sequence including at least one piece of executable code, wherein step (d) further comprises: monitoring a code register or special instructions so as to record all call/return actions when the call sequence calls functions of the libraries, the special instructions being calls or long/far jumps, wherein a call stack monitor module is used to carry out the monitoring, and wherein the call stack monitor module locates the library currently used by inspecting a call stack, and monitoring data exchange between the executable code and the library code executed when the call sequence calls functions of the libraries; (e) if it is found that the call sequence crashes when the call sequence calls functions of a given library, storing conflict information on the crash, wherein step (e) further comprises: if the call sequence includes only one piece of executable code, carrying out the step of storing confliction information, and otherwise, tracing data exchanged during the last function call before the conflict, so as to extract the last piece of executable code of the call sequence leading to the conflict and find the libraries that have ever manipulated the data, and then carrying out the step of storing confliction information; and (f) when the call sequence calls a function of the given library again, abandoning loading the given library if conflict information corresponding to the given library has been stored, or loading the given library otherwise.