SlideShare a Scribd company logo
Concurrency bug indentification through kernel panic log - Outline
• Experiment
• Log analysis and dump file tracing
• Fault identify
• Log analysis and dump file tracing – part 2
• Tracing ARM instruction
• Conclusion
1
Experiment environment• Kernel panic scenario:
– Unable to handle kernel paging request at virtual address [bdf046ab]
• Environment:
– Hardware : Tiny6410
– Kernel : 2.6.36
– Driver version : before the ping failed bug fix(for panda)
• CheckResponseTimeout() in driver run per 1ms
– CM : query thread run ioctl per 1ms
• Analysis tool:
– Source code
– Error log
– Objdump
• ex: objdump wimaxsdio.ko -S
2
Log analysis
• Error log – part1
– Buggy memory write at CheckResponseTimeout at 0x78/0x19c
3
This is our suspect.
Dump analysis
• What happens at that memory write
– We can trace our dump file:
– 0x303c(start of CheckResponseTimeout) + 0x78 = 30B4
4
Fault identify
• It seems error happens at “reading the
pLocalDeviceData->status variable”, but why?
• that does not happen all the time!!!
– It seems not an usual normal software bug.
– It happens just for one time among thousands
experiment runs! (shall we take this bug as a
concurrency bug)
• Luckily we still have other information in error log.
5
Log analysis part 2• If we are considering a concurrency bug, those followed additional log would just be the perfect
clue.
– Because it really shows the interrupted context “wimax_rx_thread” get involved.
6
Dump analysis part 2
• 0x37c0(start of ReceiveResponse)+0x390(offset indicated by log) = 0x4000.
• 0x4000 is the point interrupted.
7
Trace ARM instruction• Lsr : logical shift right
• Strb: store 1 byte to memory address
• So 0xfff3’s will be the graph in bottom right (pLddbChain->head)
8
Low memory
Low memory
a b c dR4 register
F F F 3R3 register
R1 register
Low bitsHigh bits
d
c
b
a
0xfff4
0xfff5
0xfff6
0xfff3
abc
ab
a
1
23
4
1
2
3
4
5
6
7
5
6
7
Trace ARM instruction• Lsr : logical shift right
• Strb: store 1 byte to memory address
• Program is interrupted just after lsr r1,r4,#16
• So 0xfff3’s will be the graph in bottom right (pLddbChain->head)
9
Low memory
Low memory
a b c dR4 register
F F F 3R3 register
R1 register
Low bitsHigh bits
undefine
c
undefine
undefine
0xfff4
0xfff5
0xfff6
0xfff3
abc
ab
1
23
1
2
3
Conclusion
• It’s an option that identify symptom is caused by
concurrency bug, when symptom doesn’t happen
all the time.
• Don’t get panic when driver panic.
– Calm down and Collecting enough log information as
much as possible, maybe next time we won’t be as
lucky as we are now.
• Exploring objdump tool to get advanced debug information.
• Exploring kernel config option to get advanced debug
information .
10

More Related Content

PPTX
Dead Lock Analysis of spin_lock() in Linux Kernel (english)
PPTX
The Silence of the Canaries
PPT
Linux Kernel Debugging
PDF
ARM Architecture and Meltdown/Spectre
PDF
Linux Kernel Platform Development: Challenges and Insights
PPTX
Linux kernel debugging
PDF
Linux kernel debugging
PDF
BPF - in-kernel virtual machine
Dead Lock Analysis of spin_lock() in Linux Kernel (english)
The Silence of the Canaries
Linux Kernel Debugging
ARM Architecture and Meltdown/Spectre
Linux Kernel Platform Development: Challenges and Insights
Linux kernel debugging
Linux kernel debugging
BPF - in-kernel virtual machine

What's hot (20)

PDF
Semtex.c [CVE-2013-2094] - A Linux Privelege Escalation
PDF
FreeBSD and Drivers
PDF
Building Network Functions with eBPF & BCC
PPTX
QEMU - Binary Translation
PDF
Qemu JIT Code Generator and System Emulation
PDF
SFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMU
PDF
Understanding of linux kernel memory model
PDF
Specializing the Data Path - Hooking into the Linux Network Stack
PDF
from Binary to Binary: How Qemu Works
PPT
Contiki introduction I.
PPTX
U-boot and Android Verified Boot 2.0
PDF
An Introduction to the Formalised Memory Model for Linux Kernel
PDF
Kernel Recipes 2019 - RCU in 2019 - Joel Fernandes
ODP
Linux kernel debugging(ODP format)
PDF
Translation Cache Policies for Dynamic Binary Translation
PDF
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...
PDF
Transactional Memory
PDF
Kernel Recipes 2016 - entry_*.S: A carefree stroll through kernel entry code
PPTX
Linux Interrupts
PDF
Prerequisite knowledge for shared memory concurrency
Semtex.c [CVE-2013-2094] - A Linux Privelege Escalation
FreeBSD and Drivers
Building Network Functions with eBPF & BCC
QEMU - Binary Translation
Qemu JIT Code Generator and System Emulation
SFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMU
Understanding of linux kernel memory model
Specializing the Data Path - Hooking into the Linux Network Stack
from Binary to Binary: How Qemu Works
Contiki introduction I.
U-boot and Android Verified Boot 2.0
An Introduction to the Formalised Memory Model for Linux Kernel
Kernel Recipes 2019 - RCU in 2019 - Joel Fernandes
Linux kernel debugging(ODP format)
Translation Cache Policies for Dynamic Binary Translation
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...
Transactional Memory
Kernel Recipes 2016 - entry_*.S: A carefree stroll through kernel entry code
Linux Interrupts
Prerequisite knowledge for shared memory concurrency
Ad

Viewers also liked (7)

PPT
Basic Concept of Pixel and MPEG data structure (english)
PPTX
Introduction to netlink in linux kernel (english)
PPT
FAT file system implementation from scratch in boot-loader (chinese)
PPT
Introduction to Nand Flash interface (chinese)
PPT
Introduction to synchronous display controller (chinese)
PPT
Introduction to SPI and PMIC with SPI interface (chinese)
PPT
Bootloader and MMU (english)
Basic Concept of Pixel and MPEG data structure (english)
Introduction to netlink in linux kernel (english)
FAT file system implementation from scratch in boot-loader (chinese)
Introduction to Nand Flash interface (chinese)
Introduction to synchronous display controller (chinese)
Introduction to SPI and PMIC with SPI interface (chinese)
Bootloader and MMU (english)
Ad

Similar to Concurrency bug identification through kernel panic log (english) (20)

PPTX
Operating System Engineering
PPTX
Dpdk applications
PDF
HKG18-TR14 - Postmortem Debugging with Coresight
PPT
Embedded systems
PDF
lecture16-recap-questions-and-answers.pdf
PPTX
Techno-Fest-15nov16
PPTX
Real Time Operating Systems
PDF
seminarembedded-150504150805-conversion-gate02.pdf
PPT
Threads Advance in System Administration with Linux
PDF
Fundamentals of Complete Crash and Hang Memory Dump Analysis (Revision 2)
PDF
Linux Internals - Interview essentials - 1.0
PDF
PART-3 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PDF
Lecture 5 process synchronization
ODP
Realtime
PDF
Userspace adaptive spinlocks with rseq
DOC
Introduction to Operating System (Important Notes)
PDF
Describe synchronization techniques used by programmers who develop .pdf
PDF
Unit_ 5.3 Interprocess communication.pdf
PPTX
prez4_operacni_systemy principles and fundamentals
PDF
REAL TIME OPERATING SYSTEM PART 1
Operating System Engineering
Dpdk applications
HKG18-TR14 - Postmortem Debugging with Coresight
Embedded systems
lecture16-recap-questions-and-answers.pdf
Techno-Fest-15nov16
Real Time Operating Systems
seminarembedded-150504150805-conversion-gate02.pdf
Threads Advance in System Administration with Linux
Fundamentals of Complete Crash and Hang Memory Dump Analysis (Revision 2)
Linux Internals - Interview essentials - 1.0
PART-3 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
Lecture 5 process synchronization
Realtime
Userspace adaptive spinlocks with rseq
Introduction to Operating System (Important Notes)
Describe synchronization techniques used by programmers who develop .pdf
Unit_ 5.3 Interprocess communication.pdf
prez4_operacni_systemy principles and fundamentals
REAL TIME OPERATING SYSTEM PART 1

Recently uploaded (20)

PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PPTX
Transform Your Business with a Software ERP System
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
assetexplorer- product-overview - presentation
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
top salesforce developer skills in 2025.pdf
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
history of c programming in notes for students .pptx
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
System and Network Administraation Chapter 3
VVF-Customer-Presentation2025-Ver1.9.pptx
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Transform Your Business with a Software ERP System
Design an Analysis of Algorithms I-SECS-1021-03
assetexplorer- product-overview - presentation
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
wealthsignaloriginal-com-DS-text-... (1).pdf
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Softaken Excel to vCard Converter Software.pdf
top salesforce developer skills in 2025.pdf
Reimagine Home Health with the Power of Agentic AI​
Upgrade and Innovation Strategies for SAP ERP Customers
Odoo Companies in India – Driving Business Transformation.pdf
history of c programming in notes for students .pptx
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Designing Intelligence for the Shop Floor.pdf
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
System and Network Administraation Chapter 3

Concurrency bug identification through kernel panic log (english)

  • 1. Concurrency bug indentification through kernel panic log - Outline • Experiment • Log analysis and dump file tracing • Fault identify • Log analysis and dump file tracing – part 2 • Tracing ARM instruction • Conclusion 1
  • 2. Experiment environment• Kernel panic scenario: – Unable to handle kernel paging request at virtual address [bdf046ab] • Environment: – Hardware : Tiny6410 – Kernel : 2.6.36 – Driver version : before the ping failed bug fix(for panda) • CheckResponseTimeout() in driver run per 1ms – CM : query thread run ioctl per 1ms • Analysis tool: – Source code – Error log – Objdump • ex: objdump wimaxsdio.ko -S 2
  • 3. Log analysis • Error log – part1 – Buggy memory write at CheckResponseTimeout at 0x78/0x19c 3 This is our suspect.
  • 4. Dump analysis • What happens at that memory write – We can trace our dump file: – 0x303c(start of CheckResponseTimeout) + 0x78 = 30B4 4
  • 5. Fault identify • It seems error happens at “reading the pLocalDeviceData->status variable”, but why? • that does not happen all the time!!! – It seems not an usual normal software bug. – It happens just for one time among thousands experiment runs! (shall we take this bug as a concurrency bug) • Luckily we still have other information in error log. 5
  • 6. Log analysis part 2• If we are considering a concurrency bug, those followed additional log would just be the perfect clue. – Because it really shows the interrupted context “wimax_rx_thread” get involved. 6
  • 7. Dump analysis part 2 • 0x37c0(start of ReceiveResponse)+0x390(offset indicated by log) = 0x4000. • 0x4000 is the point interrupted. 7
  • 8. Trace ARM instruction• Lsr : logical shift right • Strb: store 1 byte to memory address • So 0xfff3’s will be the graph in bottom right (pLddbChain->head) 8 Low memory Low memory a b c dR4 register F F F 3R3 register R1 register Low bitsHigh bits d c b a 0xfff4 0xfff5 0xfff6 0xfff3 abc ab a 1 23 4 1 2 3 4 5 6 7 5 6 7
  • 9. Trace ARM instruction• Lsr : logical shift right • Strb: store 1 byte to memory address • Program is interrupted just after lsr r1,r4,#16 • So 0xfff3’s will be the graph in bottom right (pLddbChain->head) 9 Low memory Low memory a b c dR4 register F F F 3R3 register R1 register Low bitsHigh bits undefine c undefine undefine 0xfff4 0xfff5 0xfff6 0xfff3 abc ab 1 23 1 2 3
  • 10. Conclusion • It’s an option that identify symptom is caused by concurrency bug, when symptom doesn’t happen all the time. • Don’t get panic when driver panic. – Calm down and Collecting enough log information as much as possible, maybe next time we won’t be as lucky as we are now. • Exploring objdump tool to get advanced debug information. • Exploring kernel config option to get advanced debug information . 10