发明名称 DETECTING UNINITIALIZED MEMORY REFERENCES
摘要 A pre-initialized value of contents of a memory location is identified. A load value of contents loaded from the memory location by execution of a first instruction that loads from the memory location is also identified. A comparison is made between the load value and the pre-initialized value. Based on the comparison, a determination is made that the load value and the pre-initialized value are the same. In response to this determination, it is indicated that the first instruction contains an uninitialized memory reference.
申请公布号 US2016232074(A1) 申请公布日期 2016.08.11
申请号 US201514679423 申请日期 2015.04.06
申请人 International Business Machines Corporation 发明人 Bates Cary L.;Helgeson Lee N.;King Justin K.;Schlicht Michelle A.
分类号 G06F11/36 主分类号 G06F11/36
代理机构 代理人
主权项 1. A method for detecting an uninitialized memory reference, the method comprising: identifying a pre-initialized value of contents of a memory location, wherein the identifying the pre-initialized value of contents of the memory location comprises creating, for a second instruction that stores to the memory location, a second record that includes a pre-store value of contents of the memory location prior to execution of the second instruction, and wherein the pre-store value is the pre-initialized value; identifying a load value of contents loaded from the memory location by execution of a first instruction that loads from the memory location, wherein the identifying the load value of contents loaded from the memory location by execution of the first instruction that loads from the memory location comprises creating, for the first instruction, a first record that includes the load value; comparing the load value to the pre-initialized value, wherein the comparing the load value to the pre-initialized value comprises comparing the load value from the first record to the pre-store value from the second record; determining, based on the comparing the load value to the pre-initialized value, that the load value and the pre-initialized value are the same; indicating, in response to the determining that the load value and the pre-initialized value are the same, that the first instruction contains the uninitialized memory reference, wherein the first instruction is in a first thread of a multi-threaded program, wherein the second instruction is in a second thread of the multi-threaded program, wherein the first instruction is a load instruction, wherein the second instruction is a store instruction, wherein the first record is a load record, and wherein the second record is a store record; generating, during an execution of the multi-threaded program and for the first thread, a first memory access table including a first plurality of load records and further including a first plurality of store records, the first plurality of load records including the load record; generating, during the execution of the multi-threaded program and for the second thread, a second memory access table including a second plurality of load records and further including a second plurality of store records, the second plurality of store records including the store record; combining the first memory access table and the second memory access table; sorting, based on time of creation, the records of the combined table; identifying the load record in the sorted table; identifying, by scanning through the sorted table relative to the load record, a target store record of the second plurality of store records as being a most recent store record created prior to the load record that specifies the memory location, wherein the target store record is not the store record, wherein the target store record includes a target store value of contents of the memory location subsequent to execution of a target store instruction and further includes a target pre-store value of contents of the memory location prior to execution of the target store instruction, wherein the store record includes a store value of contents of the memory location subsequent to execution of the store instruction; comparing, in response to the identifying the target store record, the load value to the target store value; determining, in response to the comparing the load value to the target store value, that the load value and the target store value are not the same; comparing, in response to the determining that the load value and the target store value are not the same, the load value to the target pre-store value; determining, in response to the comparing the load value to the target pre-store value, that the load value and the target pre-store value are not the same; identifying, by scanning through the sorted table relative to the target store record and in response to the determining that the load value and the target pre-store value are not the same, the store record as being a second-most recent store record created prior to the load record that specifies the memory location; comparing, in response to the identifying the store record, the load value to the store value; and determining, in response to the comparing the load value to the store value, that the load value and the store value are not the same, wherein the comparing the load value to the pre-store value occurs in response to the determining that the load value and the store value are not the same.
地址 Armonk NY US