Bug #3911
mdb is unable to display recursive stack
Start date:
2013-07-26
Due date:
% Done:
0%
Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
Description
mdb truncates the displayed stack in a case there is a recursion detected. This is true for all stack displaying commands I tried (::findstack, ::stack, $C, $c) with one exception: ::stacks seems to work correctly.
To reproduce this issue easily I added some artificial recursion code into the rfs3_lookup() function. Here is the current output of the ::stack command:
> ::stack vpanic() f+0x26() f+0x2f() >
With the fix this is the correct output:
> ::stack vpanic() f+0x26() f+0x2f() f+0x2f() f+0x2f() f+0x2f() f+0x2f() f+0x2f() f+0x2f() f+0x2f() f+0x2f() f+0x2f() f+0x2f() rfs3_lookup+0x60(ffffff0003b507c0, ffffff0003b508b0, ffffff00d333f880, ffffff0003b50af0, ffffff00d0c11db8) common_dispatch+0x384(ffffff0003b50af0, ffffff00cb25ee00, 2, 4, fffffffff83ffe18, ffffffffc014c3d0) rfs_dispatch+0x2d(ffffff0003b50af0, ffffff00cb25ee00) svc_getreq+0x19c(ffffff00cb25ee00, ffffff00d0b2df20) svc_run+0x1d9(ffffff00cafa84b0) svc_do_run+0x81(1) nfssys+0x765(e, fed20fbc) _sys_sysenter_post_swapgs+0x149() >
Related issues
Updated by Marcel Telka over 7 years ago
Root Cause
The problem is in the mdb_amd64_kvm_stack_iter() where there is the explicit check for recursion:
328 if (curpc == pc) 329 break;
Interestingly, there is no such check in other similar functions for ia32 and sparc: mdb_ia32_kvm_stack_iter(), kt_stack_iter(), and mdb_kvm_v9stack_iter().
Updated by Gordon Ross over 7 years ago
- Status changed from Pending RTI to Resolved
commit 21072fc3aa88bec97f3089899d4c2916ac8f0695 Author: Marcel Telka <marcel.telka@nexenta.com> Date: Fri Jul 26 21:06:29 2013 +0200 3911 mdb is unable to display recursive stack Reviewed by: Adam Leventhal <ahl@delphix.com> Reviewed by: Garrett D'Amore <garrett.damore@gmail.com> Reviewed by: Wendy Lin <wendlin1974@gmail.com> Approved by: Gordon Ross <gwr@nexenta.com> :100644 100644 65adaf3... c1bb171... M usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c