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

variable name causes problems #1123

Open
1 of 9 tasks
Len101218 opened this issue Jul 12, 2024 · 0 comments
Open
1 of 9 tasks

variable name causes problems #1123

Len101218 opened this issue Jul 12, 2024 · 0 comments
Assignees

Comments

@Len101218
Copy link

Len101218 commented Jul 12, 2024

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

@stale stale bot added the stale label Sep 12, 2024
@hugsy hugsy removed the stale label Sep 12, 2024
@hugsy hugsy self-assigned this Sep 12, 2024
Repository owner deleted a comment from stale bot Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants