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

debug: disable stack rewind in exception #3067

Merged
merged 1 commit into from
Jun 23, 2020

Conversation

abonislawski
Copy link
Member

@abonislawski abonislawski commented Jun 18, 2020

this will restore functional backtrace for exception stack dump because stack rewind
is not implemented correctly

Example log from coredump (full backtrace):

$2 = "backtrace"
# 0  0xbe050480 in literals ()
# 1  0xbe04306b in memcpy_s (dest=0xbe00881c, dest_size=0, src=0x0, src_size=1)
# 2  0xbe04506e in panic_dump (p=233492486, panic_info=0x4d8, data=0xbe091440)
# 3  0xbe02da65 in exception () at /sof/src/arch/xtensa/include/arch/init.h:40
# 4  0xbe04f3d8 in _GeneralException ()
# 5  0xbe02dfdb in ipc_comp_free (ipc=0x1c, comp_id=4261601243) at /sof/src/ipc/ipc.c:242
# 6  0xbe0306a5 in ipc_glb_tplg_free (header=2651720960, free_func=0xbe02df54 <ipc_comp_free>)
# 7  0xbe0307a5 in ipc_glb_tplg_message (header=805437440) at /sof/src/ipc/handler.c:1239
# 8  0xbe030978 in ipc_cmd (hdr=0x9e0e0d80) at /sof/src/ipc/handler.c:1299
# 9  0xbe045e6a in ipc_platform_do_cmd (data=0x9e0e0d00)
# 10 0xbe04cff1 in schedule_edf_task_run (task=0x9e0e0d20, data=0xbe0e0940)

the idea of stack rewind was to hide first #0-4 entries but it was problematic and in most cases backtrace was not working at all.

In my opinion full backtrace is clear enough and there is no need to modify it.

@abonislawski abonislawski requested a review from mmaka1 June 18, 2020 14:15
@abonislawski abonislawski changed the title debug: disable stack rewind in exception [RFC] debug: disable stack rewind in exception Jun 18, 2020
Copy link
Collaborator

@paulstelian97 paulstelian97 left a comment

Choose a reason for hiding this comment

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

For the few that will be confused by the extra frames, they should just learn to ignore them after taking an educated guess that they are part of the stack dump code itself. This isn't meant to be user readable, only developer readable and it is.

@paulstelian97
Copy link
Collaborator

(also before the hardcoded number 8 was... incorrect even with the given dump; optimizations can also change the number of stack frames via inlining)

this will restore functional backtrace for exception dump because stack rewind
is not implemented correctly

Signed-off-by: Adrian Bonislawski <[email protected]>
@abonislawski abonislawski changed the title [RFC] debug: disable stack rewind in exception debug: disable stack rewind in exception Jun 19, 2020
@lgirdwood
Copy link
Member

SOFCI TEST

@mmaka1 mmaka1 merged commit f4f7263 into thesofproject:master Jun 23, 2020
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.

None yet

5 participants