search
HomeDatabaseMysql Tutorial内核调试技巧

内核调试技巧

Jun 07, 2016 pm 03:11 PM
exampleKernelSkilldebug

举个kernel-panic的例子 [ 2590.185432] Unable to handle kernel paging request at virtual address 00100110 [ 2590.192874] pgd = c0004000 [ 2590.192881] [00100110] *pgd=00000000 [ 2590.192891] Internal error: Oops: 17 [#1] PREEMPT SMP [ 2590.

 

举个kernel-panic的例子

[ 2590.185432] Unable to handle kernel paging request at virtual address 00100110

[ 2590.192874] pgd = c0004000
[ 2590.192881] [00100110] *pgd=00000000
[ 2590.192891] Internal error: Oops: 17 [#1] PREEMPT SMP
[ 2590.192897] last sysfs file: /sys/devices/virtual/timed_output/vibrator/enable
[ 2590.192905] Modules linked in:
[ 2590.192916] CPU: 1    Tainted: G        W    (2.6.39.4-05422-g9d29c5e-dirty #96)
[ 2590.192935] PC is at handle_unpin+0x1c/0x1ac
[ 2590.192957] LR is at __mutex_lock_slowpath+0x2e8/0x324
[ 2590.192966] pc : []    lr : []    psr: 40000013
[ 2590.192971] sp : da961e88  ip : 22222222  fp : ed469c54
[ 2590.192978] r10: ed291e00  r9 : ed291fc8  r8 : da960000
[ 2590.192985] r7 : 00000000  r6 : 00100100  r5 : dfe89434  r4 : ed461a60
[ 2590.192993] r3 : da960000  r2 : da961e80  r1 : 22222222  r0 : da961e58
[ 2590.193002] Flags: nZcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[ 2590.193011] Control: 10c5387d  Table: 2d25804a  DAC: 00000015
[ 2590.193018]
[ 2590.193020] PC: 0xc0246dfc:
[ 2590.193024] 6dfc  ebf8ee9a e1a0200d e3c23d7f e59f1044 e3c3303f e59f0040 e593200c e2822fbb
[ 2590.193040] 6e1c  eb0b65ae ea000003 1a000002 e1a00004 eb000e98 ea000000 e3a08000 e1a00008
[ 2590.193056] 6e3c  e28dd014 e8bd8ff0 c063581c c0549310 c0742e04 c06357e2 c05492fc c06355e3
[ 2590.193072] 6e5c  c0717a7c e92d40f7 e1a04000 e5900008 e1a06001 e1a07002 e2800034 eb0b6efc
[ 2590.193087] 6e7c  e5965010 e2863010 e3550000 1a00000f e1a00004 eb000533 e1a0200d e3c23d7f
[ 2590.193103] 6e9c  e59f1150 e3c3303f e59f214c e593300c e5933230 e58d6000 e2833fbb eb00b93a
[ 2590.193119] 6ebc  e5940008 e2800034 eb0b6bc1 ea000047 e5d6204b e3520001 0a000002 e59f011c
[ 2590.193135] 6edc  e3a0106a ebf80c07 f57ff05f e1932f9f e2422001 e1831f92 e3310000 1afffffa

[ 2590.193154] LR: 0xc05221b8:
[ 2590.193158] 21b8  e59f00b0 e3a010fd ebed81a9 eaffffb8 e1a0200d e1a00004 e3c26d7f e1a0100d
[ 2590.193173] 21d8  e3c6603f e1a02006 ebee1fd9 e594300c e5846014 e1530007 03a03000 05843000
[ 2590.193189] 21f8  f57ff05f e3a03000 e2844004 e5843000 f57ff04f e320f004 e121f005 e1a0100d
[ 2590.193205] 2218  e3c13d7f e3c3303f e5933000 e3130002 0a000000 ebfffd23 e1a0000d ebee206f
[ 2590.193221] 2238  e1a0200d e3c23d7f e3c3303f e5932004 e2422001 e5832004 e5933000 e3130002
[ 2590.193237] 2258  0a000000 ebfffd17 e28dd014 e8bd8ff0 c0747a48 c0963090 c06190d9 e92d4ff0
[ 2590.193253] 2278  e24dd014 e1a0100d e1a04000 e3c13d7f e3c3303f e5932004 e593600c e2822001
[ 2590.193269] 2298  e5832004 e59f2388 e5922000 e3520000 1a00000e e5933004 e3c3333f e3c330ff
[ 2590.193285]
[ 2590.193287] SP: 0xda961e08:
[ 2590.193291] 1e08  edc60000 0000000f dd894cb8 0000025a 60000013 00000001 00000003 3532205b
[ 2590.193307] 1e28  322e3938 0000040f 00000007 00100100 00000000 c0046730 da961e58 22222222
[ 2590.193323] 1e48  da961e80 da960000 ed461a60 dfe89434 00100100 00000000 da960000 ed291fc8
[ 2590.193339] 1e68  ed291e00 ed469c54 22222222 da961e88 c0522238 c0246e7c 40000013 ffffffff
[ 2590.193354] 1e88  ed461a60 00100100 00000000 dfe89420 dfe89434 ed461a60 da961f00 c024710c
[ 2590.193370] 1ea8  dfdc87a0 00000002 edc2d80c edc2d80c 00000001 dfe89420 ed469c00 c0243f78
[ 2590.193386] 1ec8  ed469c00 ed469c48 00000000 d8c6cda0 d35806c0 edc2d80c edc2d80c c003fc60
[ 2590.193402] 1ee8  c003fc60 c003e9a0 00000003 00000002 ed469c48 ed291e00 dfe89420 d8c6cda0
[ 2590.193418]
[ 2590.193420] FP: 0xed469bd4:
[ 2590.193424] 9bd4  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 2590.193439] 9bf4  00000000 00000000 00000000 ed464000 00000000 ed469c08 ed469c08 00000000
[ 2590.193455] 9c14  00000000 c07181e8 00000000 00000002 00000001 00000000 c05491d0 ed6dd404
[ 2590.193470] 9c34  ed6dd404 0fb00001 00000001 ed469a00 ed461a60 ed469c00 00000000 ed18c460
[ 2590.193486] 9c54  00000001 00000000 00000000 ed469c60 ed469c60 00000000 00000000 ed469c54
[ 2590.193501] 9c74  d8c11ca0 00000000 00000000 ed463740 ed469c00 00000001 ed18c460 00000001
[ 2590.193516] 9c94  00000000 00000000 ed469c9c ed469c9c 00000000 00000000 ed469c90 d8c11a80
[ 2590.193532] 9cb4  00000000 00000000 ed4636e0 ed469c00 00000002 ed18c460 00000001 00000000
[ 2590.193548]
[ 2590.193550] R0: 0xda961dd8:
[ 2590.193554] 1dd8  c0747a54 c0747a54 da961df4 c05216fc 00000060 00000001 00000001 c00838c8
[ 2590.193569] 1df8  22222222 c0747a54 a92fb7e9 00000143 edc60000 0000000f dd894cb8 0000025a
[ 2590.193585] 1e18  60000013 00000001 00000003 3532205b 322e3938 0000040f 00000007 00100100
[ 2590.193600] 1e38  00000000 c0046730 da961e58 22222222 da961e80 da960000 ed461a60 dfe89434
[ 2590.193616] 1e58  00100100 00000000 da960000 ed291fc8 ed291e00 ed469c54 22222222 da961e88

[ 2590.193632] 1e78  c0522238 c0246e7c 40000013 ffffffff ed461a60 00100100 00000000 dfe89420

[ 2590.193647] 1e98  dfe89434 ed461a60 da961f00 c024710c dfdc87a0 00000002 edc2d80c edc2d80c

............................


[ 2590.194777] [] (handle_unpin+0x1c/0x1ac) from [] (nvmap_unpin+0x84/0xbc)
[ 2590.194793] [] (nvmap_unpin+0x84/0xbc) from [] (tegra_dc_ext_flip_worker+0x33c/0x39c)
[ 2590.194822] [] (tegra_dc_ext_flip_worker+0x33c/0x39c) from [] (process_one_work+0x254/0x3b0)
[ 2590.194840] [] (process_one_work+0x254/0x3b0) from [] (worker_thread+0x228/0x3e8)
[ 2590.194861] [] (worker_thread+0x228/0x3e8) from [] (kthread+0x80/0x88)
[ 2590.194884] [] (kthread+0x80/0x88) from [] (kernel_thread_exit+0x0/0x8)
[ 2590.194898] Code: e1a06001 e1a07002 e2800034 eb0b6efc (e5965010)

http://blog.csdn.net/k_linux_man/article/details/7290963


当pc在handle_unpin+0x1c的时候,往下运行出现了严重的错误,所以就出现了panic。


1.利用arm-linux-gnueabi-objdump -D vmlinux > kernel_dump.txt 查看handle_unpin+0x1c位置的汇编代码。

2.要么利用 arm-linux-gnueabi-gdb vmlinux

(gdb) l *handle_unpin+0x1c
0xc0246e7c is in handle_unpin (/home/*****/nvmap.c:99).
94            struct nvmap_handle *h, int free_vm)
95    {
96        int ret = 0;
97        nvmap_mru_lock(client->share);
98    
99        if (atomic_read(&h->pin) == 0) {
100            nvmap_err(client, "%s unpinning unpinned handle %p\n",
101                  current->group_leader->comm, h);
102            nvmap_mru_unlock(client->share);
103            return 0;

gdb都精确的定位到第99行了。

根据Unable to handle kernel paging request at virtual address 00100110


handle_unpin函数中的h指针为错误指针。剩下的精力就是放在什么时候,在什么地方这个值被修改了,为什么被修改了。

 

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Explain the InnoDB Buffer Pool and its importance for performance.Explain the InnoDB Buffer Pool and its importance for performance.Apr 19, 2025 am 12:24 AM

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

MySQL vs. Other Programming Languages: A ComparisonMySQL vs. Other Programming Languages: A ComparisonApr 19, 2025 am 12:22 AM

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages ​​such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages ​​have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

Learning MySQL: A Step-by-Step Guide for New UsersLearning MySQL: A Step-by-Step Guide for New UsersApr 19, 2025 am 12:19 AM

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL: Essential Skills for Beginners to MasterMySQL: Essential Skills for Beginners to MasterApr 18, 2025 am 12:24 AM

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL: Structured Data and Relational DatabasesMySQL: Structured Data and Relational DatabasesApr 18, 2025 am 12:22 AM

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL: Key Features and Capabilities ExplainedMySQL: Key Features and Capabilities ExplainedApr 18, 2025 am 12:17 AM

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

The Purpose of SQL: Interacting with MySQL DatabasesThe Purpose of SQL: Interacting with MySQL DatabasesApr 18, 2025 am 12:12 AM

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

MySQL for Beginners: Getting Started with Database ManagementMySQL for Beginners: Getting Started with Database ManagementApr 18, 2025 am 12:10 AM

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool