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

[Bug] Wrong python Versione #930

Closed
1 of 9 tasks
vanirem opened this issue Mar 2, 2023 · 7 comments
Closed
1 of 9 tasks

[Bug] Wrong python Versione #930

vanirem opened this issue Mar 2, 2023 · 7 comments

Comments

@vanirem
Copy link

vanirem commented Mar 2, 2023

GEF+GDB version

latest

Operating System

Linux

Describe the issue you encountered

#gdb-gef
File "~/gef/gef.py", line 111
latest_gef_data = http_get(f"https://raw.githubusercontent.com/hugsy/gef/{ver}/scripts/gef.sh")
^
SyntaxError: invalid syntax

The python version is wrong.
I tried to remove all python versions (2.7 and 3.5) and manually installed python3.9.
but the error still remains.

Sorry, this is my first post on github.

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.

Provide a step-by-step to reproduce your issue.

Minimalist test case

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

// compile with gcc -fPIE -pic -o my_issue.out my_issue.c
int main(){ return 0; }

You can also provide a Dockerfile if you prefer

Additional context?

  • Screenshots
  • Callstack
  • Coredumps
  • If possible and useful, please upload the binary
@theguy147
Copy link
Collaborator

Sorry, but I don't understand your issue. You didn't provide enough information and you did not follow the Issue Template.

We have no idea how you installed GEF and what version you're using (latest is not very specific and more often then not people are not actually using the "latest" version).

Also provide us with as much information as possible about the specific error you're encountering, including all displayed error messages.

When you say something like "wrong python version": Are you sure that you're using GDB with python-support?

@hugsy hugsy added need-more-info and removed bug labels Mar 5, 2023
@ans1genie
Copy link

any updates on this issue?
reproduced on my side, following the installation steps:
https://github.com/hugsy/gef#instant-setup
either curl or wget and then execute gdb will give that error.

@ans1genie
Copy link

anyway to restore the gdb to it's working state.
open the .gdbinit file and remove the line for sourcing the gef python script.
for my case, I removed that line :

$ cat .gdbinit
source ~/.gef-2b72f5d0d9f0f218a91cd1ca5148e45923b950d5.py 

@hugsy
Copy link
Owner

hugsy commented Apr 6, 2023

The python version you have compiled with gdb is too old, doesn't support f-string. Run

$ gdb -nx -ex 'pi sys.version' -ex quit

And post the result here.

@ans1genie
Copy link

@hugsy result :

$ gdb -nx -ex 'pi sys.version' -ex quit
GNU gdb (GDB) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
'3.5.2 (default, Nov 10 2016, 16:46:12) \n[GCC 4.1.2 20080704 (Red Hat 4.1.2-55)]'

@hugsy
Copy link
Owner

hugsy commented Apr 6, 2023

As I suspected, your version is too old for both Python (3.5.2) and GDB (7). Install or compile a newer version. See https://hugsy.github.io/gef/install/

@ans1genie
Copy link

thanks for the help @hugsy

@hugsy hugsy closed this as completed Apr 6, 2023
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

4 participants