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

maximum recursion depth exceeded - gdb -c core_dump #985

Closed
securitylab-repository opened this issue Nov 26, 2021 · 6 comments
Closed

maximum recursion depth exceeded - gdb -c core_dump #985

securitylab-repository opened this issue Nov 26, 2021 · 6 comments
Labels

Comments

@securitylab-repository
Copy link

securitylab-repository commented Nov 26, 2021

core.4408.zip

Description

We have this error when we analyse a core dump generated after segmentation fault due to the buffer overflow :
Exception occurred: Error: maximum recursion depth exceeded while calling a Python object (<class 'RecursionError'>).
We launch gdb and thus pwndbg with this option : -c

Steps to reproduce

My setup

ubuntu bionic64 on vagrant and virtualbox
python version : any
gdb version : 8.1.1-0ubuntu1

@disconnect3d
Copy link
Member

Can you provide a minimal working example of this so I can fix it once and for all?

@securitylab-repository
Copy link
Author

this is the core dump
core.4408.zip

@disconnect3d
Copy link
Member

Thanks, I can reproduce this and I get some workaround which isn't perfect yet but it can be found here in case u want to use it now: https://github.com/disconnect3d/pwndbg/tree/workaround-985

Due how it is made Pwndbg does not resolve proper vmmap, so e.g. legend does not work well. I guess we could maybe parse info proc mapping instead of all the thing we do now or we did in the past to grab those pages in this particular case...

@securitylab-repository
Copy link
Author

securitylab-repository commented Nov 26, 2021 via email

@disconnect3d
Copy link
Member

disconnect3d added a commit that referenced this issue Aug 20, 2022
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
disconnect3d added a commit that referenced this issue Aug 20, 2022
* 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
@disconnect3d
Copy link
Member

disconnect3d commented Aug 20, 2022

This has been fixed in #1079

The returned vmmap information is not ideal, but that's more or less what we get right away from GDB.

(We may be able to improve this by using readelf on the core file, but it would not be so generic solution/may not work in all cases etc. so I am still not sure about using it)

image

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

No branches or pull requests

2 participants