Bug #7687
mdb cross-module dcmd calls fail in CTF lookup
100%
Description
The mdb module for smbsrv fails in "smbreq -v" after #3467 with:
> ffffff01dd308390 ::smbreq -v SMB request information (ffffff01dd308390): first SMB COM: 160 (SMB_COM_NT_TRANSACT) current SMB COM: 160 (SMB_COM_NT_TRANSACT) state: 5 (WAITING_FCN1) TID(tree): 2 (ffffff01dd911060) UID(user): 1 (ffffff01dcdc8938) FID(file): 1 (ffffff01dd861be8) PID: 6768 MID: 0x481 waiting time: 0 running time: 20 worker thread: 0 mdb: couldn't find ctf data for type mdb_findstack_kthread_t in mdb module smbsrv
Updated by Gordon Ross about 4 years ago
The problem is in this call:
http://src.illumos.org/source/xref/illumos-gate/usr/src/cmd/mdb/common/modules/smbsrv/smbsrv.c#2544
mdb_call_dcmd("findstack", addr, DCMD_ADDRSPEC, 1, &cmdarg);
where in the call to mdb_ctf_vread, we find a module here:
http://src.illumos.org/source/xref/illumos-gate/usr/src/cmd/mdb/common/mdb/mdb_ctf.c#1609
and the module has CTF data, but the module returned by mdb_get_module is the "smbsrv"
module. We're running the "genunix`findstack" dcmd here, so that's wrong.
In general, the two calls to mdb_call_idcmd in mdb_modapi.c need to handle
cases were one mdb module is calling a dcmd in another mdb module.
This appears to be a regression after #3467 where findstack started using
mdb_ctf_vread.
I have a fix that makes the two callers of mdb_call_idcmd in mdb_modapi.c setup a
more correct mdb.m_frame->f_cp (with a command representing the dcmd that's
being called). That seems to work.
I also considered pushing a new mdb "frame" there, but that seems unnecessary.
Out for review: https://www.illumos.org/rb/r/304/
Updated by Gordon Ross about 4 years ago
- Subject changed from mdb dcmds fail in CTF lookup after #3467 to mdb cross-module dcmd calls fail in CTF lookup
Updated by Electric Monk about 4 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
git commit ab2e2ee8084b5368a6eff4d96fbad03a661c8ace
commit ab2e2ee8084b5368a6eff4d96fbad03a661c8ace Author: Gordon Ross <gwr@nexenta.com> Date: 2017-01-14T15:37:37.000Z 7687 mdb cross-module dcmd calls fail in CTF lookup Reviewed by: Evan Layton <evan.layton@nexenta.com> Reviewed by: Matt Barden <matt.barden@nexenta.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Approved by: Dan McDonald <danmcd@omniti.com>