Abnormal situation level 1
Level 1 of abnormal scenarios is the lowest level API that shows the current status
Other specific abnormal scenarios will call these APIs according to their own scenarios
oops
Unable to ... 到 ---[ end trace
Behavior
If panic is called, it will do the panic behavior, otherwise it will just print
When is panic called?
1. panic_on_oops is 1
2. in_interrupt
2.1 Hard Interrupt
2.2 Soft interrupt
2.3 NMI
panic
Kernel panic ...
Behavior
Notify interested modules of crash or restart
Who called
Only oops will call panic
BUG
!CONFIG_BUG #define BUG() do {} while (1)
CONFIG_BUG && !HAVE_ARCH_BUG #define BUG() do {
printk("BUG: failure at %s:%d/%s()!n", __FILE__, __LINE__, __func__);
barrier_before_unreachable();
panic("BUG!");
} while (0)
CONFIG_BUG && HAVE_ARCH_BUG #define BUG() _BUG(__FILE__, __LINE__, BUG_INSTR_VALUE)
#define BUG() _BUG(__FILE__, __LINE__, BUG_INSTR_VALUE) // #define BUG_INSTR_VALUE 0xe7f001f2 // Executing the binary code with this value as arm will generate an undefined instruction exception
#define _BUG(file, line, value) __BUG(file, line, value)
#define __BUG(__file, __line, __value)
do {
asm volatile("1:t" BUG_INSTR(__value) "n"
".pushsection .rodata.str, "aMS", %progbits, 1n"
"2:t.asciz " #__file "n"
".popsectionn"
".pushsection __bug_table,"aw"n"
".align 2n"
"3:t.word 1b, 2bn"
"t.hword " #__line ", 0n"
".popsection");
unreachable();
} while (0)
BUG_ON
#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
level2
There are many level 2, level 2 corresponds to specific abnormal situations
For example, the function path of dividing by 0
For example, the function path of the page fault
1. Data anomalies caused by memory failure and hardware bit flipping
Generally, the symbol table (vmlinux) compiled at the same time is required for disassembly analysis
Unable to handle kernel paging request at virtual address XXXXXXXXX
2. Call BUG // arm64 BUG directly calls panic
An exception in the code causes an active restart triggered by calling BUG()
Kernel BUG at ffffff8008311ac8 [verbose debug info unavailable]
3. uncle
Out of memory means that there is no available memory. This problem must be caused by some resource-consuming processes that have exhausted the memory resources and triggered the KE.
Kernel panic - not syncing: Out of memory and no killable processes...
4. Undefined instruction exception
This is usually caused by CPU/DRAM instability.
Internal error: Oops - undefined instruction
5. Hardware watchdog timeout caused by a freeze
This is often caused by frequent irq/bus jams at the bottom layer, which results in the kicker being unable to be scheduled, thus causing the watch dog to trigger an interrupt.
Boot the system into the FIQ processing flow, and finally call the BUG to trigger a restart. // wathchdog is fiq ???
(Manifested as HWT and Hardware Reboot)
6. Software watchdog timeout
The MTK platform has a hang_detect mechanism. The system_server process returns to the software to feed the dog every 30 seconds.
If the system hangs for more than 10min/11min/12min/14min, different information will be dumped for debugging.
level2 instance
clcdfb_probe
825 printk("xxxxxxxxxxxxxxxxxxxxxxxxxxxx1n");
826 int *p = 0;
827 int a = 0;
828 a = *p;
829 printk("xxxxxxxxxxxxxxxxxxxxxxxxxxxx2n");
#0 __loop_delay () at arch/arm/lib/delay-loop.S:47
#1 0xc0045544 in panic (fmt=0xc0b1a010 "Attempted to kill init! exitcode=0x%08xn") at kernel/panic.c:200
#2 0xc00486cc in find_child_reaper (father=0xee8a8000) at kernel/exit.c:471
#3 0xc0048998 in forget_original_parent (father=0xee8a8000, dead=0xee8977a0) at kernel/exit.c:560
#4 0xc0048cd4 in exit_notify (tsk=0xee8a8000, group_dead=1) at kernel/exit.c:596
#5 0xc0049878 in do_exit (code=11) at kernel/exit.c:767
#6 0xc001dacc in oops_end (flags=1610613011, regs=0xee897b88, signr=11) at arch/arm/kernel/traps.c:313
#7 0xc001db7c in die (str=0xc0b17148 "Oops", regs=0xee897b88, err=23) at arch/arm/kernel/traps.c:333
#8 0xc002f960 in __do_kernel_fault (mm=0x0 <__vectors_start>, addr=0, fsr=23, regs=0xee897b88) at arch/arm/mm/fault.c:150
#9 0xc0b0dc00 in do_page_fault (addr=0, fsr=23, regs=0xee897b88) at arch/arm/mm/fault.c:392
#10 0xc0008798 in do_DataAbort (addr=0, fsr=23, regs=0xee897b88) at arch/arm/mm/fault.c:550
#11 0xc0b0c9d8 in __dabt_svc () at arch/arm/kernel/entry-armv.S:197
#12 0xc0b0c9d8 in __dabt_svc () at arch/arm/kernel/entry-armv.S:197
#13 0xc0b0c9d8 in __dabt_svc () at arch/arm/kernel/entry-armv.S:197
xxxxxxxxxxxxxxxxxxxxxxxxxxxx1
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops: 17 [#1] SMP ARM
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.0.0 #10
Hardware name: ARM-Versatile Express
task: ee8a8000 ti: ee896000 task.ti: ee896000
PC is at clcdfb_probe+0x44/0x2f0
LR is at clcdfb_probe+0x30/0x2f0
pc : [ sp : ee897bd0 ip : 00000004 fp : 00000000 r10: 00000000 r9 : 00000000 r8 : 00000000 r7: 00000000 r6: 00000000 r5: c0affb44 r4: 00000000 r3 : 00000000 r2 : c10b37a8 r1 : 60000013 r0 : 0000001d Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 10c5387d Table: 8ebcc059 DAC: 00000015 Process swapper/0 (pid: 1, stack limit = 0xee896210) Stack: (0xee897bd0 to 0xee898000) 7bc0: 60000013 c10c8afc c10c37ac eea0ec00 7be0: 60000013 eea0ec64 c10c8b60 c10c8b60 60000013 00030003 60000013 00000000 7c00: 00000000 60000013 eea0ec64 60000013 eea0ec64 eea0ec64 60000013 eea0ec64 7c20: eea0ec64 eea0ec00 00000001 60000013 c10fb134 00000000 00000000 eea0ec64 7c40: 60000013 00000000 c0affb44 c0615614 c10fb134 eea0ec00 eebe7144 80000001 7c60: eebe71e0 eebe71e0 c10fb134 eebe7140 00000004 c0314138 00000001 c0b95370 7c80: 00000000 00000001 eea0ecc4 eea0ecc4 00000001 eea0ec00 00000000 c0b95370 7ca0: eea0ec00 eea0ec08 c10c37ac c10c37c4 c10c37c4 eea0ec00 eea0ec00 00000000 7cc0: 00000000 00000000 c0affb44 c068a554 c10c37c4 eea0ec00 eea0ec64 eea0ec64 7ce0: eea0ec64 c069d468 ffffffff eea0ec00 00000000 eea0ec64 eea0ec64 00000000 7d00: 00000001 c1107f6c c1107f6c eea0ec08 eea0ed3c ffffffff eea0ecc4 00000000 7d20: ffffffff eea0ecc4 00000000 00000001 eea0ecc4 eea0ecc4 00000000 c0b95378 7d40: eea0ec00 00000001 eea0ec00 00000000 00000000 00000000 c0affb44 c068a90c 7d60: eea0ec00 c10c37c4 eea0ec08 eea0ec00 c0b95488 eea0ec00 eea0ec34 00000000 7d80: ee95f9c0 c068ab90 c10c37c4 eea0ec00 00000000 eea0ec00 c10c37c4 ee897dc8 7da0: ee95f980 eea0ec00 c10c8a98 c10c37c4 ee95e774 c0687aa8 c068aac0 c10c37c4 7dc0: 00000000 c10c3aa8 ee95e75c ee95f9b4 eea0ec00 00000000 c10c8994 c068ac0c 7de0: ee95e770 c10c37c4 c0688858 c06888b0 c0b8e7f0 ee93ef80 00000000 c10c37c4 7e00: 000080d0 00000050 000000d0 00000050 eea7f180 c0b951c4 c10c3aa8 00000000 7e20: ef5d0620 c068bec4 00000000 c10c37c4 00000000 00000000 00000006 c0615a04 7e40: 00000000 c10c37c4 eeb31380 c0d57280 00000000 c0008dc8 ee891130 c007dc78 7e60: 000000a2 c0d5724c 00000006 c0d0eb30 000000a2 c0cd69f8 eefeb32a c0b12200 7e80: 000000d0 c10fa0ec 60000153 c10b1eec c10fa0ec c10fa0ec 00000000 00000001 7ea0: eefeb329 eefeb320 c0b1bb10 60000153 c10b1ef0 60000153 c10b1eec 00000000 7ec0: 60000013 60000013 60000013 a0000113 00000000 00000000 00000000 c0d0f40c 7ee0: 00000006 00000006 c0d0eb30 c10b1dc4 c10b1dc4 00000006 c10b1dc4 c0d901bc 7f00: ee8af6c0 c0d0f460 00000000 00000006 00000000 c0d0f4ac 00000000 c0d0f724 7f20: 2df17000 ee8a84c0 00000000 c10ac7e4 c10ac7e4 ee8a8000 eefc05c0 eefc05c0 7f40: 00000001 ee8a83f4 ee8a83f4 ee8a83f4 ee8a83f4 ee8a8000 60000153 c10b8e98 7f60: 60000153 ee8a842c ee8a842c ee8a842c 00000000 ee8a842c ee8a842c 60000153 7f80: 60000153 ee8a83f4 ee8a8000 ee8a8000 00000000 c0affb54 00000000 00000000 7fa0: 00000000 eefc05c0 00000000 c0014de0 00000000 00000000 00000000 00000000 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ Code: e58d3068 e3a03000 e58d3064 e59d3068 (e5933000) ---[ end trace 3d127599db201418 ]--- Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
Previous article:OK6410A development board (eight) 64 linux-5.11 OK6410A linux exception analysis
Next article:OK6410A Development Board (VIII) 62 linux-5.11 Common abnormal scenarios and analysis of OK6410A linux application space
- Popular Resources
- Popular amplifiers
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- [NXP Rapid IoT Review] Week 5: DIY BLE_APP for NXP IoT: RGB Dimming Control
- TI C6000 Data Storage Processing and Performance Optimization
- Porting OpenCV on DSP_6748
- Questions about vhdl testbench
- Can the AGND and DGND pins of VS1053 be connected directly?
- Sipeed LicheeRV 86 Panel Review] Play with Debian Linux system plus SSH
- [RVB2601 creative application development] + LCD screen display function expansion
- QCA9531 and AR9342 support USB camera mini embedded AP module
- Some new choices and thoughts on ADC and DAC chips in the wave of localization
- Why do we need to open a pallet for SMD welding when the PCB is assembled?