1.. SPDX-License-Identifier: GPL-2.0 2 3.. include:: ../disclaimer-zh_TW.rst 4 5:Original: :doc:`../../../admin-guide/bug-hunting` 6 7:������: 8 9 ��������� Wu XiangCheng <bobwxc@email.cn> 10 ��������� Hu Haowen <2023002089@link.tyut.edu.cn> 11 12������������ 13========= 14 15������������������������������������������������:: 16 17 ------------[ cut here ]------------ 18 WARNING: CPU: 1 PID: 28102 at kernel/module.c:1108 module_put+0x57/0x70 19 Modules linked in: dvb_usb_gp8psk(-) dvb_usb dvb_core nvidia_drm(PO) nvidia_modeset(PO) snd_hda_codec_hdmi snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm snd_timer snd soundcore nvidia(PO) [last unloaded: rc_core] 20 CPU: 1 PID: 28102 Comm: rmmod Tainted: P WC O 4.8.4-build.1 #1 21 Hardware name: MSI MS-7309/MS-7309, BIOS V1.12 02/23/2009 22 00000000 c12ba080 00000000 00000000 c103ed6a c1616014 00000001 00006dc6 23 c1615862 00000454 c109e8a7 c109e8a7 00000009 ffffffff 00000000 f13f6a10 24 f5f5a600 c103ee33 00000009 00000000 00000000 c109e8a7 f80ca4d0 c109f617 25 Call Trace: 26 [<c12ba080>] ? dump_stack+0x44/0x64 27 [<c103ed6a>] ? __warn+0xfa/0x120 28 [<c109e8a7>] ? module_put+0x57/0x70 29 [<c109e8a7>] ? module_put+0x57/0x70 30 [<c103ee33>] ? warn_slowpath_null+0x23/0x30 31 [<c109e8a7>] ? module_put+0x57/0x70 32 [<f80ca4d0>] ? gp8psk_fe_set_frontend+0x460/0x460 [dvb_usb_gp8psk] 33 [<c109f617>] ? symbol_put_addr+0x27/0x50 34 [<f80bc9ca>] ? dvb_usb_adapter_frontend_exit+0x3a/0x70 [dvb_usb] 35 [<f80bb3bf>] ? dvb_usb_exit+0x2f/0xd0 [dvb_usb] 36 [<c13d03bc>] ? usb_disable_endpoint+0x7c/0xb0 37 [<f80bb48a>] ? dvb_usb_device_exit+0x2a/0x50 [dvb_usb] 38 [<c13d2882>] ? usb_unbind_interface+0x62/0x250 39 [<c136b514>] ? __pm_runtime_idle+0x44/0x70 40 [<c13620d8>] ? __device_release_driver+0x78/0x120 41 [<c1362907>] ? driver_detach+0x87/0x90 42 [<c1361c48>] ? bus_remove_driver+0x38/0x90 43 [<c13d1c18>] ? usb_deregister+0x58/0xb0 44 [<c109fbb0>] ? SyS_delete_module+0x130/0x1f0 45 [<c1055654>] ? task_work_run+0x64/0x80 46 [<c1000fa5>] ? exit_to_usermode_loop+0x85/0x90 47 [<c10013f0>] ? do_fast_syscall_32+0x80/0x130 48 [<c1549f43>] ? sysenter_past_esp+0x40/0x6a 49 ---[ end trace 6ebc60ef3981792f ]--- 50 51������������������������������������������������������������������������������������������������������������������ 52������������������������������ **���Oops���** ���������������:: 53 54 BUG: unable to handle kernel NULL pointer dereference at (null) 55 IP: [<c06969d4>] iret_exc+0x7d0/0xa59 56 *pdpt = 000000002258a001 *pde = 0000000000000000 57 Oops: 0002 [#1] PREEMPT SMP 58 ... 59 60��������� **Oops** ������������������������������������������������������������������������������������������ 61���������������������������������������Oops������������������������������������������������ 62 63������������������ ``CONFIG_DEBUG_INFO`` ��������������������������������������� 64`scripts/decode_stacktrace.sh` ��� 65 66��������������� 67----------- 68 69���������������������������/��������������������������������������������������������� 70`Documentation/admin-guide/tainted-kernels.rst` ������������������������������������������ 71������������+���������������������������������������-������������ 72 73 74Oops��������������� 75--------------- 76 77���������Oops���������klogd��������������������������������������� ``syslogd`` ��������������������� 78syslog������������������ ``/var/log/messages`` ������������ ``/etc/syslog.conf`` ������ 79���������systemd������������������������������ ``journald`` ������������������������������������ 80``journalctl`` ��������������������� 81 82������ ``klogd`` ������������������������������������������ ``dmesg > file`` ������������������ 83������������������������������������������ ``cat /proc/kmsg > file`` ������������������������ 84������������������������������ ``kmsg`` ��������������������������������������� 85 86������������������������������������������������������������������������������������������ 87 88(1) ��������������������������������������������������������������������������������������������������������� 89 ������������������������������������������������������������������������������������������������������������ 90 ��������������������������������������������������������������������������������� ``vga=791`` ��� 91 ������������������������������������������������������������������ ``vesafb`` ������������������������ 92 ���Oppses��������������� 93 94(2) ������������������������������ 95 :ref:`Documentation/admin-guide/serial-console.rst <serial_console>` ������ 96 ������������������������������������������������������������������������������������������ 97 Minicom��������������� 98 99(3) ������Kdump��������� Documentation/admin-guide/kdump/kdump.rst ������������ 100 Documentation/admin-guide/kdump/gdbmacros.txt ������dmesg gdbmacro������������ 101 ��������������������������������� 102 103������������������ 104------------- 105 106��������������������������������������������������������������������������������������������������������������������� 107������������������ ``gdb`` ������������������������������������������������������������������ 108 109gdb 110^^^^ 111 112GNU ������������GNU debugger��� ``gdb`` ��������� ``vmlinux`` ���������������OOPS��������� 113��������������������������������� 114 115��������� ``CONFIG_DEBUG_INFO`` ������������������������gdb������������������������������������������ 116������������:: 117 118 $ ./scripts/config -d COMPILE_TEST -e DEBUG_KERNEL -e DEBUG_INFO 119 120������ ``CONFIG_DEBUG_INFO`` ���������������������������������������OOPS������EIP���:: 121 122 EIP: 0060:[<c021e50e>] Not tainted VLI 123 124���������GDB������������������������������:: 125 126 $ gdb vmlinux 127 (gdb) l *0xc021e50e 128 129������������������ ``CONFIG_DEBUG_INFO`` ������������OOPS���������������:: 130 131 EIP is at vt_ioctl+0xda8/0x1482 132 133������������ ``CONFIG_DEBUG_INFO`` ������������������������������:: 134 135 $ ./scripts/config -d COMPILE_TEST -e DEBUG_KERNEL -e DEBUG_INFO 136 $ make vmlinux 137 $ gdb vmlinux 138 (gdb) l *vt_ioctl+0xda8 139 0x1888 is in vt_ioctl (drivers/tty/vt/vt_ioctl.c:293). 140 288 { 141 289 struct vc_data *vc = NULL; 142 290 int ret = 0; 143 291 144 292 console_lock(); 145 293 if (VT_BUSY(vc_num)) 146 294 ret = -EBUSY; 147 295 else if (vc_num) 148 296 vc = vc_deallocate(vc_num); 149 297 console_unlock(); 150 151������������������������������������:: 152 153 (gdb) p vt_ioctl 154 $1 = {int (struct tty_struct *, unsigned int, unsigned long)} 0xae0 <vt_ioctl> 155 (gdb) l *0xae0+0xda8 156 157������������������������������������������:: 158 159 $ make drivers/tty/ 160 $ gdb drivers/tty/vt/vt_ioctl.o 161 (gdb) l *vt_ioctl+0xda8 162 163���������������������������������:: 164 165 Call Trace: 166 [<ffffffff8802c8e9>] :jbd:log_wait_commit+0xa3/0xf5 167 [<ffffffff810482d9>] autoremove_wake_function+0x0/0x2e 168 [<ffffffff8802770b>] :jbd:journal_stop+0x1be/0x1ee 169 ... 170 171������������������������ :jbd: ������������������������gdb���������������������������������������:: 172 173 $ gdb fs/jbd/jbd.ko 174 (gdb) l *log_wait_commit+0xa3 175 176.. note:: 177 178 ���������������������������������������������������������������������������������:: 179 180 [<f80bc9ca>] ? dvb_usb_adapter_frontend_exit+0x3a/0x70 [dvb_usb] 181 182 ���������������������������������������������������������:: 183 184 $ gdb drivers/media/usb/dvb-usb/dvb-usb.o 185 (gdb) l *dvb_usb_adapter_frontend_exit+0x3a 186 187objdump 188^^^^^^^^ 189 190���������������������������objdump������������������������������������������������������������������������/��� 191��������������������������������������������������������������������������������������������������������������� 192���������C���������������������������������������������������������������hacking������������������������:: 193 194 $ objdump -r -S -l --disassemble net/dccp/ipv4.o 195 196.. note:: 197 198 ������������������������������������������������������C��������� 199 200���������������������������������������������������������������������������������������������Dave Miller��� 201���������������������������������:: 202 203 EIP is at +0x14/0x4c0 204 ... 205 Code: 44 24 04 e8 6f 05 00 00 e9 e8 fe ff ff 8d 76 00 8d bc 27 00 00 206 00 00 55 57 56 53 81 ec bc 00 00 00 8b ac 24 d0 00 00 00 8b 5d 08 207 <8b> 83 3c 01 00 00 89 44 24 14 8b 45 28 85 c0 89 44 24 18 0f 85 208 209 Put the bytes into a "foo.s" file like this: 210 211 .text 212 .globl foo 213 foo: 214 .byte .... /* bytes from Code: part of OOPS dump */ 215 216 Compile it with "gcc -c -o foo.o foo.s" then look at the output of 217 "objdump --disassemble foo.o". 218 219 Output: 220 221 ip_queue_xmit: 222 push %ebp 223 push %edi 224 push %esi 225 push %ebx 226 sub $0xbc, %esp 227 mov 0xd0(%esp), %ebp ! %ebp = arg0 (skb) 228 mov 0x8(%ebp), %ebx ! %ebx = skb->sk 229 mov 0x13c(%ebx), %eax ! %eax = inet_sk(sk)->opt 230 231`scripts/decodecode` ���������������������������������������������������������������������������CPU 232��������������� 233 234������������ 235--------- 236 237������������������������������������������������������������������������������������������������������������������ 238 239��������������������������������������������������������������������������������������������������� ``get_maintainer.pl`` ��� 240 241 242���������������gspca���sonixj.c������������������������������������������������������������������������������:: 243 244 $ ./scripts/get_maintainer.pl -f drivers/media/usb/gspca/sonixj.c 245 Hans Verkuil <hverkuil@xs4all.nl> (odd fixer:GSPCA USB WEBCAM DRIVER,commit_signer:1/1=100%) 246 Mauro Carvalho Chehab <mchehab@kernel.org> (maintainer:MEDIA INPUT INFRASTRUCTURE (V4L/DVB),commit_signer:1/1=100%) 247 Tejun Heo <tj@kernel.org> (commit_signer:1/1=100%) 248 Bhaktipriya Shridhar <bhaktipriya96@gmail.com> (commit_signer:1/1=100%,authored:1/1=100%,added_lines:4/4=100%,removed_lines:9/9=100%) 249 linux-media@vger.kernel.org (open list:GSPCA USB WEBCAM DRIVER) 250 linux-kernel@vger.kernel.org (open list) 251 252������������������������ 253 254- ������������������������������������������������������git���������������������������������������������Tejun 255 ���Bhaktipriya��������������������������������������������������������������������������������� 256- ���������������������Hans Verkuil������ 257- ������������������������Mauro Carvalho Chehab������ 258- ���������������/���������������������������linux-media@vger.kernel.org������ 259- Linux���������������������linux-kernel@vger.kernel.org������ 260 261������������������������������������������������������������������������������������������������linux-media 262ML������������������������������������Hans������ 263 264��������������������������������������������������� ``get_maintainer.pl`` ��������������������������� 265������������������������linux-kernel@vger.kernel.org��� 266 267���������������������������Linux���������������:-) 268 269������������ 270--------- 271 272��������������������������������������������������������������������������������������������������������������� 273��������������������������������������������������������������������������������������� 274 275������������������������������������������������������������������������������ 276 277��������������� 278:ref:`Documentation/process/submitting-patches.rst <submittingpatches>` ��� 279��������������������������������� 280 281 282--------------------------------------------------------------------------- 283 284��� ``klogd`` ������Oops��������������������� 285------------------------------------ 286 287������������Linus������������������������������ ``klogd`` ������������������������������������������������ 288��������������������������������������������������� ``sysklogd`` ������1.3-pl3��������� 289 290��������������������������� ``klogd`` ��������������������������������������������������������������������� 291������������������������������������ ``klogd`` ������������������������������������������������������������ 292������������������������������������������������������������������������������������������������������ 293 294``klogd`` ������������������������������������������������������������������������������������System.map 295������������������������������������ ``klogd`` ������������������������������������������������������������ 296������������������������ ``klogd`` ���������������������������������������������klogd������������ 297 298��������������������������������������������������������������������������������������������������������������� 299��������������������������������������������������������������������������������������������������������������� 300��������� 301 302���������������������������������������������������������������������������������������������klogd������������ 303������������������������������������������������������������������������������������������������������������������ 304 305klogd��������������������������������������������������������������������������������������������������������� 306������������������������������������������������������������������ 307 308��������������������������������������������������������������������������������������������������������� 309``klogd`` ���������������������������������������������������������������klogd��������������������������� 310������������������������������������������������������������������������������������ ``klogd`` ������������ 311 312sysklogd��������������������������������������������� ``modules-2.0.0`` ������������������������ 313������������������������klogd��������������������������������������������������������������������������������� 314������������������������ 315 316��������� ``klogd`` ������������������������������������������������:: 317 318 Aug 29 09:51:01 blizard kernel: Unable to handle kernel paging request at virtual address f15e97cc 319 Aug 29 09:51:01 blizard kernel: current->tss.cr3 = 0062d000, %cr3 = 0062d000 320 Aug 29 09:51:01 blizard kernel: *pde = 00000000 321 Aug 29 09:51:01 blizard kernel: Oops: 0002 322 Aug 29 09:51:01 blizard kernel: CPU: 0 323 Aug 29 09:51:01 blizard kernel: EIP: 0010:[oops:_oops+16/3868] 324 Aug 29 09:51:01 blizard kernel: EFLAGS: 00010212 325 Aug 29 09:51:01 blizard kernel: eax: 315e97cc ebx: 003a6f80 ecx: 001be77b edx: 00237c0c 326 Aug 29 09:51:01 blizard kernel: esi: 00000000 edi: bffffdb3 ebp: 00589f90 esp: 00589f8c 327 Aug 29 09:51:01 blizard kernel: ds: 0018 es: 0018 fs: 002b gs: 002b ss: 0018 328 Aug 29 09:51:01 blizard kernel: Process oops_test (pid: 3374, process nr: 21, stackpage=00589000) 329 Aug 29 09:51:01 blizard kernel: Stack: 315e97cc 00589f98 0100b0b4 bffffed4 0012e38e 00240c64 003a6f80 00000001 330 Aug 29 09:51:01 blizard kernel: 00000000 00237810 bfffff00 0010a7fa 00000003 00000001 00000000 bfffff00 331 Aug 29 09:51:01 blizard kernel: bffffdb3 bffffed4 ffffffda 0000002b 0007002b 0000002b 0000002b 00000036 332 Aug 29 09:51:01 blizard kernel: Call Trace: [oops:_oops_ioctl+48/80] [_sys_ioctl+254/272] [_system_call+82/128] 333 Aug 29 09:51:01 blizard kernel: Code: c7 00 05 00 00 00 eb 08 90 90 90 90 90 90 90 90 89 ec 5d c3 334 335--------------------------------------------------------------------------- 336 337:: 338 339 Dr. G.W. Wettstein Oncology Research Div. Computing Facility 340 Roger Maris Cancer Center INTERNET: greg@wind.rmcc.com 341 820 4th St. N. 342 Fargo, ND 58122 343 Phone: 701-234-7556 344 345