[Crash-utility] modules loaded from wrong directory
Dave Anderson
anderson at redhat.com
Fri Mar 16 14:42:38 UTC 2018
----- Original Message -----
> When trying to run crash 7.2 like this, the 'mod -s $mod' command loads
> the modules from the running system instead of the specified directory:
>
> d=${0%/*}
> tee $t <<_EOF_
> mod -s xen-kbdfront
> mod -s xen_kbdfront
> exit
> _EOF_
>
> strace -f -s 123 -tt -o /dev/shm/crash.trace.txt \
> crash \
> -i $t \
> --mod "${d}" \
> "${d}"/boot/vmlinux-*-default.gz \
> "$1" \
> "${d}"/usr/lib/debug/boot/vmlinux-*-default.debug
>
> In the strace log I see a search for xen_kbdfront.ko, later for
> xen-kbdfront.ko. Unfortunately /lib/modules/`uname -r` is searched before $d.
>
> Now that I read the man page once more I noticed that --mod is just for
> debug info?
Correct.
>
> It seems $d/boot is considered as well, likely because the kernel is
> stored in that directory.
>
> I wonder why there is no option to tell crash to only operate below a
> certain directory when looking for module related things.
> "--mod" seems to have an effect, if the directory exists it is searched.
>
> How can I tell crash to only operate below $d?
>
For a single module whose debuginfo file is not located in one of the
default/standard locations, append the fully-qualified pathname to the
debuginfo file to "mod -s module":
crash> help mod
NAME
mod - module information and loading of symbols and debugging data
SYNOPSIS
mod -s module [objfile] | -d module | -S [directory] [-D|-t|-r|-R|-o|-g]
... [ cut ] ...
-s module [objfile] Loads symbolic and debugging data from the object file
for the module specified. If no objfile argument is
appended, a search will be made for an object file
consisting of the module name with a .o or .ko suffix,
starting at the /lib/modules/<release> directory on
the host system, or if not found there, starting at the
directory containing the kernel namelist file. If an
objfile argument is appended, then that file will be
used.
If the module.ko and module.ko.debug files are separate, you can use the debuginfo
file as the objfile argument.
Dave
More information about the Crash-utility
mailing list