Jump to content

kombi

Members
  • Posts

    1
  • Joined

  • Last visited

kombi's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. Hello everyone, I am trying to write a small tool that reads hardware information from the shared memory of AIDA64. I use python's MMAP library to operate.I found that mmap can obtain the target XML text when reading, but errors often occur during the XML parsing in the subsequent steps.The manifestation of this error is that the XML parser often cannot find a properly closed tag.In manual inspection, I found that this kind of error can be manifested as follows: 1.<pwr>**********</pwr> wr> 2.<value>**********</vaalue> 3.<iid>**********</id> These errors look like I am reading while AIDA64 is writing to the shared memory area. The data read in this way is not a complete frame(Therefore, the structure of the data as XML may not be complete due to misalignment and other reasons). The test code I used for reading is as follows: while(1): try: with mmap.mmap(fileno=-1, length=12288, tagname="AIDA64_SensorValues") as AIDA64data: string = AIDA64data.read().strip(b"\0").decode(encoding="gbk") string = f"<AIDA64>{string}</AIDA64>" dict_xml = xmltodict.parse(string) except Exception as e: print(e) continue Does AIDA64 provide a function that shows a locked state when it accesses shared memory?Or is there a way to avoid reading while writing? I am a rookie programmer, maybe this problem can be realized by using some advanced functions of the program, please help me, thanks!
×
×
  • Create New...