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

espcoredump.py & xtensa-esp32-elf-gdb not working in docker (IDFGH-3297) #5284

Closed
vtunr opened this issue May 13, 2020 · 6 comments
Closed
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@vtunr
Copy link

vtunr commented May 13, 2020

Environment

  • Environment : WSL2 (ubuntu18.04)
  • Docker image : release/v4.0 & latest

Problem Description

My goal is to use the docker container to process coredump.
Running espcoredump.py lead to

================== CURRENT THREAD REGISTERS ===================
Traceback (most recent call last):
  File "/opt/esp/idf/components/espcoredump/espcoredump.py", line 1190, in <module>
    main()
  File "/opt/esp/idf/components/espcoredump/espcoredump.py", line 1185, in main
    operation_func(args)
  File "/opt/esp/idf/components/espcoredump/espcoredump.py", line 1065, in info_corefile
    p = gdbmi_getinfo(p, handlers, "info registers")
  File "/opt/esp/idf/components/espcoredump/espcoredump.py", line 979, in gdbmi_getinfo
    p.stdin.write(bytearray("-interpreter-exec console \"%s\"\n" % gdb_cmd, encoding='utf-8'))
BrokenPipeError: [Errno 32] Broken pipe

Trying to run xtensa-esp32-elf-gdb by itself is not working inside the container :

root@40e761ae8a4a:/project# xtensa-esp32-elf-gdb
xtensa-esp32-elf-gdb: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

which is probably the cause of the espcoredump.py error.

Steps to reproduce

Run :

> docker run --rm -v $PWD:/project -w /project -t espressif/idf:latest xtensa-esp32-elf-gdb
> docker run --rm -v $PWD:/project -w /project -t espressif/idf:release-v4.0 xtensa-esp32-elf-gdb
> docker run --rm -v $PWD:/project -w /project -t espressif/idf:release-v4.0 python /opt/esp/idf/components/espcoredump/espcoredump.py info_corefile  /project/device.elf -c /project/coredump.bin -t raw
@github-actions github-actions bot changed the title espcoredump.py & xtensa-esp32-elf-gdb not working in docker espcoredump.py & xtensa-esp32-elf-gdb not working in docker (IDFGH-3297) May 13, 2020
@Alvin1Zhang
Copy link
Collaborator

@vtunr Thanks for reporting, we will look into.

@PaulMichell
Copy link

I have just hit the same error from xtensa-esp32-elf-gdb running on a clean Kubunutu 20.04 with stable esp-idf. It appears to be trying to load python 2.7. This system has 3.8.2 installed by default. Really don't want to have to install 2.7 to be able to run GDB?

@igrr
Copy link
Member

igrr commented May 22, 2020

@vtunr @PaulMichell We will switch to building GDB with Python 3 libraries in the next toolchain release. For now there are two options:

Sorry for the trouble.

@KaeLL
Copy link
Contributor

KaeLL commented Sep 2, 2020

We will switch to building GDB with Python 3 libraries in the next toolchain release.

ETA?

@igrr
Copy link
Member

igrr commented Sep 16, 2020

We will switch to building GDB with Python 3 libraries in the next toolchain release.

This turned out more complex than expected, as libraries for different Python 3.x versions are not binary compatible. So if we build GDB, say, with Python 3.7 libraries, it won't work for users who have 3.8 installed.
It is possible to link Python statically, but that increases the toolchain distributable size.

For now, we have merged #5817 to add libpython2.7 to the docker image. This is also in the process of being backported to other release branches.

espressif-bot pushed a commit that referenced this issue Nov 15, 2020
It was not possible to run xtensa-esp32-elf-gdb from container due to
missing libpython2.7 library.

Merges #5817
Closes #5284
espressif-bot pushed a commit that referenced this issue Dec 21, 2020
It was not possible to run xtensa-esp32-elf-gdb from container due to
missing libpython2.7 library.

Merges #5817
Closes #5284
@KaeLL
Copy link
Contributor

KaeLL commented Jan 5, 2021

It is possible to link Python statically, but that increases the toolchain distributable size.

Bigger toolchain is less worse than a broken one, no?

espressif-bot pushed a commit that referenced this issue Jan 9, 2021
It was not possible to run xtensa-esp32-elf-gdb from container due to
missing libpython2.7 library.

Merges #5817
Closes #5284
projectgus pushed a commit that referenced this issue Mar 12, 2021
It was not possible to run xtensa-esp32-elf-gdb from container due to
missing libpython2.7 library.

Merges #5817
Closes #5284
@espressif-bot espressif-bot added Resolution: Done Issue is done internally Status: Done Issue is done internally labels Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

6 participants