Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception: Failed to read memory! #4

Closed
zhao-dddw opened this issue Apr 1, 2022 · 3 comments
Closed

Exception: Failed to read memory! #4

zhao-dddw opened this issue Apr 1, 2022 · 3 comments

Comments

@zhao-dddw
Copy link

zhao-dddw commented Apr 1, 2022

when i python3 qemu_uboot_avatar2.py

[2022-04-01 11:04:28,252 | avatar.INFO | Initialized Avatar. Output directory is /tmp/myavatar
TargetLauncher is starting process "/usr/local/bin/qemu-system-arm" "-M" "versatilepb" "-m" "20M" "-gdb" "tcp:127.0.0.1:1234" "-serial" "tcp:127.0.0.1:2000,server,nowait" "-kernel" "u-boot" "-S" "-nographic" "-monitor" "telnet:127.0.0.1:2001,server,nowait"
qemu-system-arm: -monitor telnet:127.0.0.1:2001,server,nowait: Failed to find an available port: Address already in use
2022-04-01 11:04:28,429 | avatar.targets.GDBTarget0.INFO | State changed to TargetStates.STOPPED
2022-04-01 11:04:28,430 | avatar.INFO | Received state update of target GDBTarget0 to TargetStates.STOPPED
2022-04-01 11:04:28,440 | avatar.targets.GDBTarget0.INFO | Connected to Target
2022-04-01 11:04:28,441 | avatar.targets.QemuTarget0.WARNING | No cpu_model specified - are you sure?
2022-04-01 11:04:28,447 | avatar.targets.QemuTarget0.INFO | QEMU process running
2022-04-01 11:04:28,618 | avatar.targets.QemuTarget0.INFO | State changed to TargetStates.STOPPED
2022-04-01 11:04:28,619 | avatar.INFO | Received state update of target QemuTarget0 to TargetStates.STOPPED
2022-04-01 11:04:28,631 | avatar.targets.QemuTarget0.QMPProtocol.INFO | b'{"return": {}, "id": 0}\r\n'
2022-04-01 11:04:28,633 | avatar.targets.QemuTarget0.INFO | Connected to remote target
2022-04-01 11:04:28,634 | avatar.targets.QemuTarget0.RemoteMemoryProtocol.INFO | Successfully connected rmp
2022-04-01 11:04:28,651 | avatar.targets.QemuTarget0.INFO | State changed to TargetStates.RUNNING
2022-04-01 11:04:28,652 | avatar.targets.QemuTarget0.INFO | State changed to TargetStates.BREAKPOINT
2022-04-01 11:04:28,653 | avatar.INFO | Received state update of target QemuTarget0 to TargetStates.RUNNING
2022-04-01 11:04:28,654 | avatar.INFO | Breakpoint hit for Target: QemuTarget0
2022-04-01 11:04:28,655 | avatar.INFO | Received state update of target QemuTarget0 to TargetStates.BREAKPOINT
2022-04-01 11:04:28,656 | avatar.targets.QemuTarget0.INFO | State changed to TargetStates.STOPPED
2022-04-01 11:04:28,657 | avatar.INFO | Received state update of target QemuTarget0 to TargetStates.STOPPED
================== Arrived at clear_bss =========================
**2022-04-01 11:04:28,672 | avatar.ERROR | RemoteMemoryRead failed: Failed to read memory!
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/avatar2.py", line 453, in _handle_remote_memory_read_message
    mem = range.forwarded_to.read_memory(
  File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/watchmen.py", line 78, in watchtrigger
    ret = func(self, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/targets/target.py", line 35, in check
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/targets/target.py", line 386, in read_memory
    return self.protocols.memory.read_memory(address, size, num_words, raw)
  File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/protocols/gdb.py", line 664, in read_memory
    raise Exception("Failed to read memory!")
Exception: Failed to read memory!**
2022-04-01 11:04:28,682 | avatar.targets.QemuTarget0.INFO | State changed to TargetStates.RUNNING
2022-04-01 11:04:28,683 | avatar.INFO | Received state update of target QemuTarget0 to TargetStates.RUNNING
2022-04-01 11:04:28,693 | avatar.targets.QemuTarget0.INFO | State changed to TargetStates.EXITED
2022-04-01 11:04:28,694 | avatar.INFO | Received state update of target QemuTarget0 to TargetStates.EXITED
Arrived at main loop, demo is over
2022-04-01 11:04:29,164 | avatar.targets.QemuTarget0.RemoteMemoryProtocol.WARNING | Tried to close/unlink non existent rx_queue
2022-04-01 11:04:29,165 | avatar.targets.QemuTarget0.RemoteMemoryProtocol.WARNING | Tried to close/unlink non existent tx_queue
None]

Thanks!

@mariusmue
Copy link
Member

Heya,
The demo seems to be working as intended, as you can see: "Arrived at main loop, demo is over" is successfully hit.

Generally speaking, the errors may be due to race conditions in the tear down of avatar, so nothing to worry about it. (Qemu gets shutdown, which is why "pending" read-memory messages are failing)

@zhao-dddw
Copy link
Author

@mariusmue Thank you for your reply!

@cL1mentB
Copy link

cL1mentB commented Apr 4, 2022

Hi,
I have the same problem, can I know the version of avatar-qemu you are using ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants