Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gdb_exception_RETURN_MASK_ERROR #206

@feralgibbons

Description

@feralgibbons

Step 0:

Yes, yes, yes

Step 1: Describe your environment

  • Operating System: Linux 4.9.78-v7+

  • Architecture: armv7l
    Byte Order: Little Endian
    CPU(s): 4
    On-line CPU(s) list: 0-3
    Thread(s) per core: 1
    Core(s) per socket: 4
    Socket(s): 1
    Model: 4
    Model name: ARMv7 Processor rev 4 (v7l)
    CPU max MHz: 1200.0000
    CPU min MHz: 600.0000
    BogoMIPS: 38.40
    Flags: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32

  • GDB version (including the Python library version): Debian 7.12-6+b1, Python 2.7/3.7

Step 2: Describe your problem

Attemting to use gef to step (si) through a program unexpectedly aborts
at the end of program with the following error:

 ─────[ threads ]────
[#0] Id 1, Name: "sp_demo", stopped, reason: SINGLE STEP    
─────[ trace ]────
[#0] 0x10064 → Name: exit()
terminate called after throwing an instance of 'gdb_exception_RETURN_MASK_ERROR'
Aborted

This behavior is not observed when using peda or pwndbg, which exit
normally. This behavior is not observed when just running program:

Reading symbols from sp_demo...(no debugging symbols found)...done.
gef➤  run
Starting program: /home/timmy/ARM/code/sp_demo 
[Inferior 1 (process 2528) exited normally]
gef➤  

Steps to reproduce

  1. gdb -q sp_demo
  2. gef> b _start
  3. gef> r
  4. gef> si (until error observed)

Observed Results

See above.

Expected results

 f 0    10068 exit+4
pwndbg> si
[Inferior 1 (process 2545) exited normally]
pwndbg> 

Sample code, sp_demo

@ Test code, stack pointer example 

    .global _start

_start:
   mov r7, #0x30      
   push {r7}          
   mov r7, #0x10      
   pop {r7}           

exit:
    mov r7, #1       
    svc 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions