8000 variable name causes problems · Issue #1123 · hugsy/gef · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
variable name causes problems #1123
Open
@argator18

Description

@argator18

GEF+GDB version

GEF: (Standalone)
Blob Hash(/usr/share/gef/gef.py): c713c62efd950a24413b0834d9e8fd3563ba114f
SHA256(/usr/share/gef/gef.py): 12881b1d42fb490ca72896099daf5c128c7c7382be0779c8f8f7db3a9161ab6f
GDB: 14.2
GDB-Python: 3.12

Operating System

Arch Linux

Describe the issue you encountered

Using some variable with the name tcache in the c code and compile with debug symbols, will cause errors in the output of heap bins.
I am not sure, if this problem also occurs for other variable names.

Do you read the docs and look at previously closed issues/PRs for similar cases?

No

Architecture impacted

  • X86
  • X64
  • ARM
  • ARM64
  • MIPS
  • MIPS64
  • PPC
  • PPC64
  • RISCV

Describe your issue. Without a proper reproduction step-by-step, your issue will be ignored.

Compiling with -g causes problems when using command heap bins:

#include <stdlib.h>
int main(){
  void * tcache[7];
  for(int i = 0; i < 7; i ++){
    tcache[i] = malloc(0x80);
    *(char *)tcache[i] = i+1;
  }
  for(int i = 0 ; i < 7 ; i++){
      free(tcache[i]);
  }
}

But renaming tcache variable, will fix the problem again.

Minimalist test case

Use this field for a minimal code to compile and spot the issue:

// compile with gcc -g
#include <stdlib.h>
int main(){
  void * tcache[7];
  for(int i = 0; i < 7; i ++){
    tcache[i] = malloc(0x80);
    *(char *)tcache[i] = i+1;
  }
  for(int i = 0 ; i < 7 ; i++){
      free(tcache[i]);
  }
}    

Additional context?

image

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0