€•(ÊŒsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ+/translations/zh_CN/admin-guide/bug-hunting”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ+/translations/zh_TW/admin-guide/bug-hunting”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ+/translations/it_IT/admin-guide/bug-hunting”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ+/translations/ja_JP/admin-guide/bug-hunting”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ+/translations/ko_KR/admin-guide/bug-hunting”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ+/translations/pt_BR/admin-guide/bug-hunting”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ+/translations/sp_SP/admin-guide/bug-hunting”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒ Bug hunting”h]”hŒ Bug hunting”…”�”}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³ŒE/var/lib/git/docbuild/linux/Documentation/admin-guide/bug-hunting.rst”h´KubhŒ paragraph”“”)�”}”(hŒDKernel bug reports often come with a stack dump like the one below::”h]”hŒCKernel bug reports often come with a stack dump like the one below:”…”�”}”(hhÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhŒ literal_block”“”)�”}”(hXñ------------[ cut here ]------------ WARNING: CPU: 1 PID: 28102 at kernel/module.c:1108 module_put+0x57/0x70 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] CPU: 1 PID: 28102 Comm: rmmod Tainted: P WC O 4.8.4-build.1 #1 Hardware name: MSI MS-7309/MS-7309, BIOS V1.12 02/23/2009 00000000 c12ba080 00000000 00000000 c103ed6a c1616014 00000001 00006dc6 c1615862 00000454 c109e8a7 c109e8a7 00000009 ffffffff 00000000 f13f6a10 f5f5a600 c103ee33 00000009 00000000 00000000 c109e8a7 f80ca4d0 c109f617 Call Trace: [] ? dump_stack+0x44/0x64 [] ? __warn+0xfa/0x120 [] ? module_put+0x57/0x70 [] ? module_put+0x57/0x70 [] ? warn_slowpath_null+0x23/0x30 [] ? module_put+0x57/0x70 [] ? gp8psk_fe_set_frontend+0x460/0x460 [dvb_usb_gp8psk] [] ? symbol_put_addr+0x27/0x50 [] ? dvb_usb_adapter_frontend_exit+0x3a/0x70 [dvb_usb] [] ? dvb_usb_exit+0x2f/0xd0 [dvb_usb] [] ? usb_disable_endpoint+0x7c/0xb0 [] ? dvb_usb_device_exit+0x2a/0x50 [dvb_usb] [] ? usb_unbind_interface+0x62/0x250 [] ? __pm_runtime_idle+0x44/0x70 [] ? __device_release_driver+0x78/0x120 [] ? driver_detach+0x87/0x90 [] ? bus_remove_driver+0x38/0x90 [] ? usb_deregister+0x58/0xb0 [] ? SyS_delete_module+0x130/0x1f0 [] ? task_work_run+0x64/0x80 [] ? exit_to_usermode_loop+0x85/0x90 [] ? do_fast_syscall_32+0x80/0x130 [] ? sysenter_past_esp+0x40/0x6a ---[ end trace 6ebc60ef3981792f ]---”h]”hXñ------------[ cut here ]------------ WARNING: CPU: 1 PID: 28102 at kernel/module.c:1108 module_put+0x57/0x70 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] CPU: 1 PID: 28102 Comm: rmmod Tainted: P WC O 4.8.4-build.1 #1 Hardware name: MSI MS-7309/MS-7309, BIOS V1.12 02/23/2009 00000000 c12ba080 00000000 00000000 c103ed6a c1616014 00000001 00006dc6 c1615862 00000454 c109e8a7 c109e8a7 00000009 ffffffff 00000000 f13f6a10 f5f5a600 c103ee33 00000009 00000000 00000000 c109e8a7 f80ca4d0 c109f617 Call Trace: [] ? dump_stack+0x44/0x64 [] ? __warn+0xfa/0x120 [] ? module_put+0x57/0x70 [] ? module_put+0x57/0x70 [] ? warn_slowpath_null+0x23/0x30 [] ? module_put+0x57/0x70 [] ? gp8psk_fe_set_frontend+0x460/0x460 [dvb_usb_gp8psk] [] ? symbol_put_addr+0x27/0x50 [] ? dvb_usb_adapter_frontend_exit+0x3a/0x70 [dvb_usb] [] ? dvb_usb_exit+0x2f/0xd0 [dvb_usb] [] ? usb_disable_endpoint+0x7c/0xb0 [] ? dvb_usb_device_exit+0x2a/0x50 [dvb_usb] [] ? usb_unbind_interface+0x62/0x250 [] ? __pm_runtime_idle+0x44/0x70 [] ? __device_release_driver+0x78/0x120 [] ? driver_detach+0x87/0x90 [] ? bus_remove_driver+0x38/0x90 [] ? usb_deregister+0x58/0xb0 [] ? SyS_delete_module+0x130/0x1f0 [] ? task_work_run+0x64/0x80 [] ? exit_to_usermode_loop+0x85/0x90 [] ? do_fast_syscall_32+0x80/0x130 [] ? sysenter_past_esp+0x40/0x6a ---[ end trace 6ebc60ef3981792f ]---”…”�”}”hhÝsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hÛh³hÊh´Khh·h²hubhÌ)�”}”(hŒÙSuch stack traces provide enough information to identify the line inside the Kernel's source code where the bug happened. Depending on the severity of the issue, it may also contain the word **Oops**, as on this one::”h]”(hŒÁSuch stack traces provide enough information to identify the line inside the Kernel’s source code where the bug happened. Depending on the severity of the issue, it may also contain the word ”…”�”}”(hhíh²hh³Nh´NubhŒstrong”“”)�”}”(hŒ**Oops**”h]”hŒOops”…”�”}”(hh÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhhíubhŒ, as on this one:”…”�”}”(hhíh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K(hh·h²hubhÜ)�”}”(hŒ¸BUG: unable to handle kernel NULL pointer dereference at (null) IP: [] iret_exc+0x7d0/0xa59 *pdpt = 000000002258a001 *pde = 0000000000000000 Oops: 0002 [#1] PREEMPT SMP ...”h]”hŒ¸BUG: unable to handle kernel NULL pointer dereference at (null) IP: [] iret_exc+0x7d0/0xa59 *pdpt = 000000002258a001 *pde = 0000000000000000 Oops: 0002 [#1] PREEMPT SMP ...”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1hÛh³hÊh´K,hh·h²hubhÌ)�”}”(hŒäDespite being an **Oops** or some other sort of stack trace, the offended line is usually required to identify and handle the bug. Along this chapter, we'll refer to "Oops" for all kinds of stack traces that need to be analyzed.”h]”(hŒDespite being an ”…”�”}”(hjh²hh³Nh´Nubhö)�”}”(hŒ**Oops**”h]”hŒOops”…”�”}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjubhŒÑ or some other sort of stack trace, the offended line is usually required to identify and handle the bug. Along this chapter, we’ll refer to “Oopsâ€� for all kinds of stack traces that need to be analyzed.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K2hh·h²hubhÌ)�”}”(hŒ�If the kernel is compiled with ``CONFIG_DEBUG_INFO``, you can enhance the quality of the stack trace by using ``scripts/decode_stacktrace.sh``.”h]”(hŒIf the kernel is compiled with ”…”�”}”(hj=h²hh³Nh´NubhŒliteral”“”)�”}”(hŒ``CONFIG_DEBUG_INFO``”h]”hŒCONFIG_DEBUG_INFO”…”�”}”(hjGh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhj=ubhŒ:, you can enhance the quality of the stack trace by using ”…”�”}”(hj=h²hh³Nh´NubjF)�”}”(hŒ ``scripts/decode_stacktrace.sh``”h]”hŒscripts/decode_stacktrace.sh”…”�”}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhj=ubhŒ.”…”�”}”(hj=h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K6hh·h²hubh¶)�”}”(hhh]”(h»)�”}”(hŒModules linked in”h]”hŒModules linked in”…”�”}”(hjth²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjqh²hh³hÊh´K:ubhÌ)�”}”(hŒùModules that are tainted or are being loaded or unloaded are marked with "(...)", where the taint flags are described in Documentation/admin-guide/tainted-kernels.rst, "being loaded" is annotated with "+", and "being unloaded" is annotated with "-".”h]”hX Modules that are tainted or are being loaded or unloaded are marked with “(...)â€�, where the taint flags are described in Documentation/admin-guide/tainted-kernels.rst, “being loadedâ€� is annotated with “+â€�, and “being unloadedâ€� is annotated with “-“.”…”�”}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K file`` to read the data from the kernel buffers and save it. Or you can ``cat /proc/kmsg > file``, however you have to break in to stop the transfer, since ``kmsg`` is a "never ending file".”h]”(hŒ Sometimes ”…”�”}”(hjh²hh³Nh´NubjF)�”}”(hŒ ``klogd``”h]”hŒklogd”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjubhŒ! dies, in which case you can run ”…”�”}”(hjh²hh³Nh´NubjF)�”}”(hŒ``dmesg > file``”h]”hŒ dmesg > file”…”�”}”(hj+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjubhŒC to read the data from the kernel buffers and save it. Or you can ”…”�”}”(hjh²hh³Nh´NubjF)�”}”(hŒ``cat /proc/kmsg > file``”h]”hŒcat /proc/kmsg > file”…”�”}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjubhŒ;, however you have to break in to stop the transfer, since ”…”�”}”(hjh²hh³Nh´NubjF)�”}”(hŒ``kmsg``”h]”hŒkmsg”…”�”}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjubhŒ is a “never ending fileâ€�.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KKhj˜h²hubhÌ)�”}”(hŒ|If the machine has crashed so badly that you cannot enter commands or the disk is not available then you have three options:”h]”hŒ|If the machine has crashed so badly that you cannot enter commands or the disk is not available then you have three options:”…”�”}”(hjgh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KPhj˜h²hubhŒenumerated_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hXïHand copy the text from the screen and type it in after the machine has restarted. Messy but it is the only option if you have not planned for a crash. Alternatively, you can take a picture of the screen with a digital camera - not nice, but better than nothing. If the messages scroll off the top of the console, you may find that booting with a higher resolution (e.g., ``vga=791``) will allow you to read more of the text. (Caveat: This needs ``vesafb``, so won't help for 'early' oopses.) ”h]”hÌ)�”}”(hXîHand copy the text from the screen and type it in after the machine has restarted. Messy but it is the only option if you have not planned for a crash. Alternatively, you can take a picture of the screen with a digital camera - not nice, but better than nothing. If the messages scroll off the top of the console, you may find that booting with a higher resolution (e.g., ``vga=791``) will allow you to read more of the text. (Caveat: This needs ``vesafb``, so won't help for 'early' oopses.)”h]”(hXvHand copy the text from the screen and type it in after the machine has restarted. Messy but it is the only option if you have not planned for a crash. Alternatively, you can take a picture of the screen with a digital camera - not nice, but better than nothing. If the messages scroll off the top of the console, you may find that booting with a higher resolution (e.g., ”…”�”}”(hj€h²hh³Nh´NubjF)�”}”(hŒ ``vga=791``”h]”hŒvga=791”…”�”}”(hjˆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhj€ubhŒ?) will allow you to read more of the text. (Caveat: This needs ”…”�”}”(hj€h²hh³Nh´NubjF)�”}”(hŒ ``vesafb``”h]”hŒvesafb”…”�”}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhj€ubhŒ*, so won’t help for ‘early’ oopses.)”…”�”}”(hj€h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KShj|ubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhjwh²hh³hÊh´Nubj{)�”}”(hŒêBoot with a serial console (see :ref:`Documentation/admin-guide/serial-console.rst `), run a null modem to a second machine and capture the output there using your favourite communication program. Minicom works well. ”h]”hÌ)�”}”(hŒéBoot with a serial console (see :ref:`Documentation/admin-guide/serial-console.rst `), run a null modem to a second machine and capture the output there using your favourite communication program. Minicom works well.”h]”(hŒ Boot with a serial console (see ”…”�”}”(hj¼h²hh³Nh´Nubh)�”}”(hŒD:ref:`Documentation/admin-guide/serial-console.rst `”h]”hŒinline”“”)�”}”(hjÆh]”hŒ,Documentation/admin-guide/serial-console.rst”…”�”}”(hjÊh²hh³Nh´Nubah}”(h]”h ]”(Œxref”Œstd”Œstd-ref”eh"]”h$]”h&]”uh1jÈhjÄubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”Œadmin-guide/bug-hunting”Œ refdomain”jÕŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆŒ reftarget”Œserial_console”uh1hh³hÊh´K\hj¼ubhŒ…), run a null modem to a second machine and capture the output there using your favourite communication program. Minicom works well.”…”�”}”(hj¼h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K\hj¸ubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhjwh²hh³hÊh´Nubj{)�”}”(hŒ¶Use Kdump (see Documentation/admin-guide/kdump/kdump.rst), extract the kernel ring buffer from old memory with using dmesg gdbmacro in Documentation/admin-guide/kdump/gdbmacros.txt. ”h]”hÌ)�”}”(hŒµUse Kdump (see Documentation/admin-guide/kdump/kdump.rst), extract the kernel ring buffer from old memory with using dmesg gdbmacro in Documentation/admin-guide/kdump/gdbmacros.txt.”h]”hŒµUse Kdump (see Documentation/admin-guide/kdump/kdump.rst), extract the kernel ring buffer from old memory with using dmesg gdbmacro in Documentation/admin-guide/kdump/gdbmacros.txt.”…”�”}”(hjýh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kahjùubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhjwh²hh³hÊh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”Œ(”Œsuffix”Œ)”uh1juhj˜h²hh³hÊh´KSubeh}”(h]”Œ!where-is-the-oops-message-located”ah ]”h"]”Œ"where is the oops message located?”ah$]”h&]”uh1hµhh·h²hh³hÊh´KCubh¶)�”}”(hhh]”(h»)�”}”(hŒFinding the bug's location”h]”hŒFinding the bug’s location”…”�”}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj%h²hh³hÊh´KfubhÌ)�”}”(hŒÙReporting a bug works best if you point the location of the bug at the Kernel source file. There are two methods for doing that. Usually, using ``gdb`` is easier, but the Kernel should be pre-compiled with debug info.”h]”(hŒ�Reporting a bug works best if you point the location of the bug at the Kernel source file. There are two methods for doing that. Usually, using ”…”�”}”(hj6h²hh³Nh´NubjF)�”}”(hŒ``gdb``”h]”hŒgdb”…”�”}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhj6ubhŒB is easier, but the Kernel should be pre-compiled with debug info.”…”�”}”(hj6h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khhj%h²hubh¶)�”}”(hhh]”(h»)�”}”(hŒgdb”h]”hŒgdb”…”�”}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjVh²hh³hÊh´KmubhÌ)�”}”(hŒ~The GNU debugger (``gdb``) is the best way to figure out the exact file and line number of the OOPS from the ``vmlinux`` file.”h]”(hŒThe GNU debugger (”…”�”}”(hjgh²hh³Nh´NubjF)�”}”(hŒ``gdb``”h]”hŒgdb”…”�”}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjgubhŒT) is the best way to figure out the exact file and line number of the OOPS from the ”…”�”}”(hjgh²hh³Nh´NubjF)�”}”(hŒ ``vmlinux``”h]”hŒvmlinux”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjgubhŒ file.”…”�”}”(hjgh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KohjVh²hubhÌ)�”}”(hŒiThe usage of gdb works best on a kernel compiled with ``CONFIG_DEBUG_INFO``. This can be set by running::”h]”(hŒ6The usage of gdb works best on a kernel compiled with ”…”�”}”(hj™h²hh³Nh´NubjF)�”}”(hŒ``CONFIG_DEBUG_INFO``”h]”hŒCONFIG_DEBUG_INFO”…”�”}”(hj¡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhj™ubhŒ. This can be set by running:”…”�”}”(hj™h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KrhjVh²hubhÜ)�”}”(hŒ@$ ./scripts/config -d COMPILE_TEST -e DEBUG_KERNEL -e DEBUG_INFO”h]”hŒ@$ ./scripts/config -d COMPILE_TEST -e DEBUG_KERNEL -e DEBUG_INFO”…”�”}”hj¹sbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1hÛh³hÊh´KuhjVh²hubhÌ)�”}”(hŒbOn a kernel compiled with ``CONFIG_DEBUG_INFO``, you can simply copy the EIP value from the OOPS::”h]”(hŒOn a kernel compiled with ”…”�”}”(hjÇh²hh³Nh´NubjF)�”}”(hŒ``CONFIG_DEBUG_INFO``”h]”hŒCONFIG_DEBUG_INFO”…”�”}”(hjÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjÇubhŒ2, you can simply copy the EIP value from the OOPS:”…”�”}”(hjÇh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KwhjVh²hubhÜ)�”}”(hŒ,EIP: 0060:[] Not tainted VLI”h]”hŒ,EIP: 0060:[] Not tainted VLI”…”�”}”hjçsbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1hÛh³hÊh´KzhjVh²hubhÌ)�”}”(hŒ6And use GDB to translate that to human-readable form::”h]”hŒ5And use GDB to translate that to human-readable form:”…”�”}”(hjõh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K|hjVh²hubhÜ)�”}”(hŒ!$ gdb vmlinux (gdb) l *0xc021e50e”h]”hŒ!$ gdb vmlinux (gdb) l *0xc021e50e”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1hÛh³hÊh´K~hjVh²hubhÌ)�”}”(hŒ\If you don't have ``CONFIG_DEBUG_INFO`` enabled, you use the function offset from the OOPS::”h]”(hŒIf you don’t have ”…”�”}”(hjh²hh³Nh´NubjF)�”}”(hŒ``CONFIG_DEBUG_INFO``”h]”hŒCONFIG_DEBUG_INFO”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjubhŒ4 enabled, you use the function offset from the OOPS:”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K�hjVh²hubhÜ)�”}”(hŒEIP is at vt_ioctl+0xda8/0x1482”h]”hŒEIP is at vt_ioctl+0xda8/0x1482”…”�”}”hj1sbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1hÛh³hÊh´K„hjVh²hubhÌ)�”}”(hŒ=And recompile the kernel with ``CONFIG_DEBUG_INFO`` enabled::”h]”(hŒAnd recompile the kernel with ”…”�”}”(hj?h²hh³Nh´NubjF)�”}”(hŒ``CONFIG_DEBUG_INFO``”h]”hŒCONFIG_DEBUG_INFO”…”�”}”(hjGh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhj?ubhŒ enabled:”…”�”}”(hj?h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K†hjVh²hubhÜ)�”}”(hXÒ$ ./scripts/config -d COMPILE_TEST -e DEBUG_KERNEL -e DEBUG_INFO $ make vmlinux $ gdb vmlinux (gdb) l *vt_ioctl+0xda8 0x1888 is in vt_ioctl (drivers/tty/vt/vt_ioctl.c:293). 288 { 289 struct vc_data *vc = NULL; 290 int ret = 0; 291 292 console_lock(); 293 if (VT_BUSY(vc_num)) 294 ret = -EBUSY; 295 else if (vc_num) 296 vc = vc_deallocate(vc_num); 297 console_unlock();”h]”hXÒ$ ./scripts/config -d COMPILE_TEST -e DEBUG_KERNEL -e DEBUG_INFO $ make vmlinux $ gdb vmlinux (gdb) l *vt_ioctl+0xda8 0x1888 is in vt_ioctl (drivers/tty/vt/vt_ioctl.c:293). 288 { 289 struct vc_data *vc = NULL; 290 int ret = 0; 291 292 console_lock(); 293 if (VT_BUSY(vc_num)) 294 ret = -EBUSY; 295 else if (vc_num) 296 vc = vc_deallocate(vc_num); 297 console_unlock();”…”�”}”hj_sbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1hÛh³hÊh´KˆhjVh²hubhÌ)�”}”(hŒ$or, if you want to be more verbose::”h]”hŒ#or, if you want to be more verbose:”…”�”}”(hjmh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K˜hjVh²hubhÜ)�”}”(hŒt(gdb) p vt_ioctl $1 = {int (struct tty_struct *, unsigned int, unsigned long)} 0xae0 (gdb) l *0xae0+0xda8”h]”hŒt(gdb) p vt_ioctl $1 = {int (struct tty_struct *, unsigned int, unsigned long)} 0xae0 (gdb) l *0xae0+0xda8”…”�”}”hj{sbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1hÛh³hÊh´KšhjVh²hubhÌ)�”}”(hŒ)You could, instead, use the object file::”h]”hŒ(You could, instead, use the object file:”…”�”}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KžhjVh²hubhÜ)�”}”(hŒK$ make drivers/tty/ $ gdb drivers/tty/vt/vt_ioctl.o (gdb) l *vt_ioctl+0xda8”h]”hŒK$ make drivers/tty/ $ gdb drivers/tty/vt/vt_ioctl.o (gdb) l *vt_ioctl+0xda8”…”�”}”hj—sbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1hÛh³hÊh´K hjVh²hubhÌ)�”}”(hŒ#If you have a call trace, such as::”h]”hŒ"If you have a call trace, such as:”…”�”}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¤hjVh²hubhÜ)�”}”(hŒ±Call Trace: [] :jbd:log_wait_commit+0xa3/0xf5 [] autoremove_wake_function+0x0/0x2e [] :jbd:journal_stop+0x1be/0x1ee ...”h]”hŒ±Call Trace: [] :jbd:log_wait_commit+0xa3/0xf5 [] autoremove_wake_function+0x0/0x2e [] :jbd:journal_stop+0x1be/0x1ee ...”…”�”}”hj³sbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1hÛh³hÊh´K¦hjVh²hubhÌ)�”}”(hŒrthis shows the problem likely is in the :jbd: module. You can load that module in gdb and list the relevant code::”h]”hŒqthis shows the problem likely is in the :jbd: module. You can load that module in gdb and list the relevant code:”…”�”}”(hjÁh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¬hjVh²hubhÜ)�”}”(hŒ1$ gdb fs/jbd/jbd.ko (gdb) l *log_wait_commit+0xa3”h]”hŒ1$ gdb fs/jbd/jbd.ko (gdb) l *log_wait_commit+0xa3”…”�”}”hjÏsbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1hÛh³hÊh´K¯hjVh²hubhŒnote”“”)�”}”(hX4You can also do the same for any function call at the stack trace, like this one:: [] ? dvb_usb_adapter_frontend_exit+0x3a/0x70 [dvb_usb] The position where the above call happened can be seen with:: $ gdb drivers/media/usb/dvb-usb/dvb-usb.o (gdb) l *dvb_usb_adapter_frontend_exit+0x3a”h]”(hÌ)�”}”(hŒRYou can also do the same for any function call at the stack trace, like this one::”h]”hŒQYou can also do the same for any function call at the stack trace, like this one:”…”�”}”(hjãh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K´hjßubhÜ)�”}”(hŒ@[] ? dvb_usb_adapter_frontend_exit+0x3a/0x70 [dvb_usb]”h]”hŒ@[] ? dvb_usb_adapter_frontend_exit+0x3a/0x70 [dvb_usb]”…”�”}”hjñsbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1hÛh³hÊh´K·hjßubhÌ)�”}”(hŒ=The position where the above call happened can be seen with::”h]”hŒ 83 3c 01 00 00 89 44 24 14 8b 45 28 85 c0 89 44 24 18 0f 85 Put the bytes into a "foo.s" file like this: .text .globl foo foo: .byte .... /* bytes from Code: part of OOPS dump */ Compile it with "gcc -c -o foo.o foo.s" then look at the output of "objdump --disassemble foo.o". Output: ip_queue_xmit: push %ebp push %edi push %esi push %ebx sub $0xbc, %esp mov 0xd0(%esp), %ebp ! %ebp = arg0 (skb) mov 0x8(%ebp), %ebx ! %ebx = skb->sk mov 0x13c(%ebx), %eax ! %eax = inet_sk(sk)->opt”h]”hXEIP is at +0x14/0x4c0 ... Code: 44 24 04 e8 6f 05 00 00 e9 e8 fe ff ff 8d 76 00 8d bc 27 00 00 00 00 55 57 56 53 81 ec bc 00 00 00 8b ac 24 d0 00 00 00 8b 5d 08 <8b> 83 3c 01 00 00 89 44 24 14 8b 45 28 85 c0 89 44 24 18 0f 85 Put the bytes into a "foo.s" file like this: .text .globl foo foo: .byte .... /* bytes from Code: part of OOPS dump */ Compile it with "gcc -c -o foo.o foo.s" then look at the output of "objdump --disassemble foo.o". Output: ip_queue_xmit: push %ebp push %edi push %esi push %ebx sub $0xbc, %esp mov 0xd0(%esp), %ebp ! %ebp = arg0 (skb) mov 0x8(%ebp), %ebx ! %ebx = skb->sk mov 0x13c(%ebx), %eax ! %eax = inet_sk(sk)->opt”…”�”}”hj|sbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1hÛh³hÊh´KÒhj)h²hubhÌ)�”}”(hŒr``scripts/decodecode`` can be used to automate most of this, depending on what CPU architecture is being debugged.”h]”(jF)�”}”(hŒ``scripts/decodecode``”h]”hŒscripts/decodecode”…”�”}”(hjŽh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjŠubhŒ\ can be used to automate most of this, depending on what CPU architecture is being debugged.”…”�”}”(hjŠh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kîhj)h²hubeh}”(h]”Œobjdump”ah ]”h"]”Œobjdump”ah$]”h&]”uh1hµhj%h²hh³hÊh´K¿ubeh}”(h]”Œfinding-the-bug-s-location”ah ]”h"]”Œfinding the bug's location”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kfubh¶)�”}”(hhh]”(h»)�”}”(hŒReporting the bug”h]”hŒReporting the bug”…”�”}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj¶h²hh³hÊh´KòubhÌ)�”}”(hŒ€Once you find where the bug happened, by inspecting its location, you could either try to fix it yourself or report it upstream.”h]”hŒ€Once you find where the bug happened, by inspecting its location, you could either try to fix it yourself or report it upstream.”…”�”}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kôhj¶h²hubhÌ)�”}”(hŒÇIn order to report it upstream, you should identify the bug tracker, if any, or mailing list used for the development of the affected code. This can be done by using the ``get_maintainer.pl`` script.”h]”(hŒªIn order to report it upstream, you should identify the bug tracker, if any, or mailing list used for the development of the affected code. This can be done by using the ”…”�”}”(hjÕh²hh³Nh´NubjF)�”}”(hŒ``get_maintainer.pl``”h]”hŒget_maintainer.pl”…”�”}”(hjÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjÕubhŒ script.”…”�”}”(hjÕh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K÷hj¶h²hubhÌ)�”}”(hŒ_For example, if you find a bug at the gspca's sonixj.c file, you can get its maintainers with::”h]”hŒ`For example, if you find a bug at the gspca’s sonixj.c file, you can get its maintainers with:”…”�”}”(hjõh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kûhj¶h²hubhÜ)�”}”(hX;$ ./scripts/get_maintainer.pl --bug -f drivers/media/usb/gspca/sonixj.c Hans Verkuil (odd fixer:GSPCA USB WEBCAM DRIVER,commit_signer:1/1=100%) Mauro Carvalho Chehab (maintainer:MEDIA INPUT INFRASTRUCTURE (V4L/DVB),commit_signer:1/1=100%) Tejun Heo (commit_signer:1/1=100%) Bhaktipriya Shridhar (commit_signer:1/1=100%,authored:1/1=100%,added_lines:4/4=100%,removed_lines:9/9=100%) linux-media@vger.kernel.org (open list:GSPCA USB WEBCAM DRIVER) linux-kernel@vger.kernel.org (open list)”h]”hX;$ ./scripts/get_maintainer.pl --bug -f drivers/media/usb/gspca/sonixj.c Hans Verkuil (odd fixer:GSPCA USB WEBCAM DRIVER,commit_signer:1/1=100%) Mauro Carvalho Chehab (maintainer:MEDIA INPUT INFRASTRUCTURE (V4L/DVB),commit_signer:1/1=100%) Tejun Heo (commit_signer:1/1=100%) Bhaktipriya Shridhar (commit_signer:1/1=100%,authored:1/1=100%,added_lines:4/4=100%,removed_lines:9/9=100%) linux-media@vger.kernel.org (open list:GSPCA USB WEBCAM DRIVER) linux-kernel@vger.kernel.org (open list)”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1hÛh³hÊh´Kþhj¶h²hubhÌ)�”}”(hŒ$Please notice that it will point to:”h]”hŒ$Please notice that it will point to:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj¶h²hubhŒ bullet_list”“”)�”}”(hhh]”(j{)�”}”(hŒÐThe last developers that touched the source code (if this is done inside a git tree). On the above example, Tejun and Bhaktipriya (in this specific case, none really involved on the development of this file);”h]”hÌ)�”}”(hŒÐThe last developers that touched the source code (if this is done inside a git tree). On the above example, Tejun and Bhaktipriya (in this specific case, none really involved on the development of this file);”h]”hŒÐThe last developers that touched the source code (if this is done inside a git tree). On the above example, Tejun and Bhaktipriya (in this specific case, none really involved on the development of this file);”…”�”}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj$ubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhj!h²hh³hÊh´Nubj{)�”}”(hŒ%The driver maintainer (Hans Verkuil);”h]”hÌ)�”}”(hj>h]”hŒ%The driver maintainer (Hans Verkuil);”…”�”}”(hj@h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hj<ubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhj!h²hh³hÊh´Nubj{)�”}”(hŒ1The subsystem maintainer (Mauro Carvalho Chehab);”h]”hÌ)�”}”(hjUh]”hŒ1The subsystem maintainer (Mauro Carvalho Chehab);”…”�”}”(hjWh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hjSubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhj!h²hh³hÊh´Nubj{)�”}”(hŒGThe driver and/or subsystem mailing list (linux-media@vger.kernel.org);”h]”hÌ)�”}”(hjlh]”(hŒ*The driver and/or subsystem mailing list (”…”�”}”(hjnh²hh³Nh´NubhŒ reference”“”)�”}”(hŒlinux-media@vger.kernel.org”h]”hŒlinux-media@vger.kernel.org”…”�”}”(hjwh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œ"mailto:linux-media@vger.kernel.org”uh1juhjnubhŒ);”…”�”}”(hjnh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hjjubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhj!h²hh³hÊh´Nubj{)�”}”(hŒ=The Linux Kernel mailing list (linux-kernel@vger.kernel.org);”h]”hÌ)�”}”(hj™h]”(hŒThe Linux Kernel mailing list (”…”�”}”(hj›h²hh³Nh´Nubjv)�”}”(hŒlinux-kernel@vger.kernel.org”h]”hŒlinux-kernel@vger.kernel.org”…”�”}”(hj¢h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œ#mailto:linux-kernel@vger.kernel.org”uh1juhj›ubhŒ);”…”�”}”(hj›h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj—ubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhj!h²hh³hÊh´Nubj{)�”}”(hŒMThe bug reporting URIs for the driver/subsystem (none in the above example). ”h]”hÌ)�”}”(hŒLThe bug reporting URIs for the driver/subsystem (none in the above example).”h]”hŒLThe bug reporting URIs for the driver/subsystem (none in the above example).”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MhjÂubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhj!h²hh³hÊh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jh³hÊh´Mhj¶h²hubhÌ)�”}”(hŒãIf the listing contains bug reporting URIs at the end, please prefer them over email. Otherwise, please report bugs to the mailing list used for the development of the code (linux-media ML) copying the driver maintainer (Hans).”h]”hŒãIf the listing contains bug reporting URIs at the end, please prefer them over email. Otherwise, please report bugs to the mailing list used for the development of the code (linux-media ML) copying the driver maintainer (Hans).”…”�”}”(hjâh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj¶h²hubhÌ)�”}”(hŒ If you are totally stumped as to whom to send the report, and ``get_maintainer.pl`` didn't provide you anything useful, send it to linux-kernel@vger.kernel.org.”h]”(hŒ>If you are totally stumped as to whom to send the report, and ”…”�”}”(hjðh²hh³Nh´NubjF)�”}”(hŒ``get_maintainer.pl``”h]”hŒget_maintainer.pl”…”�”}”(hjøh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjðubhŒ2 didn’t provide you anything useful, send it to ”…”�”}”(hjðh²hh³Nh´Nubjv)�”}”(hŒlinux-kernel@vger.kernel.org”h]”hŒlinux-kernel@vger.kernel.org”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œ#mailto:linux-kernel@vger.kernel.org”uh1juhjðubhŒ.”…”�”}”(hjðh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj¶h²hubhÌ)�”}”(hŒCThanks for your help in making Linux as stable as humanly possible.”h]”hŒCThanks for your help in making Linux as stable as humanly possible.”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj¶h²hubeh}”(h]”Œreporting-the-bug”ah ]”h"]”Œreporting the bug”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kòubh¶)�”}”(hhh]”(h»)�”}”(hŒFixing the bug”h]”hŒFixing the bug”…”�”}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj:h²hh³hÊh´MubhÌ)�”}”(hŒÙIf you know programming, you could help us by not only reporting the bug, but also providing us with a solution. After all, open source is about sharing what you do and don't you want to be recognised for your genius?”h]”hŒÛIf you know programming, you could help us by not only reporting the bug, but also providing us with a solution. After all, open source is about sharing what you do and don’t you want to be recognised for your genius?”…”�”}”(hjKh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj:h²hubhÌ)�”}”(hŒYIf you decide to take this way, once you have worked out a fix please submit it upstream.”h]”hŒYIf you decide to take this way, once you have worked out a fix please submit it upstream.”…”�”}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M"hj:h²hubhÌ)�”}”(hŒ}Please do read :ref:`Documentation/process/submitting-patches.rst ` though to help your code get accepted.”h]”(hŒPlease do read ”…”�”}”(hjgh²hh³Nh´Nubh)�”}”(hŒG:ref:`Documentation/process/submitting-patches.rst `”h]”jÉ)�”}”(hjqh]”hŒ,Documentation/process/submitting-patches.rst”…”�”}”(hjsh²hh³Nh´Nubah}”(h]”h ]”(jÔŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jÈhjoubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jጠrefdomain”j}Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjçŒsubmittingpatches”uh1hh³hÊh´M%hjgubhŒ' though to help your code get accepted.”…”�”}”(hjgh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M%hj:h²hubeh}”(h]”Œfixing-the-bug”ah ]”h"]”Œfixing the bug”ah$]”h&]”uh1hµhh·h²hh³hÊh´MubhŒ transition”“”)�”}”(hŒK---------------------------------------------------------------------------”h]”h}”(h]”h ]”h"]”h$]”h&]”uh1j¡h³hÊh´M*hh·h²hubh¶)�”}”(hhh]”(h»)�”}”(hŒ$Notes on Oops tracing with ``klogd``”h]”(hŒNotes on Oops tracing with ”…”�”}”(hj°h²hh³Nh´NubjF)�”}”(hŒ ``klogd``”h]”hŒklogd”…”�”}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhj°ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hºhj­h²hh³hÊh´M-ubhÌ)�”}”(hXIn order to help Linus and the other kernel developers there has been substantial support incorporated into ``klogd`` for processing protection faults. In order to have full support for address resolution at least version 1.3-pl3 of the ``sysklogd`` package should be used.”h]”(hŒlIn order to help Linus and the other kernel developers there has been substantial support incorporated into ”…”�”}”(hjÌh²hh³Nh´NubjF)�”}”(hŒ ``klogd``”h]”hŒklogd”…”�”}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjÌubhŒy for processing protection faults. In order to have full support for address resolution at least version 1.3-pl3 of the ”…”�”}”(hjÌh²hh³Nh´NubjF)�”}”(hŒ ``sysklogd``”h]”hŒsysklogd”…”�”}”(hjæh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjÌubhŒ package should be used.”…”�”}”(hjÌh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M/hj­h²hubhÌ)�”}”(hXvWhen a protection fault occurs the ``klogd`` daemon automatically translates important addresses in the kernel log messages to their symbolic equivalents. This translated kernel message is then forwarded through whatever reporting mechanism ``klogd`` is using. The protection fault message can be simply cut out of the message files and forwarded to the kernel developers.”h]”(hŒ#When a protection fault occurs the ”…”�”}”(hjþh²hh³Nh´NubjF)�”}”(hŒ ``klogd``”h]”hŒklogd”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjþubhŒÆ daemon automatically translates important addresses in the kernel log messages to their symbolic equivalents. This translated kernel message is then forwarded through whatever reporting mechanism ”…”�”}”(hjþh²hh³Nh´NubjF)�”}”(hŒ ``klogd``”h]”hŒklogd”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjþubhŒ{ is using. The protection fault message can be simply cut out of the message files and forwarded to the kernel developers.”…”�”}”(hjþh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M4hj­h²hubhÌ)�”}”(hX}Two types of address resolution are performed by ``klogd``. The first is static translation and the second is dynamic translation. Static translation uses the System.map file. In order to do static translation the ``klogd`` daemon must be able to find a system map file at daemon initialization time. See the klogd man page for information on how ``klogd`` searches for map files.”h]”(hŒ1Two types of address resolution are performed by ”…”�”}”(hj0h²hh³Nh´NubjF)�”}”(hŒ ``klogd``”h]”hŒklogd”…”�”}”(hj8h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhj0ubhŒ�. The first is static translation and the second is dynamic translation. Static translation uses the System.map file. In order to do static translation the ”…”�”}”(hj0h²hh³Nh´NubjF)�”}”(hŒ ``klogd``”h]”hŒklogd”…”�”}”(hjJh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhj0ubhŒ| daemon must be able to find a system map file at daemon initialization time. See the klogd man page for information on how ”…”�”}”(hj0h²hh³Nh´NubjF)�”}”(hŒ ``klogd``”h]”hŒklogd”…”�”}”(hj\h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhj0ubhŒ searches for map files.”…”�”}”(hj0h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M;hj­h²hubhÌ)�”}”(hXDynamic address translation is important when kernel loadable modules are being used. Since memory for kernel modules is allocated from the kernel's dynamic memory pools there are no fixed locations for either the start of the module or for functions and symbols in the module.”h]”hXDynamic address translation is important when kernel loadable modules are being used. Since memory for kernel modules is allocated from the kernel’s dynamic memory pools there are no fixed locations for either the start of the module or for functions and symbols in the module.”…”�”}”(hjth²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MChj­h²hubhÌ)�”}”(hXThe kernel supports system calls which allow a program to determine which modules are loaded and their location in memory. Using these system calls the klogd daemon builds a symbol table which can be used to debug a protection fault which occurs in a loadable kernel module.”h]”hXThe kernel supports system calls which allow a program to determine which modules are loaded and their location in memory. Using these system calls the klogd daemon builds a symbol table which can be used to debug a protection fault which occurs in a loadable kernel module.”…”�”}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MHhj­h²hubhÌ)�”}”(hŒ÷At the very minimum klogd will provide the name of the module which generated the protection fault. There may be additional symbolic information available if the developer of the loadable module chose to export symbol information from the module.”h]”hŒ÷At the very minimum klogd will provide the name of the module which generated the protection fault. There may be additional symbolic information available if the developer of the loadable module chose to export symbol information from the module.”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MMhj­h²hubhÌ)�”}”(hXbSince the kernel module environment can be dynamic there must be a mechanism for notifying the ``klogd`` daemon when a change in module environment occurs. There are command line options available which allow klogd to signal the currently executing daemon that symbol information should be refreshed. See the ``klogd`` manual page for more information.”h]”(hŒ_Since the kernel module environment can be dynamic there must be a mechanism for notifying the ”…”�”}”(hjžh²hh³Nh´NubjF)�”}”(hŒ ``klogd``”h]”hŒklogd”…”�”}”(hj¦h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjžubhŒÏ daemon when a change in module environment occurs. There are command line options available which allow klogd to signal the currently executing daemon that symbol information should be refreshed. See the ”…”�”}”(hjžh²hh³Nh´NubjF)�”}”(hŒ ``klogd``”h]”hŒklogd”…”�”}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjžubhŒ" manual page for more information.”…”�”}”(hjžh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MRhj­h²hubhÌ)�”}”(hX+A patch is included with the sysklogd distribution which modifies the ``modules-2.0.0`` package to automatically signal klogd whenever a module is loaded or unloaded. Applying this patch provides essentially seamless support for debugging protection faults which occur with kernel loadable modules.”h]”(hŒFA patch is included with the sysklogd distribution which modifies the ”…”�”}”(hjÐh²hh³Nh´NubjF)�”}”(hŒ``modules-2.0.0``”h]”hŒ modules-2.0.0”…”�”}”(hjØh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjÐubhŒÔ package to automatically signal klogd whenever a module is loaded or unloaded. Applying this patch provides essentially seamless support for debugging protection faults which occur with kernel loadable modules.”…”�”}”(hjÐh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MYhj­h²hubhÌ)�”}”(hŒ_The following is an example of a protection fault in a loadable module processed by ``klogd``::”h]”(hŒTThe following is an example of a protection fault in a loadable module processed by ”…”�”}”(hjðh²hh³Nh´NubjF)�”}”(hŒ ``klogd``”h]”hŒklogd”…”�”}”(hjøh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjðubhŒ:”…”�”}”(hjðh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M_hj­h²hubhÜ)�”}”(hX9Aug 29 09:51:01 blizard kernel: Unable to handle kernel paging request at virtual address f15e97cc Aug 29 09:51:01 blizard kernel: current->tss.cr3 = 0062d000, %cr3 = 0062d000 Aug 29 09:51:01 blizard kernel: *pde = 00000000 Aug 29 09:51:01 blizard kernel: Oops: 0002 Aug 29 09:51:01 blizard kernel: CPU: 0 Aug 29 09:51:01 blizard kernel: EIP: 0010:[oops:_oops+16/3868] Aug 29 09:51:01 blizard kernel: EFLAGS: 00010212 Aug 29 09:51:01 blizard kernel: eax: 315e97cc ebx: 003a6f80 ecx: 001be77b edx: 00237c0c Aug 29 09:51:01 blizard kernel: esi: 00000000 edi: bffffdb3 ebp: 00589f90 esp: 00589f8c Aug 29 09:51:01 blizard kernel: ds: 0018 es: 0018 fs: 002b gs: 002b ss: 0018 Aug 29 09:51:01 blizard kernel: Process oops_test (pid: 3374, process nr: 21, stackpage=00589000) Aug 29 09:51:01 blizard kernel: Stack: 315e97cc 00589f98 0100b0b4 bffffed4 0012e38e 00240c64 003a6f80 00000001 Aug 29 09:51:01 blizard kernel: 00000000 00237810 bfffff00 0010a7fa 00000003 00000001 00000000 bfffff00 Aug 29 09:51:01 blizard kernel: bffffdb3 bffffed4 ffffffda 0000002b 0007002b 0000002b 0000002b 00000036 Aug 29 09:51:01 blizard kernel: Call Trace: [oops:_oops_ioctl+48/80] [_sys_ioctl+254/272] [_system_call+82/128] 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”h]”hX9Aug 29 09:51:01 blizard kernel: Unable to handle kernel paging request at virtual address f15e97cc Aug 29 09:51:01 blizard kernel: current->tss.cr3 = 0062d000, %cr3 = 0062d000 Aug 29 09:51:01 blizard kernel: *pde = 00000000 Aug 29 09:51:01 blizard kernel: Oops: 0002 Aug 29 09:51:01 blizard kernel: CPU: 0 Aug 29 09:51:01 blizard kernel: EIP: 0010:[oops:_oops+16/3868] Aug 29 09:51:01 blizard kernel: EFLAGS: 00010212 Aug 29 09:51:01 blizard kernel: eax: 315e97cc ebx: 003a6f80 ecx: 001be77b edx: 00237c0c Aug 29 09:51:01 blizard kernel: esi: 00000000 edi: bffffdb3 ebp: 00589f90 esp: 00589f8c Aug 29 09:51:01 blizard kernel: ds: 0018 es: 0018 fs: 002b gs: 002b ss: 0018 Aug 29 09:51:01 blizard kernel: Process oops_test (pid: 3374, process nr: 21, stackpage=00589000) Aug 29 09:51:01 blizard kernel: Stack: 315e97cc 00589f98 0100b0b4 bffffed4 0012e38e 00240c64 003a6f80 00000001 Aug 29 09:51:01 blizard kernel: 00000000 00237810 bfffff00 0010a7fa 00000003 00000001 00000000 bfffff00 Aug 29 09:51:01 blizard kernel: bffffdb3 bffffed4 ffffffda 0000002b 0007002b 0000002b 0000002b 00000036 Aug 29 09:51:01 blizard kernel: Call Trace: [oops:_oops_ioctl+48/80] [_sys_ioctl+254/272] [_system_call+82/128] 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”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1hÛh³hÊh´Mbhj­h²hubeh}”(h]”Œ notes-on-oops-tracing-with-klogd”ah ]”h"]”Œ notes on oops tracing with klogd”ah$]”h&]”uh1hµhh·h²hh³hÊh´M-ubeh}”(h]”Œ bug-hunting”ah ]”h"]”Œ bug hunting”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(hºNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jQ Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÊŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(j+ j( j•j’j"jj³j°j&j#j«j¨j7j4jžj›j# j uŒ nametypes”}”(j+ ‰j•‰j"‰j³‰j&‰j«‰j7‰jž‰j# ‰uh}”(j( h·j’jqjj˜j°j%j#jVj¨j)j4j¶j›j:j j­uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.