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
RecursionError when connecting to qemu target #954
Comments
Hey, thanks for reporting this. I'll try to investigate this issue |
Interesting, it seems this could be some caching issue, but when we disable memoization/caching with |
This can maybe be diagnosed/compared by using |
The issue is that I introduced a cyclic dependency between Now:
FWIW |
@justfoxing this should be fixed with the recent commit. Although its not ideal: I made it so we just return a Page(0, 0xfffffffff...) which is not quite correct. |
Cheers, confirmed working for me, thanks for the quick fix. |
This is still happening on ARM64
|
Actually this binary is not qemu whatsoever. It is just a normal ELF compiled by clang. By the way, I forgot to say this but thank you @justfoxing for the accurate issue description with the offending commit hashes. I was able to workaround by checking out commits prior to that |
Is this on ARM64 linux then? Or is it a binfmt misc that actually runs qemu user mode under th hood? |
Yes, it's running on a Raspberry Pi.
Something else I might add --- commands like |
Can you show output of this command?: |
Ah, interesting it seems to be an issue specific to core files.
|
Wait, why doesn't it trigger now? EDIT: Btw it may be better to communicate via Discord: we have a Pwndbg server at https://discord.gg/pNhrz52s |
OK, will do. It seems to happen when I do |
I'm getting this same error, in the same parts of the code, but on an amd64 binary. It happens inside of a recursive function, after the first level of recursion |
File "/opt/pwndbg/pwndbg/events.py", line 169, in caller
raise e
File "/opt/pwndbg/pwndbg/events.py", line 165, in caller
func()
File "/opt/pwndbg/pwndbg/vmmap.py", line 466, in mark_pc_as_executable
mapping = find(pwndbg.regs.pc)
File "/opt/pwndbg/pwndbg/memoize.py", line 46, in __call__
value = self.func(*args, **kwargs)
File "/opt/pwndbg/pwndbg/vmmap.py", line 72, in find
for page in get():
File "/opt/pwndbg/pwndbg/memoize.py", line 46, in __call__
value = self.func(*args, **kwargs)
File "/opt/pwndbg/pwndbg/vmmap.py", line 53, in get
pages.extend(info_auxv())
File "/opt/pwndbg/pwndbg/memoize.py", line 46, in __call__
value = self.func(*args, **kwargs)
File "/opt/pwndbg/pwndbg/vmmap.py", line 404, in info_auxv
pages.extend(pwndbg.elf.map(entry or phdr, exe_name))
File "/opt/pwndbg/pwndbg/elf.py", line 326, in map
ei_class, ehdr = get_ehdr(pointer)
File "/opt/pwndbg/pwndbg/elf.py", line 237, in get_ehdr
vmmap = pwndbg.vmmap.find(pointer)
File "/opt/pwndbg/pwndbg/memoize.py", line 46, in __call__
value = self.func(*args, **kwargs)
File "/opt/pwndbg/pwndbg/vmmap.py", line 72, in find
for page in get():
File "/opt/pwndbg/pwndbg/memoize.py", line 46, in __call__
value = self.func(*args, **kwargs)
File "/opt/pwndbg/pwndbg/vmmap.py", line 53, in get
pages.extend(info_auxv())
File "/opt/pwndbg/pwndbg/memoize.py", line 46, in __call__
value = self.func(*args, **kwargs)
File "/opt/pwndbg/pwndbg/vmmap.py", line 404, in info_auxv
pages.extend(pwndbg.elf.map(entry or phdr, exe_name))
File "/opt/pwndbg/pwndbg/elf.py", line 326, in map
ei_class, ehdr = get_ehdr(pointer)
File "/opt/pwndbg/pwndbg/elf.py", line 237, in get_ehdr
vmmap = pwndbg.vmmap.find(pointer)
File "/opt/pwndbg/pwndbg/memoize.py", line 46, in __call__
value = self.func(*args, **kwargs)
File "/opt/pwndbg/pwndbg/vmmap.py", line 72, in find
for page in get():
File "/opt/pwndbg/pwndbg/memoize.py", line 46, in __call__
value = self.func(*args, **kwargs)
File "/opt/pwndbg/pwndbg/vmmap.py", line 53, in get
pages.extend(info_auxv())
File "/opt/pwndbg/pwndbg/memoize.py", line 46, in __call__
value = self.func(*args, **kwargs)
File "/opt/pwndbg/pwndbg/vmmap.py", line 404, in info_auxv
pages.extend(pwndbg.elf.map(entry or phdr, exe_name))
File "/opt/pwndbg/pwndbg/elf.py", line 326, in map
ei_class, ehdr = get_ehdr(pointer)
File "/opt/pwndbg/pwndbg/elf.py", line 237, in get_ehdr
vmmap = pwndbg.vmmap.find(pointer)
File "/opt/pwndbg/pwndbg/memoize.py", line 46, in __call__
value = self.func(*args, **kwargs)
File "/opt/pwndbg/pwndbg/vmmap.py", line 72, in find
for page in get():
Just to make sure it's exactly the same issue |
@Sparrrgh can u show how we can reproduce this? e.g. exact binary/setup? |
have the same issue when loading coredump. |
@cnwangjihe are u using latest pwndbg? and which version of gdb? for @Sparrrgh it seemed that a gdb or pwndbg update helped.. Can u show output of the |
On ubuntu 20.04 LTS
On arch linux, with gdb 11.1, encounter the same issue
|
This happens when trying to debug a coredump:
bugreportPlatform: Linux-5.16.8-arch1-1-x86_64-with-glibc2.33 ("Relocatable" means the directory can be moved with the GDB installation Traceback
|
This commit fixes our headaches with core files debugging. The TL;DR is that we will now try to parse `info proc mappings` and `maintenance info sections` to give users best possible UX/vmmaps information. Related: * https://sourceware.org/bugzilla/show_bug.cgi?id=29508 * #985 * #954
* Fix coredump debugging This commit fixes our headaches with core files debugging. The TL;DR is that we will now try to parse `info proc mappings` and `maintenance info sections` to give users best possible UX/vmmaps information. Related: * https://sourceware.org/bugzilla/show_bug.cgi?id=29508 * #985 * #954 * cleanup * cleanup * Fix core dbg when EHDR map is not mapped
Hey, There are three separate issues here:
The first case has hopefully been resolved with #1079 and a recent commit. The 2nd case has been mainly resolved in #1079. However, this is not perfect: it does not give 100% accurate vmmap info because the data we fetch vmmap information from, namely: For what is worth, the GDB's For the 3rd case, the problem is related to the QEMU user emulation's gdbstub being underdeveloped. It lacks a few features related to getting files from the debugged target. I have been working some time ago on a patch to fix that in QEMU, which you can find here: https://lore.kernel.org/all/20220221030910.3203063-1-dominik.b.czarnota@gmail.com/ and while it works, it need a few improvements and tests. I hope to find some time in the soonish future to work on that and finish that. In theory, for 3rd we could parse the QEMU's process memory maps and filter them by ourselves. However, this would only work if the QEMU process is run locally and would not work if it hosts its gdbstub from a remote server. Anyway, I am closing this issue for now, as the main problem, which is recursion error - should now be fixed. |
have the same issue,but I use qemu-system
bin: https://github.com/praetorian-inc/DVRF/blob/master/Pwnable%20Source/Intro/stack_bof_01.c ubuntu 18.04
|
@kevinpark1217 hey, can you try updating ur pwndbg version? The f2fcc95 version is from may and we have had some fixes to this problem recently. Please, let me know if the latest dev branch or current release (those are the same version fwiw) work for you. |
still have this issue
|
That's interesting, thanks, we will have to fix this:
|
@Erebua just to be sure, you installed pwndbg inside the qemu system image, right? If you have direct steps how to reproduce ur case I'd appreciate that |
This may or may not fix the issue described in #954 (comment)
This may or may not fix the issue described in #954 (comment)
I installed pwndbg in attifyos qemu-system
attifyos
|
It wokred! thanks u!
but what is the 'explored' mean? |
Wait, how exactly are u running all this? How do u run the qemu-system? Can u give commands for that? The
The
Usually, the GDB's
But given your |
@Erebua since this is not anymore about a recursion error, can you provide all necessary information to reproduce your issue in a new one and I will close this one? |
sure,just wait a minute |
Description
Steps to reproduce
Output is then:
With
set exception-debugger on
, the partial traceback is:(If you want the full traceback for some reason, let me know, but it's just recursing through the same functions until it falls over).
My setup
pwndbg> version
Gdb: 9.2
Python: 3.8.2 (default, Jul 16 2020, 14:00:26) [GCC 9.3.0]
Pwndbg: 1.1.0 build: 2bef07f
Capstone: 4.0.1024
Unicorn: 1.0.2
Running on Ubuntu
The text was updated successfully, but these errors were encountered: