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

Make espcoredump more resilient when decoding erroneous thread stack (IDFGH-2802) #4865

Closed
wants to merge 1 commit into from

Conversation

amotl
Copy link
Contributor

@amotl amotl commented Mar 1, 2020

We found that espcoredump would stop decoding all subsequent thread stacks when it hits an error like that on a specific thread stack.

  10   process 1073466144 /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.

This change accounts for that by detecting such a condition and continuing the process appropriately. This helped significantly as espcoredump just decoded thread stacks 19-11 before while it will now also decode thread stacks 9-1, providing valuable additional information.

@github-actions github-actions bot changed the title Make espcoredump more resilient when decoding erroneous thread stack Make espcoredump more resilient when decoding erroneous thread stack (IDFGH-2802) Mar 1, 2020
@Alvin1Zhang Alvin1Zhang requested a review from gerekon March 2, 2020 02:28
@Alvin1Zhang
Copy link
Collaborator

@amotl Thanks for the contribution.

@amotl
Copy link
Contributor Author

amotl commented Mar 2, 2020

Thanks, @Alvin1Zhang.

I also wanted to note that this change also removes the shortcut

if thr_id == cur_thread:
    continue

when iterating the threads as I found it convenient to have all thread stacks printed within the "THREADS INFO" section of the output. I didn't see a reason why to omit the particular "current thread" within that output.

@gerekon
Copy link
Collaborator

gerekon commented Mar 3, 2020

Thanks, @Alvin1Zhang.

I also wanted to note that this change also removes the shortcut

if thr_id == cur_thread:
    continue

when iterating the threads as I found it convenient to have all thread stacks printed within the "THREADS INFO" section of the output. I didn't see a reason why to omit the particular "current thread" within that output.

Because it is printed at the beginning of the core dump, see the very first back trace https://github.com/espressif/esp-idf/blob/master/components/espcoredump/espcoredump.py#L1615-L1623

Copy link
Collaborator

@gerekon gerekon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, except for the comment below

components/espcoredump/espcoredump.py Show resolved Hide resolved
@alisitsyn
Copy link
Collaborator

Hi @amotl,
Thank you for your PR.
Unfortunately it was not possible to reproduce error similar to your with GNU gdb (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a5) 7.10.

10 process 1073466144 /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.

Your changes are under review and will be merged as soon as possible.

@amotl
Copy link
Contributor Author

amotl commented Mar 5, 2020

Hi @alisitsyn,

as we learned from #2892, we are using the -98- toolchain instead of -80-.

./xtensa-esp32-elf-gcc --version
xtensa-esp32-elf-gcc (crosstool-NG crosstool-ng-1.22.0-98-g4638c4f) 5.2.0
./xtensa-esp32-elf-gdb --version
GNU gdb (crosstool-NG crosstool-ng-1.22.0-98-g4638c4f) 7.10

Just in this second we see this toolchain might have been made of two different GNUs (5.2.0 vs. 7.10)?

Cheers,
Andreas.

@CLAassistant
Copy link

CLA assistant check
All committers have signed the CLA.

@amotl
Copy link
Contributor Author

amotl commented Mar 23, 2020

Dear Alexey,

so do you believe this will be fine? I just wanted to make sure that I didn't miss anything and you are waiting for some changes of mine.

With kind regards,
Andreas.

@alisitsyn
Copy link
Collaborator

alisitsyn commented Mar 23, 2020

Dear Andreas,

Everything is correct, your PR reviewed and should be merged to github very soon. I appologize for the delay with answer.

@igrr
Copy link
Member

igrr commented Mar 29, 2020

Merged in dde4d2e, thanks for the contribution!

@igrr igrr closed this Mar 29, 2020
@amotl
Copy link
Contributor Author

amotl commented Mar 29, 2020

Thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants