not able to load my module symbols in crash utility - debugging

I am facing issue while debugging vmcore with crash on centos7. I am not able to load my module symbols.
sudo crash ../vmlinux-3.10.0-123.el7.x86_64 vmcore
KERNEL: ../vmlinux-3.10.0-123.el7.x86_64
DUMPFILE: vmcore [PARTIAL DUMP]
CPUS: 1
DATE: Tue Aug 18 14:53:54 2015
UPTIME: 20:33:05
LOAD AVERAGE: 2.39, 1.21, 0.61
TASKS: 340
NODENAME: localhost.localdomain
RELEASE: 3.10.0-123.el7.x86_64
VERSION: #1 SMP Mon Jun 30 12:09:22 UTC 2014
MACHINE: x86_64 (3092 Mhz)
MEMORY: 1.2 GB
PANIC: "Oops: 0002 [#1] SMP " (check log for details)
PID: 8327
COMMAND: "cat"
TASK: ffff8800279a6660 [THREAD_INFO: ffff880002ade000]
CPU: 0
STATE: TASK_RUNNING (PANIC)
crash> mod -s ext4
MODULE NAME SIZE OBJECT FILE
ffffffffa016f320 ext4 528957 /lib/modules/3.10.0-123.el7.x86_64/kernel/fs/ext4/ext4.ko
crash> ls
ioctal-drv.ko vmcore vmcore-dmesg.txt
crash> mod -s ./ioctal-drv.ko
Usage:
mod -s module [objfile] | -d module | -S [directory] [-D|-t|-r|-R|-o|-g]
Enter "help mod" for details.
crash> mod -s ioctal-drv.ko
Usage:
mod -s module [objfile] | -d module | -S [directory] [-D|-t|-r|-R|-o|-g]
Enter "help mod" for details.
$ ls -a /sys/module/ioctal_drv/sections/
. .. .bss .data .gnu.linkonce.this_module __mcount_loc .note.gnu.build-id .rodata .rodata.str1.1 .rodata.str1.8 .strtab .symtab .text
Could any one tell me why i am not able to load module symbols? Thanks

Related

powershell with VHDL questasim 2020.4 won't accept full path to arguments file under powershell

Anybody know what's causing this problem? I'm trying to provided the full path to vcom.exe from powershell and vcom is removing the forward slashes:
PS> C:\questasim64_2020.4\win64\vcom.exe -2002 -f "C:/proj1/rtl/files.f"
QuestaSim-64 vcom 2020.4 Compiler 2020.10 Oct 13 2020
Start time: 08:46:02 on Jan 10,2022
vcom.exe -2002 -f "C:/proj1/rtl/files.f
** Error: (vcom-7) Failed to open design unit file "C:proj1rtlfiles.f" in read mode.
No such file or directory. (errno = ENOENT)
End time: 08:46:02 on Jan 10,2022, Elapsed time: 0:00:00
Errors: 1, Warnings: 0
cmd.exe has the same problem:
PS C:\proj1> cmd
Microsoft Windows [Version 10.0.19043.1202]
(c) Microsoft Corporation. All rights reserved.
C:\proj1> C:\questasim64_2020.4\win64\vcom.exe -2002 -l simout.vhdl.log -f C:/proj1/rtl/files.f
QuestaSim-64 vcom 2020.4 Compiler 2020.10 Oct 13 2020
Start time: 08:46:02 on Jan 10,2022
vcom.exe -2002 -f "C:/proj1/rtl/files.f
** Error: (vcom-7) Failed to open design unit file "C:proj1rtlfiles.f" in read mode.
No such file or directory. (errno = ENOENT)
End time: 08:46:02 on Jan 10,2022, Elapsed time: 0:00:00
Errors: 1, Warnings: 0
I don't remember this ever being a problem before with mentor graphics... seems like kind of a bad bug?
I tried it again using WSL-2 and Ubuntu under Windows 10:
PS> gci C:\Users\wpmoore\Desktop\collins\sandbox\sandbox.vsc.tbwork\out.sim\simout.work.vhd.f
-a---- 1/11/2022 12:28 PM 163 simout.work.vhd.f
PS> bash
$ uname -a
Linux PV3013 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ /mnt/c/questasim64_2020.4/win64/vcom.exe -2002 -l simout.vhdl.log -f " C:/Users/wpmoore/Desktop/collins/sandbox/sandbox.vsc.tbwork/out.sim/simout.work.vhd.f"
** Error: (vcom-7) Failed to open -f file " C:/Users/wpmoore/Desktop/collins/sandbox/sandbox.vsc.tbwork/out.sim/simout.work.vhd.f" in read mode.
Invalid argument. (errno = EINVAL)
QuestaSim-64 vcom 2020.4 Compiler 2020.10 Oct 13 2020
vcom -2002 -l simout.vhdl.log -f C:/Users/wpmoore/Desktop/collins/sandbox/sandbox.vsc.tbwork/out.sim/simout.work.vhd.f
End time: 12:30:28 on Jan 11,2022, Elapsed time: 0:00:00
Errors: 1, Warnings: 0
$ /mnt/c/questasim64_2020.4/win64/vcom.exe -2002 -l simout.vhdl.log -f "C:\\Users\\wpmoore\\Desktop\\collins\\sandbox\\sandbox.vsc.tbwork\\out.sim\\simout.work.vhd.f"
QuestaSim-64 vcom 2020.4 Compiler 2020.10 Oct 13 2020
Start time: 12:32:18 on Jan 11,2022
vcom -2002 -l simout.vhdl.log -f C:\Users\wpmoore\Desktop\collins\sandbox\sandbox.vsc.tbwork\out.sim\simout.work.vhd.f
** Error: (vcom-7) Failed to open design unit file "C:UserswpmooreDesktopcollinssandboxsandbox.vsc.tbworktb_pack2.vhd" in read mode.
No such file or directory. (errno = ENOENT)
End time: 12:32:19 on Jan 11,2022, Elapsed time: 0:00:01
Errors: 1, Warnings: 0
The solution is to use only "Forward slashes" when specifying the path to "-f" file, and also, for the files listed inside of the "-f" file. Then it works with both powershell.exe and cmd.exe.
Example:
-f C:/mypath/dir1/dir2/file.f
# content of file.f:
C:/mypath/dir1/dir2/code.vhd
C:/mypath/dir1/dir2/code.v
The older Windows Backslashes in the path doesn't work for vsim for latest questasim... (which in my opinion is a serious bug for software claiming to work under windows)

Firefox not recgonising CA cert added with certuil

I'm trying to programmatically accept a CA certificate on a newly installed ubuntu 18.04.
The user does not have a ~/.mozilla folder when I run this script.
sudo apt install libnss3-tools
rm -rf /home/${USER}/.mozilla/
installId="4F96D1932A9F858E" # hash of firefox install location
defaultProfileId=$(openssl rand -hex 4)
releaseProfileId=$(openssl rand -hex 4)
certificateFile="/home/${USER}/hcp-ca-cert.pem"
certificateName="HCP CA Cert"
#########
certDir="/home/${USER}/.mozilla/firefox/${defaultProfileId}.default"
mkdir -p $certDir
certutil -A -n "${certificateName}" -t "TCu,Cu,Tu" -i "${certificateFile}" -d "${certDir}"
certDir="/home/${USER}/.mozilla/firefox/${releaseProfileId}.default-release"
mkdir -p $certDir
certutil -A -n "${certificateName}" -t "TCu,Cu,Tu" -i "${certificateFile}" -d "${certDir}"
#########
cat << EOF >> /home/${USER}/.mozilla/firefox/profiles.ini
[Install${installId}]
Default=${defaultProfileId}.default
Locked=1
[Profile1]
Name=default
IsRelative=1
Path=${defaultProfileId}.default
Default=1
[Profile0]
Name=default-release
IsRelative=1
Path=${releaseProfileId}.default
[General]
StartWithLastProfile=1
Version=2
EOF
#########
cat << EOF >> /home/${USER}/.mozilla/firefox/installs.ini
[${installId}]
Default=${releaseProfileId}.default-release
Locked=1
EOF
This creates the profiles, e.g.
ubuntu#ip-10-1-0-121:~$ certutil -L -d .mozilla/firefox/d8cfb77c.default/
Certificate Nickname Trust Attributes
SSL,S/MIME,JAR/XPI
HCP CA Cert CT,C,c
and
ubuntu#ip-10-1-0-121:~$ certutil -L -d .mozilla/firefox/d8cfb77c.default/
Certificate Nickname Trust Attributes
SSL,S/MIME,JAR/XPI
HCP CA Cert CT,C,c
However, if I attempt to browse a site using the CA, I get the error invalid certificate:
Error code: SEC_ERROR_UNKNOWN_ISSUER
If I manually import the CA certificate into firefox's trusted authorities, the site loads fine without validation errors.
Update:
Looking at the file access times, it seems that when I open firefox, it is creating a new file 'cert9.db':
ubuntu#ip-10-1-0-121:~$ ll .mozilla/firefox/bf0a1f94.default-release/*.db
-rw------- 1 ubuntu ubuntu 65536 Apr 1 09:12 .mozilla/firefox/bf0a1f94.default-release/cert8.db
-rw------- 1 ubuntu ubuntu 16384 Apr 1 09:12 .mozilla/firefox/bf0a1f94.default-release/key3.db
-rw------- 1 ubuntu ubuntu 16384 Apr 1 09:12 .mozilla/firefox/bf0a1f94.default-release/secmod.db
and
ubuntu#ip-10-1-0-121:~$ ll .mozilla/firefox/d8cfb77c.default/*.db
-rw------- 1 ubuntu ubuntu 65536 Apr 1 09:12 .mozilla/firefox/d8cfb77c.default/cert8.db
-rw------- 1 ubuntu ubuntu 229376 Apr 1 09:33 .mozilla/firefox/d8cfb77c.default/cert9.db
-rw------- 1 ubuntu ubuntu 16384 Apr 1 09:12 .mozilla/firefox/d8cfb77c.default/key3.db
-rw------- 1 ubuntu ubuntu 294912 Apr 1 09:33 .mozilla/firefox/d8cfb77c.default/key4.db
The file size of cert9 suggests that this includes a bunch of CAs.
The solution was to prefix the certDir with sql:
certutil -A -n "${certificateName}" -t "TCu,Cu,Tu" -i "${certificateFile}" -d "sql:${certDir}"

Memory usage per process

How can one see the output of the memory usage per process in Windows using bash (Git bash) and without any additional tools installation?
I read about top command but there is no such thing in the default version of bash. Also, I have read about ps but it does not give the memory usage at all as in some examples I have seen (maybe some version has been changed).
Since Linux processes in WSL run in a container (conceptually similar to Docker), they can only see processes in the same container, nothing else.
You can see the virtual and resident size of processes in WSL by issuing the following command:
ps -eHww -o uid,pid,ppid,psr,vsz,rss,stime,time,cmd
Outputs:
max#supernova:~$ uname -a
Linux supernova 4.4.0-17763-Microsoft #379-Microsoft Wed Mar 06 19:16:00 PST 2019 x86_64 x86_64 x86_64 GNU/Linux
max#supernova:~$ ps -eHww -o uid,pid,ppid,psr,vsz,rss,stime,time,cmd
UID PID PPID PSR VSZ RSS STIME TIME CMD
0 1 0 0 8324 156 23:36 00:00:00 /init
0 3 1 0 8328 156 23:36 00:00:00 /init
1000 4 3 0 16796 3424 23:36 00:00:00 -bash
1000 35 4 0 17084 1716 23:57 00:00:00 ps -eHww -o uid,pid,ppid,psr,vsz,rss,stime,time,cmd

Why is 2700x slower than i7-6700 in redis benchmark?

I don't understand why is 2700x slower than i7-6700 in redis benchmark?
What else should I add?
Below are my tests.
1st system
OS : CentOS Linux release 7.6.1810 (Core)
Linux localhost.localdomain 5.2.8-1.el7.elrepo.x86_64 #1 SMP Fri Aug 9 13:40:33 EDT 2019 x86_64 x86_64 x86_64 GNU/Linux
CPU : AMD Ryzen 7 2700X Eight-Core Processor (pinnacle ridge 2700x)
RAM : 16GiB DIMM DDR4 Synchronous Unbuffered (Unregistered) 3000 MHz (0.3 ns) * 2
[root#localhost ~]# redis-cli --latency
min: 0, max: 1, avg: 0.21 (5042 samples)
[root#localhost ~]# redis-benchmark -h 127.0.0.1 -p 6379 -n 100000 -t set -q
SET: 110619.47 requests per second
[root#localhost ~]# redis-benchmark -h 127.0.0.1 -p 6379 -n 100000 -t get -q
GET: 138504.16 requests per second
2nd system
OS : CentOS release 6.7 (Final)
Linux dmlocalhost.localdoamin 2.6.32-573.22.1.el6.x86_64 #1 SMP Wed Mar 23 03:35:39 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
CPU : Intel(R) Core(TM) i7-6700 CPU # 3.40GHz
RAM : 16GiB DIMM Synchronous 2133 MHz (0.5 ns)
[root#dmvault ~]# redis-cli --latency
min: 0, max: 1, avg: 0.11 (5038 samples)
[root#dmvault ~]# redis-benchmark -h 127.0.0.1 -p 6379 -n 100000 -t set -q
SET: 248138.95 requests per second
[root#dmvault ~]# redis-benchmark -h 127.0.0.1 -p 6379 -n 100000 -t get -q
GET: 244498.77 requests per second

kexec -l then kexec -e will enter into the 2nd kernel successfully, but kexec -p then crash will fail and stuck

As the title describes, kexec -l then kexec -e will enter into the 2nd kernel successfully, but kexec -p then crash will fail and stuck when I try to setup kdump and kexec on my laptop (Linux will-ThinkPad-L470 4.13.0-rc5 #3 SMP PREEMPT Wed Aug 23 16:11:24 CST 2017 x86_64 x86_64 x86_64 GNU/Linux). The commands are:
kexec -p /boot/vmlinuz-4.13.0-rc5 --initrd=/boot/initrd.img-4.13.0-rc5 -d --reuse-cmdline
Then, if I echo c > /proc/sysrq-trigger, the machine will panic and stuck.
But the kexec -l will success.
kexec -l /boot/vmlinuz-4.13.0-rc5 --initrd=/boot/initrd.img-4.13.0-rc5 -d --reuse-cmdline --append="will"
kexec -e
Then I will get the "will" in the /proc/cmdline of the 2nd kernel.
Does anyone have idea about this ?

Resources