iysheng

  • 2024-08-23
  • 回复了主题帖: 《黑神话 悟空》是由什么语言编写的?

    c++也是很难的

  • 2024-07-15
  • 回复了主题帖: (已结束)1个掉了按键焊盘的瑞萨RA8D1板卡,能修的网友来拿

    嘿嘿,这是坏了多少块?

  • 2024-06-17
  • 回复了主题帖: KiCAD焊盘外侧的线条是什么意思?

    有关这个问题,我之前提过一个问题贴:What's the meaning of the red circle? - Layout / Footprints - KiCad.info Forums,希望对你有所帮助。

  • 2024-06-14
  • 回复了主题帖: 据说雅特力搞了个ide,据说gd也有。不知道怎么样 ?

    nxp 有 IDE 也是根据 eclipse 的。

  • 2024-05-12
  • 发表了主题帖: 【2023 DigiKey大赛参与奖】开箱帖 RaspberryPI 3B+ 和 ESP32C3

    前段时间查看邮件发现获得了参与奖,可以报销300的费用,就去得捷下单了 RaspberryPI 3B+ 和 ESP32C3 ,今天收到货了,上图开箱看看。      

  • 2024-05-05
  • 回复了主题帖: 《奔跑吧Linux内核(第2版)卷2:调试与案例分析》- 搭建 qemu + kdump 调试环境

    这个问题通过更换工具链从 11.2.1 到低版本 9.3.0 的方法解决了,具体详看 https://bbs.eeworld.com.cn/thread-1280374-1-1.html。

  • 发表了主题帖: 《奔跑吧Linux内核(第2版)卷2:调试与案例分析》- qemu + kdump 调试分析

    通过更换工具链的方法修复了,编译内核后无法正常在 qemu 的 debian 环境中使用 crash 调试的问题。 之前的工具链是 ▸ aarch64-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=/bin/aarch64-linux-gnu-gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/aarch64-linux-gnu/11/lto-wrapper Target: aarch64-linux-gnu Configured with: ../gcc-11.2.1-20210728/configure --bindir=/usr/bin --build=x86_64-redhat-linux-gnu --datadir=/usr/share --disable-decimal-float --disable-dependency-tracking --disable-gold --disable-libgcj --disable-libgomp --disable-libmpx --disable-libquadmath --disable-libssp --disable-libunwind-exceptions --disable-shared --disable-silent-rules --disable-sjlj-exceptions --disable-threads --with-ld=/usr/bin/aarch64-linux-gnu-ld --enable-__cxa_atexit --enable-checking=release --enable-gnu-unique-object --enable-initfini-array --enable-languages=c,c++ --enable-linker-build-id --enable-lto --enable-nls --enable-obsolete --enable-plugin --enable-targets=all --exec-prefix=/usr --host=x86_64-redhat-linux-gnu --includedir=/usr/include --infodir=/usr/share/info --libexecdir=/usr/libexec --localstatedir=/var --mandir=/usr/share/man --prefix=/usr --program-prefix=aarch64-linux-gnu- --sbindir=/usr/sbin --sharedstatedir=/var/lib --sysconfdir=/etc --target=aarch64-linux-gnu --with-bugurl=http://bugzilla.redhat.com/bugzilla/ --with-gcc-major-version-only --with-isl --with-newlib --with-plugin-ld=/usr/bin/aarch64-linux-gnu-ld --with-sysroot=/usr/aarch64-linux-gnu/sys-root --with-system-libunwind --with-system-zlib --without-headers --enable-gnu-indirect-function --with-linker-hash-style=gnu Thread model: single Supported LTO compression algorithms: zlib zstd gcc version 11.2.1 20210728 (Red Hat Cross 11.2.1-1) (GCC) 更换的工具链是 ▸ ./aarch64-linux-gcc -v Using built-in specs. COLLECT_GCC=/home/red/.local/bin/m3568-sdk-v1.0.0-ga/gcc-buildroot-9.3.0-2020.03-x86_64_aarch64-rockchip-linux-gnu/bin/aarch64-linux-gcc.br_real COLLECT_LTO_WRAPPER=/home/red/.local/bin/m3568-sdk-v1.0.0-ga/gcc-buildroot-9.3.0-2020.03-x86_64_aarch64-rockchip-linux-gnu/bin/../libexec/gcc/aarch64-rockchip-linux-gnu/9.3.0/lto-wrapper Target: aarch64-rockchip-linux-gnu Configured with: ./configure --prefix=/home/yhx/RK356X/SDK/buildroot/output/rockchip_toolchain/host --sysconfdir=/home/yhx/RK356X/SDK/buildroot/output/rockchip_toolchain/host/etc --enable-static --target=aarch64-rockchip-linux-gnu --with-sysroot=/home/yhx/RK356X/SDK/buildroot/output/rockchip_toolchain/host/aarch64-rockchip-linux-gnu/sysroot --enable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib --disable-decimal-float --with-gmp=/home/yhx/RK356X/SDK/buildroot/output/rockchip_toolchain/host --with-mpc=/home/yhx/RK356X/SDK/buildroot/output/rockchip_toolchain/host --with-mpfr=/home/yhx/RK356X/SDK/buildroot/output/rockchip_toolchain/host --with-pkgversion='Buildroot 2018.02-rc3-g548dfbfc13-dirty' --with-bugurl=http://bugs.buildroot.net/ --disable-libquadmath --enable-tls --enable-plugins --enable-lto --enable-threads --with-isl=/home/yhx/RK356X/SDK/buildroot/output/rockchip_toolchain/host --with-abi=lp64 --with-cpu=cortex-a55 --enable-languages=c,c++ --with-build-time-tools=/home/yhx/RK356X/SDK/buildroot/output/rockchip_toolchain/host/aarch64-rockchip-linux-gnu/bin --enable-shared --enable-libgomp Thread model: posix gcc version 9.3.0 (Buildroot 2018.02-rc3-g548dfbfc13-dirty) 重新编译内核,rootfs,之后再次启动,加载 oops.ko 导致系统重启,然后使用 crash 工具调试, benshushu:crash# crash 202405050433/dump.202405050433 /mnt/vmlinux crash 7.2.5 Copyright (C) 2002-2019 Red Hat, Inc. Copyright (C) 2004, 2005, 2006, 2010 IBM Corporation Copyright (C) 1999-2006 Hewlett-Packard Co Copyright (C) 2005, 2006, 2011, 2012 Fujitsu Limited Copyright (C) 2006, 2007 VA Linux Systems Japan K.K. Copyright (C) 2005, 2011 NEC Corporation Copyright (C) 1999, 2002, 2007 Silicon Graphics, Inc. Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc. This program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Enter "help copying" to see the conditions. This program has absolutely no warranty. Enter "help warranty" for details. GNU gdb (GDB) 7.6 Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "aarch64-unknown-linux-gnu"... KERNEL: /mnt/vmlinux DUMPFILE: 202405050433/dump.202405050433 [PARTIAL DUMP] CPUS: 4 DATE: Sun May 5 04:32:52 2024 UPTIME: 2135039823346 days, 00:17:08 LOAD AVERAGE: 2.13, 1.04, 0.41 TASKS: 91 NODENAME: benshushu RELEASE: 5.0.0+ VERSION: #2 SMP Sun May 5 12:19:45 CST 2024 MACHINE: aarch64 (unknown Mhz) MEMORY: 1 GB PANIC: "Unable to handle kernel NULL pointer dereference at virtual address 0000000000000050" PID: 1931 COMMAND: "insmod" TASK: ffff800023936200 [THREAD_INFO: ffff800023936200] CPU: 1 STATE: TASK_RUNNING (PANIC) crash> 看着比较顺利,加载 oops.ko 继续调试,就又出新的问题了 crash> mod -s oops /mnt/rlk_lab/rlk_senior/Volume_2/chapter_8/lab01/oops.ko MODULE NAME SIZE OBJECT FILE ffff0000098e2040 oops 16384 /mnt/rlk_lab/rlk_senior/Volume_2/chapter_8/lab01/oops.ko crash> bt PID: 1931 TASK: ffff800023936200 CPU: 1 COMMAND: "insmod" #0 [ffff800023bcecb0] machine_kexec at ffff0000100dbf18 #1 [ffff800023bcedd0] __crash_kexec at ffff00001037a120 #2 [ffff800023bcef60] crash_kexec at ffff00001037a370 #3 [ffff800023bcf030] die at ffff0000100adb34 #4 [ffff800023bcf170] die_kernel_fault at ffff0000100e6494 #5 [ffff800023bcf1a0] __do_kernel_fault at ffff0000100e66b8 #6 [ffff800023bcf220] do_page_fault at ffff0000118d7eb0 #7 [ffff800023bcf490] do_translation_fault at ffff0000118d7fc0 #8 [ffff800023bcf4f0] do_mem_abort at ffff000010081274 #9 [ffff800023bcf660] el1_ia at ffff0000100858cc #10 [ffff800023bcf670] create_oops at ffff0000098e0018 [oops] #11 [ffff800023bcf6a0] _MODULE_INIT_START_oops at ffff0000098e509c [oops] #12 [ffff800023bcf720] do_one_initcall at ffff000010087f34 #13 [ffff800023bcf970] do_init_module at ffff00001036ed40 #14 [ffff800023bcf9d0] load_module at ffff00001036fd34 #15 [ffff800023bcfba0] __se_sys_finit_module at ffff000010370368 #16 [ffff800023bcfc80] __arm64_sys_finit_module at ffff000010370218 #17 [ffff800023bcfca0] __invoke_syscall at ffff0000100c1400 #18 [ffff800023bcfcc0] invoke_syscall at ffff0000100c14ac #19 [ffff800023bcfd30] el0_svc_common at ffff0000100c15e0 #20 [ffff800023bcfdd0] el0_svc_handler at ffff0000100c1adc #21 [ffff800023bcfff0] el0_svc at ffff000010086784 PC: 0000ffff94c48ec4 LR: 0000aaaad1edba18 SP: 0000ffffc520a3e0 X29: 0000ffffc520a3e0 X28: 0000000000000000 X27: 0000000000000000 X26: 0000000000000002 X25: 0000000000000000 X24: 0000ffffc520a4b8 X23: 0000aaaae9b0a8a0 X22: 0000000000000000 X21: 0000000000000000 X20: 0000aaaad1ee5640 X19: 0000aaaae9b0a8f0 X18: 0000000000000000 X17: 0000ffff94c48ea0 X16: 0000aaaad1efcdb0 X15: 0000000000000040 X14: 0000000000000000 X13: 0000000000000000 X12: 0000000000000000 X11: 0000000000000000 X10: 0000ffff94ce3ae0 X9: 0000000000000002 X8: 0000000000000111 X7: 0000000000000001 X6: 0000000000000001 X5: 0000000000000218 X4: 0000000000000000 X3: 0000000000000003 X2: 0000000000000000 X1: 0000aaaad1ee5640 X0: 0000000000000003 ORIG_X0: 0000000000000003 SYSCALLNO: 111 PSTATE: 40001000 这部分内容的打印和树上的描述有少许差别,打印出来的 PC 指针并不是 oops 驱动崩溃的位置,我尝试使用 dis -l 查看这个地址得到下面的结果: crash> dis -l 0000ffff94c48ec4 dis: WARNING: ffff94c48ec4: no associated kernel symbol found 0xffff94c48ec4: Cannot access memory at address 0xffff94c48ec4 这个应该是什么原因呢?奇怪哦。

  • 发表了主题帖: 《奔跑吧Linux内核(第2版)卷2:调试与案例分析》- 搭建 qemu + kdump 调试环境

    本帖最后由 iysheng 于 2024-5-5 11:57 编辑 经过几天的假期,今天继续板砖,前段时间尝试在 bbb 上搭建 kdump 的环境,怎奈一波三折,今天尝试搭建 qemu 的开发环境,初期过程还是比较顺利,但是到 crash 调试的时候又出了问题。 前面就是参考书上的描述: 1. 下载仓库(https://e.coding.net/benshushu/runninglinuxkernel_5.0/runninglinuxkernel_5.0.git)[https://e.coding.net/benshushu/runninglinuxkernel_5.0/runninglinuxkernel_5.0.git]。 2. 通过脚本编译内核,./run_debian_arm64.sh build_kernel 3. 通过脚本编译 rootfs,sudo ./run_debian_arm64.sh build_rootfs 4. 通过脚本启动内核,./run_debian_arm64.sh run     在测试 5.2 节的案例一,一个简单的宕机案例的时候又出问题了,虽然可以正常触发 kdump 并重启系统,   但是我尝试使用 crash 工具的时候,提示我下面的错误: 尝试 apt update 更新系统,发现也出问题:  

  • 2024-04-26
  • 回复了主题帖: 《奔跑吧Linux内核(第2版)卷2:调试与案例分析》- 在 bbb 上实践 kdump 调试问题

    添加了 nr_cpus=1 到 bootcmd,还是不行。

  • 2024-04-25
  • 回复了主题帖: 《奔跑吧Linux内核(第2版)卷2:调试与案例分析》- 在 bbb 上实践 kdump 调试问题

    晚上回来试一下

  • 2024-04-22
  • 回复了主题帖: 《奔跑吧Linux内核(第2版)卷2:调试与案例分析》- 在 bbb 上实践 kdump 调试问题

    LitchiCheng 发表于 2024-4-22 10:51 cmdline的保留内存分配小一点 尝试了一下到 64MB 还是不行,一样的错误。

  • 2024-04-21
  • 回复了主题帖: 《奔跑吧Linux内核(第2版)卷2:调试与案例分析》- 在 bbb 上实践 kdump 调试问题

    进一步地,我在 beaglebone black 上发了一个问题贴,[enable kdump service on beaglebone black, but after reboot still get kernel panic](https://forum.beagleboard.org/t/enable-kdump-service-on-beaglebone-black-but-after-reboot-still-get-kernel-panic/38251),期待有好的消息。。

  • 发表了主题帖: 《奔跑吧Linux内核(第2版)卷2:调试与案例分析》- 在 bbb 上实践 kdump 调试问题

    ​ 想着在 beaglebone black 上实践下第五章的 kdump 调试分析实践,没想到环境搭建出现各种幺蛾子。目前连 kdump 都没有部署成功,崩溃啊。。。 bbb 上安装了 debian bull 怎奈从仓库直接 apt 安装的 kdump-tools 总是提示无法内存,打印如下: ``` [  OK  ] Started User Login Management. [   30.616656] kdump-tools[592]: Starting kdump-tools: [   30.644866] kdump-tools[624]: Creating symlink /var/lib/kdump/vmlinuz. [   30.663150] kdump-tools[624]: Creating symlink /var/lib/kdump/initrd.img. [  OK  ] Finished Permit User Sessions. [  OK  ] Started Getty on tty1. [  OK  ] Finished BeagleBoard Generate Symlinks.          Starting OpenBSD Secure Shell server... [   32.020253] kdump-tools[689]: Could not find a free area of memory of 0xad31c0 bytes... [   32.038656] kdump-tools[689]: Cannot load /var/lib/kdump/vmlinuz [   32.095996] kdump-tools[624]: failed to load kdump kernel ... [   32.114898] kdump-tools[691]:  failed! ``` 但是为已经在 bootcmd 中追加了``crashkernel=384M-:128M``,并且 dmesg查看也有保留内存的动作: ``` root@beaglebone :~# dmesg | grep "crash" -B 3 -A 3 [    0.000000]   Normal zone: 0 pages reserved [    0.000000]   Normal zone: 130560 pages, LIFO batch:31 [    0.000000] CPU: All CPU(s) started in SVC mode. [    0.000000] Reserving 64MB of memory at 2432MB for crashkernel (System RAM: 510MB) [    0.000000] AM335X ES2.1 (sgx neon) [    0.000000] percpu: Embedded 21 pages/cpu s54604 r8192 d23220 u86016 [    0.000000] pcpu-alloc: s54604 r8192 d23220 u86016 alloc=21*4096 [    0.000000] pcpu-alloc: [0] 0 [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129412 [    0.000000] Kernel command line: console=ttyS0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 crashkernel=384M-:64M [    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear) [    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear) [    0.000000] mem auto-init: stack:off, heap alloc:on, heap free:off -- [   11.582844]   with environment: [   11.582851]     HOME=/ [   11.582857]     TERM=linux [   11.582863]     crashkernel=384M-:64M [   18.204208] EXT4-fs (mmcblk1p1): mounted filesystem with ordered data mode. Opts: (null) [   18.383456] Not activating Mandatory Access Control as /sbin/tomoyo-init does not exist. [   18.802579] systemd[1]: systemd 247.3-7+deb11u4 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified) ``` 无奈抱着试一试的心态重新编译新的 kexec-tools 工具,安装,问题就解决了。真的是柳暗花明又一村。 ``` bash root@BeagleBone:~# kdump-config show DUMP_MODE:              kdump USE_KDUMP:              1 KDUMP_COREDIR:          /var/crash crashkernel addr: 0x90000000    /var/lib/kdump/vmlinuz: symbolic link to /boot/vmlinuz-5.10.168+ kdump initrd:    /var/lib/kdump/initrd.img: symbolic link to /var/lib/kdump/initrd.img-5.10.168+ current state:    ready to kdump kexec command:   /sbin/kexec -p --command-line="console=ttyS0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 reset_devices systemd.unit=kdump-tools-dump.service nr_cpus=1 irqpoll nousb ata_piix.prefer_ms_hyperv=0" --initrd=/var/lib/kdump/initrd.img /var/lib/kdump/vmlinuz root@BeagleBone:~# neofetch        _,met$$$$$gg.          root@BeagleBone     ,g$$$$$$$$$$$$$$$P.       ---------------   ,g$$P"     """Y$$.".        OS: Debian GNU/Linux 11 (bullseye) armv7l ,$$P'              `$$$.     Host: TI AM335x BeagleBone Black ',$$P       ,ggs.     `$$b:   Kernel: 5.10.168+ `d$$'     ,$P"'   .    $$$    Uptime: 1 min $$P      d$'     ,    $$P    Packages: 426 (dpkg) $$:      $$.   -    ,d$$'    Shell: bash 5.1.4 $$;      Y$b._   _,d$P'      Terminal: /dev/ttyS0 Y$$.    `.`"Y$$$$P"'         CPU: Generic AM33XX (Flattened Device Tree) (1) @ 1.000GHz `$$b      "-.__              Memory: 42MiB / 355MiB   `Y$$    `Y$$.      `$$b.        `Y$$b.           `"Y$b._               `""" root@BeagleBone:~# systemctl status kdump-tools ● kdump-tools.service - Kernel crash dump capture service      Loaded: loaded (/lib/systemd/system/kdump-tools.service; enabled; vendor p>      Active: active (exited) since Sun 2024-04-21 18:45:36 HKT; 1min 27s ago     Process: 595 ExecStart=/etc/init.d/kdump-tools start (code=exited, status=0>    Main PID: 595 (code=exited, status=0/SUCCESS)         CPU: 769ms Apr 21 18:45:31 BeagleBone systemd[1]: Starting Kernel crash dump capture servi> Apr 21 18:45:34 BeagleBone kdump-tools[595]: Starting kdump-tools: Apr 21 18:45:34 BeagleBone kdump-tools[623]: Creating symlink /var/lib/kdump/vm> Apr 21 18:45:35 BeagleBone kdump-tools[623]: Creating symlink /var/lib/kdump/in> Apr 21 18:45:36 BeagleBone kdump-tools[623]: loaded kdump kernel. Apr 21 18:45:36 BeagleBone kdump-tools[691]: /sbin/kexec -p --command-line="con> Apr 21 18:45:36 BeagleBone kdump-tools[692]: loaded kdump kernel Apr 21 18:45:36 BeagleBone systemd[1]: Finished Kernel crash dump capture servi> ``` 从[oops_test.c](https://benshushu.coding.net/public/runninglinuxkernel_5.0/runninglinuxkernel_5.0/git/files/rlk_5.0/kmodules/rlk_lab/rlk_senior/Volume_2/chapter_8/lab01/oops_test.c)这里下载书中的 oops 例程,编译加载。 但是捕获内核没有正常启动,没有看到捕获的 crash 文件,输出以下内容后就卡住了: ``` bash [  148.356175] [] (machine_crash_shutdown) from [] (__crash_kexec+0x6c/0xd8) [  148.364744] [] (__crash_kexec) from [] (crash_kexec+0x5c/0x64) [  148.372350] [] (crash_kexec) from [] (die+0x160/0x35c) [  148.379259] [] (die) from [] (__do_kernel_fault.part.0+0x78/0x88) [  148.387127] [] (__do_kernel_fault.part.0) from [] (do_translation_fault+0x0/0xac) [  148.396392] [] (do_translation_fault) from [] (0x60030013) [  148.403646] ---[ end trace d664ec496f9aca0f ]--- [  148.408285] ------------[ cut here ]------------ [  148.412926] WARNING: CPU: 0 PID: 1197 at drivers/gpio/gpiolib.c:3335 machine_crash_shutdown+0xa4/0xf4 [  148.422183] Modules linked in: oops(O+) pru_rproc irq_pruss_intc pm33xx pruss ti_eqep counter c_can_platform c_can can_dev evdev wkup_m3_ipc uio_pdrv_genirq uio cpufreq_dt [  148.437620] CPU: 0 PID: 1197 Comm: insmod Kdump: loaded Tainted: G        W  O      5.10.168+ #5 [  148.446442] Hardware name: Generic AM33XX (Flattened Device Tree) [  148.452567] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [  148.460349] [] (show_stack) from [] (dump_stack+0x88/0x9c) [  148.467607] [] (dump_stack) from [] (__warn+0x88/0x128) [  148.474605] [] (__warn) from [] (warn_slowpath_fmt+0x64/0xc0) [  148.482126] [] (warn_slowpath_fmt) from [] (machine_crash_shutdown+0xa4/0xf4) [  148.491043] [] (machine_crash_shutdown) from [] (__crash_kexec+0x6c/0xd8) [  148.499611] [] (__crash_kexec) from [] (crash_kexec+0x5c/0x64) [  148.507218] [] (crash_kexec) from [] (die+0x160/0x35c) [  148.514126] [] (die) from [] (__do_kernel_fault.part.0+0x78/0x88) [  148.521996] [] (__do_kernel_fault.part.0) from [] (do_translation_fault+0x0/0xac) [  148.531260] [] (do_translation_fault) from [] (0x60030013) [  148.538514] ---[ end trace d664ec496f9aca10 ]--- [  148.543151] ------------[ cut here ]------------ [  148.547793] WARNING: CPU: 0 PID: 1197 at drivers/gpio/gpiolib.c:3335 machine_crash_shutdown+0xa4/0xf4 [  148.557051] Modules linked in: oops(O+) pru_rproc irq_pruss_intc pm33xx pruss ti_eqep counter c_can_platform c_can can_dev evdev wkup_m3_ipc uio_pdrv_genirq uio cpufreq_dt [  148.572488] CPU: 0 PID: 1197 Comm: insmod Kdump: loaded Tainted: G        W  O      5.10.168+ #5 [  148.581310] Hardware name: Generic AM33XX (Flattened Device Tree) [  148.587435] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [  148.595216] [] (show_stack) from [] (dump_stack+0x88/0x9c) [  148.602473] [] (dump_stack) from [] (__warn+0x88/0x128) [  148.609470] [] (__warn) from [] (warn_slowpath_fmt+0x64/0xc0) [  148.616991] [] (warn_slowpath_fmt) from [] (machine_crash_shutdown+0xa4/0xf4) [  148.625907] [] (machine_crash_shutdown) from [] (__crash_kexec+0x6c/0xd8) [  148.634476] [] (__crash_kexec) from [] (crash_kexec+0x5c/0x64) [  148.642083] [] (crash_kexec) from [] (die+0x160/0x35c) [  148.648991] [] (die) from [] (__do_kernel_fault.part.0+0x78/0x88) [  148.656862] [] (__do_kernel_fault.part.0) from [] (do_translation_fault+0x0/0xac) [  148.666126] [] (do_translation_fault) from [] (0x60030013) [  148.673379] ---[ end trace d664ec496f9aca11 ]--- [  148.678025] Loading crashdump kernel... [  148.681880] Bye! ``` 奇怪啊。。。。 换用 ``echo c > /proc/sysrq-trigger`` 可以重启内核,但是重启后还是卡住崩溃: ``` [   10.464551] df00: 0000013e c12d461c c1400560 c1211200 00000000 00000006 00000006 c18cc000                                                                         [0/44898] [   10.472767] df20: 00000000 c114b0d8 c113eb14 c113eac8 0000013e c189e132 c189e136 473957b1 [   10.480982] df40: 00000000 00000158 00000007 473957b1 c147defc 00000007 c189e000 c145d834 [   10.489198] df60: 00000158 c14013cc 00000006 00000006 00000000 c1400560 c0edf0d4 c1400560 [   10.497415] df80: 00000000 00000000 c0edf0d4 00000000 00000000 00000000 00000000 00000000 [   10.505630] dfa0: 00000000 c0edf0dc 00000000 c0100148 00000000 00000000 00000000 00000000 [   10.513845] dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [   10.522061] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 [   10.530302] [] (cpts_fifo_read) from [] (cpsw_misc_interrupt+0x30/0x4c) [   10.538701] [] (cpsw_misc_interrupt) from [] (__handle_irq_event_percpu+0x5c/0x25c) [   10.548142] [] (__handle_irq_event_percpu) from [] (handle_irq_event+0x5c/0xc4) [   10.557235] [] (handle_irq_event) from [] (handle_level_irq+0xd0/0x1c0) [   10.565629] [] (handle_level_irq) from [] (__handle_domain_irq+0xa0/0x10c) [   10.574284] [] (__handle_domain_irq) from [] (__irq_svc+0x6c/0xa8) [   10.582235] Exception stack(0xc18cdce0 to 0xc18cdd28) [   10.587310] dce0: c371be6c 600e0013 00000000 00000005 c371be00 00000000 c393b8c0 00000038 [   10.595527] dd00: 600e0013 c371bed4 c371be6c c3933000 00000000 c18cdd30 c01b1cf8 c0ee641c [   10.603739] dd20: 600e0013 ffffffff [   10.607249] [] (__irq_svc) from [] (_raw_spin_unlock_irqrestore+0x20/0x54) [   10.615905] [] (_raw_spin_unlock_irqrestore) from [] (__setup_irq+0x378/0x868) [   10.624908] [] (__setup_irq) from [] (request_threaded_irq+0xe4/0x15c) [   10.633214] [] (request_threaded_irq) from [] (devm_request_threaded_irq+0x64/0xb8) [   10.642654] [] (devm_request_threaded_irq) from [] (cpsw_probe+0x8ac/0xd80) [   10.651402] [] (cpsw_probe) from [] (platform_drv_probe+0x48/0x9c) [   10.659360] [] (platform_drv_probe) from [] (really_probe+0x108/0x514) [   10.667664] [] (really_probe) from [] (driver_probe_device+0x78/0x1d4) [   10.675968] [] (driver_probe_device) from [] (device_driver_attach+0xa8/0xb0) [   10.684883] [] (device_driver_attach) from [] (__driver_attach+0xf0/0x15c) [   10.693545] [] (__driver_attach) from [] (bus_for_each_dev+0x78/0xb8) [   10.701762] [] (bus_for_each_dev) from [] (bus_add_driver+0x110/0x214) [   10.710066] [] (bus_add_driver) from [] (driver_register+0x8c/0x124) [   10.718198] [] (driver_register) from [] (do_one_initcall+0x50/0x2b8) [   10.726420] [] (do_one_initcall) from [] (kernel_init_freeable+0x248/0x2a8) [   10.735164] [] (kernel_init_freeable) from [] (kernel_init+0x8/0x11c) [   10.743381] [] (kernel_init) from [] (ret_from_fork+0x14/0x2c) [   10.750982] Exception stack(0xc18cdfb0 to 0xc18cdff8) [   10.756056] dfa0:                                     00000000 00000000 00000000 00000000 [   10.764272] dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [   10.772487] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 [   10.779133] Code: e2857090 e58d300c e1a00007 e59d3018 (e584300c) [   10.785278] ---[ end trace 3f1de6e522b74bbc ]--- [   10.789918] Kernel panic - not syncing: Fatal exception in interrupt [   10.796309] ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]--- ``` 模拟和实际还是有差距啊。

  • 2024-04-19
  • 回复了主题帖: 阅读打卡终点站:安全漏洞分析——《奔跑吧Linux内核2:调试与案例分析》

    1. 利用计算机高速缓存和物理内存不同的访问延时来做侧信道攻击。 2. 在攻击进程中设置异常处理信号,发生异常时调用该信号的回调函数。 3. 在访问需要攻击的地址前刷掉高速缓存,在访问攻击的地址后,根据以被攻击地址的数据进行处理之后为索引访问用户可以安全访问的数组,根据乱序执行的特性,以被攻击地址的数据进行处理之后为索引的数据可能已经加载到了 cache,根据访问该地址的时间快慢,反向推到索引值,进一步推到被攻击地址的数据。」

  • 回复了主题帖: 《奔跑吧Linux内核(第2版)卷2:调试与案例分析》 - 第三章 内核调试与优化

    看样子像是工具链的问题,可以换一个工具链试一试。这个选项我看是 https://github.com/gcc-mirror/gcc/commit/417ca0117a1a9a8aaf5bc5ca530adfd68cb00399 引入的。

  • 回复了主题帖: 《奔跑吧Linux内核(第2版)卷2:调试与案例分析》 - 第三章 内核调试与优化

    你的 gcc 版本是书中指定的么?

  • 2024-04-11
  • 回复了主题帖: 阅读打卡第五站:基于ARM64解决宕机难题——《奔跑吧Linux内核2:调试与案例分析》

    1. 2. 指向父函数栈空间的 FP 3. dis 函数所在的地址

  • 2024-04-10
  • 回复了主题帖: 阅读打卡第四站:基于x86_64解决宕机难题——《奔跑吧Linux内核2:调试与案例分析》

    1. Kdump 会在内存中保留一块区域,用来存放捕获的内核。当内核崩溃时,Kdump通过Kexec机制自动启动捕获内核跳过 Bios,以免破坏生产内核的内存,然后将生产内核的完整信息转储到指定的文件中。 2. 当函数参数的数量小于等于6时,使用通用寄存器传递函数参数。当参数数量大于6时使用栈空间传递参数。 3.  

  • 2024-03-27
  • 回复了主题帖: 阅读打卡第三站: 内核调试与性能优化——《奔跑吧Linux内核2:调试与案例分析》

    问题一:gcc -O0 编译,表示关闭所有优化,可以更准确对内核进行调试,避免因为优化问题导致无法查看某些变量值或者调试时跳转异常的问题问题二:加载地址是存储代码的物理地址运行地址是代码运行时的地址链接地址是链接时候指定的地址问题三:位置无关汇编指令,就是代码中没有绝对地址,而是一些相对 pc 值的偏移地址,这样程序可以实现无论运行地址和链接地址是否一样都可以正常运行位置有关汇编指令,是指指令的执行中有绝对地址的概念,这样就要保证链接地址和运行地址一致才能正常运行程序

  • 2024-03-26
  • 回复了主题帖: 阅读打卡第二站:中断管理——《奔跑吧Linux内核2:调试与案例分析》

    问题一:1. PSTATE保存到对应的 SPSR_ELx中2. 返回地址保存到对应等级的 ELR_ELx 3. 设置 PSTATE 寄存器的 DAIF 域为14. 设置栈指针,指向对应异常等级的栈5. 迁移处理器等级到对应的异常等级,然后跳转到异常向量表执行中断处理程序问题二:1. 老版本内核使用直接映射的方式2. Linux 3.1 为应对 SOC 复杂中断控制器的场景,引入了 irq_domain 管理框架。问题三:1. 中断现场保护2. 跳转到对应中断控制器处理流程3. 根据硬件中断号查找"软"中断号,尝试执行内核定义的中断处理函数

最近访客

< 1/1 >

统计信息

已有23人来访过

  • 芯积分:168
  • 好友:--
  • 主题:17
  • 回复:39

留言

你需要登录后才可以留言 登录 | 注册


现在还没有留言