Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Yes, yes, yes
Step 1: Describe your environment
Step 2: Describe your problem
Attemting to use gef to step (si) through a program unexpectedly aborts
This behavior is not observed when using peda or pwndbg, which exit
Steps to reproduce
Sample code, sp_demo
Hmm. Using gdb to debug gdb/gef, stepping through sp_demo with si:
Hello @hugsy, I have the same problem and I think that is not a problem of GDB. In my case, when I get a segmentation fault (with GEF) I get "gdb_exception_RETURN_MASK_ERROR", but with GDB (without GEF), i don't get that error. E.g.
GDB (without GEF)
@hugsy Yeah no worries. I'll dig into deeper this weekend. What's bothering me is I'm not getting this behavior with gdb anywhere else. :/ But there's nothing in gef that's jumping out at me either. I've also recompiled gdb from source on my system, just in case that was an issue, but still seeing same behavior. I am finding others getting same error w/ different programs, but so far nothing has applied to this situation. In any case, appreciate your quick response. :)
UPDATE Sigh, I'm FOS. Now that I've recompiled from source and re-installed gef I'm getting the same gdb_exception when I reach the end of sp_demo, but a different reason for the failure:
@Sinkmanu : Just for grins, can you try the following and post the bit where it actually flails here?
Also, make sure to try hugsy's suggestion of setting
before running your code in gef. I still get the same error, but there's a chance this might fix it for you (assuming you haven't already tried this.)
It looks like perhaps we're both using Pi's? Mine's a 3B, and the latest gdb source I can get from my distro (Kali rolling -- using 'apt-get source gdb') is 188.8.131.5261007. I'm going to try something else here and see if I get any joy, but it's going to take a bit.
@Sinkmanu It is a GDB-issued exception, nothing to do with GEF. Also just saying "I have the same problem" is not helpful to fix it. In the future, try to provide more info (your setup, the binary you were testing that on, etc.)
@sashs reported me privately a very same issue not long ago. Apparently the issue would come from GDB triggering this
I will try to reproduce it, but in any case, there is very little GEF can do about it. This issue should be propagated to the GDB developers.
@feralgibbons , I got the error in this line. Did you try with a old version of GDB?
UPDATE I have compiled the last version of GDB (8.1) and It has not that problem.
Original Issue and Mitigation
gdb version 7.12, as distributed w/ Raspbian/Kali rolling (only distro's tested,) throws an exception while disassembling ARM binaries when using gef. This is not a gef problem, this is a gdb problem. gef is just the tool that revealed the gdb dain bramage! (The issue was not observed using vanilla gdb/peda/pwndbg) This issue was first noted when using si to step through a simple ARM assembly program (noted above) when instead of exiting cleanly, gdb's disassembly failed with a SIGABRT and threw an exception:
This turns out to be a known problem (regression) with gdb, and affects gef users running the ARM platform (Raspberry Pi).
The mitigation is for ARM users to compile gdb from source and run the latest version, 8.1 as of this writing.
gef's README.md should be changed to direct users of the ARM platform, or at least the Raspberry Pi, to ignore their distribution's packaged version of gdb (assuming it is not current) and compile gdb from source.
added a commit
Feb 4, 2018
For those who find "build gdb from sources" to be insufficient detail, here is what worked for me today:
The thing missing from other instructions is that configure needs to be with python. Without it you get #402.