esp-idf: xtensa-esp32-elf-gdb crash (IDFGH-353)

Environment

  • Development Kit: noname
  • Core (if using chip or module): ESP-WROOM-32
  • IDF version (git rev-parse --short HEAD to get the commit id.): 30545f4c
  • Development Env: Eclipse
  • Operating System: Ubuntu
  • Power Supply: USB (5v via JTAG)

Problem Description

Debugger crashes when I try to debug my problem.

Expected Behavior

Debug my program.

Actual Behavior

Crash with error message.

Steps to repropduce

It is pretty complicated in my case…

Debug Logs

GNU gdb (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a) 7.10
Copyright (C) 2015 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 "--host=x86_64-build_pc-linux-gnu --target=xtensa-esp32-elf".
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".


[New Remote target]

[New Thread 1073451264]
[New Thread 1073449364]
[New Thread 1073453920]
[New Thread 1073437004]
[New Thread 1073412744]
[New Thread 1073435616]
[New Thread 1073438136]
[Switching to Thread 1073447248]

Temporary breakpoint 5, app_main () at /home/v/compile/esp32-sound-vorbis-test/main/main.cpp:73
73	extern "C" void app_main(void) {

[New Thread 1073555376]
[Switching to Thread 1073555376]

Breakpoint 1, SoundVorbis::SoundProviderVorbis::task_code (this=0x3ffbdf80) at /home/v/compile/esp32-sound-vorbis-test/components/esp32-sound-vorbis/soundProviderVorbis.cpp:133
133			std::unique_lock<std::mutex> heapLock(heapUsed);
[Switching to Thread 1073412744]

Breakpoint 2, Sound::SoundMixer::soundCallback (this=0x3ffba148) at /home/v/compile/esp32-sound-vorbis-test/components/esp32-sound/soundMixer.cpp:170
170								if (sound->repeat) {
[Switching to Thread 1073555376]

Breakpoint 1, SoundVorbis::SoundProviderVorbis::task_code (this=0x3ffbdf80) at /home/v/compile/esp32-sound-vorbis-test/components/esp32-sound-vorbis/soundProviderVorbis.cpp:133
133			std::unique_lock<std::mutex> heapLock(heapUsed);
[Switching to Thread 1073412744]

Breakpoint 2, Sound::SoundMixer::soundCallback (this=0x3ffba148) at /home/v/compile/esp32-sound-vorbis-test/components/esp32-sound/soundMixer.cpp:170
170								if (sound->repeat) {
[Switching to Thread 1073555376]

Breakpoint 1, SoundVorbis::SoundProviderVorbis::task_code (this=0x3ffbdf80) at /home/v/compile/esp32-sound-vorbis-test/components/esp32-sound-vorbis/soundProviderVorbis.cpp:133
133			std::unique_lock<std::mutex> heapLock(heapUsed);
[Switching to Thread 1073412744]

Breakpoint 2, Sound::SoundMixer::soundCallback (this=0x3ffba148) at /home/v/compile/esp32-sound-vorbis-test/components/esp32-sound/soundMixer.cpp:170
170								if (sound->repeat) {
[Switching to Thread 1073555376]

Breakpoint 1, SoundVorbis::SoundProviderVorbis::task_code (this=0x3ffbdf80) at /home/v/compile/esp32-sound-vorbis-test/components/esp32-sound-vorbis/soundProviderVorbis.cpp:133
133			std::unique_lock<std::mutex> heapLock(heapUsed);
[Switching to Thread 1073412744]

Breakpoint 2, Sound::SoundMixer::soundCallback (this=0x3ffba148) at /home/v/compile/esp32-sound-vorbis-test/components/esp32-sound/soundMixer.cpp:170
170								if (sound->repeat) {
/builds/idf/crosstool-NG/.build/src/gdb-7.10/gdb/inline-frame.c:171: internal-error: inline_frame_this_id: Assertion `!frame_id_eq (*this_id, outer_frame_id)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]

This is a bug, please report it.  For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.

/builds/idf/crosstool-NG/.build/src/gdb-7.10/gdb/inline-frame.c:171: internal-error: inline_frame_this_id: Assertion `!frame_id_eq (*this_id, outer_frame_id)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]

Other items if possible

None.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 41 (22 by maintainers)

Commits related to this issue

Most upvoted comments

@loceur You example works well for me. I used:

  1. IDF’s github master
  2. Your sdkconfig
  3. gcc version 5.2.0 (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a)
  4. Open On-Chip Debugger 0.10.0-dev (2018-09-20-12:54)
  5. Board: ESP32 WROVER KIT

What I really want to do is to disable all inline expansions for debugging. The Og switch obviously doesn’t do that, so what’s needed is an O0 switch. Is that what you are working on? Is there a way of doing it manually?

If not, is there a way of passing ‘-fno-inline-small-functions’ to gcc?

‘attribute ((noinline))’ doesn’t work … in that dbg still crashes.

Do you have an estimate of when this will be fixed?

(Also, is there anywhere to see a summary of current serious problems (like this one), with a workaround if applicable and a fix schedule? At the moment what I’m doing is stumbling on bugs and spending a lot of time (with help from you guys, for sure!) figuring out if it’s my fault or not and what to do about it. It’s a terrible (but avoidable) waste of time and energy.)