KernelNewbies
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Kernel Hacking

  • Frontpage

  • Kernel Hacking

  • Kernel Documentation

  • Kernel Glossary

  • FAQ

  • Found a bug?

  • Kernel Changelog

  • Upstream Merge Guide

Projects

  • KernelJanitors

  • KernelMentors

  • KernelProjects

Community

  • Why a community?

  • Regional Kernelnewbies

  • Personal Pages

  • Upcoming Events

References

  • Mailing Lists

  • Related Sites

  • Programming Links

Wiki

  • Recent Changes

  • Site Editors

  • Side Bar

  • Tips for Editors

  • Hosted by WikiWall

Navigation

  • RecentChanges
  • FindPage
  • HelpContents

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment

KernelNewbies:
  • FAQ
  • StackTrace

Why does my backtrace contain a mixture of function call chains?

So your kernel oopsed and gave you a stack trace that mostly makes sense, but has a function or two on it that do not get called at all in this code path?

This is a normal occurence in Linux. Unless CONFIG_FRAME_POINTER (or later, CONFIG_UNWINDER_FRAME_POINTER is enabled, the function print_context_stack() simply walks the whole stack and looks for any value that might be the address of a function in the kernel. It has no way of knowing whether that address is a stack frame return address from the current code path, a left-over return address from a previous code path or just a random value that was left on the stack.

If you want to always get reliable stack traces when an oops happens, make sure you enable CONFIG_FRAME_POINTER or CONFIG_UNWINDER_FRAME_POINTER, as well as CONFIG_STACKTRACE, CONFIG_UNWIND_INFO and CONFIG_STACK_UNWIND. For x86_64, CONFIG_UNWINDER_ORC is also a reliable stack trace dumper.

With these configuration options switched on, the kernel knows exactly which addresses are part of the current call chain, and which are not.

How do I manually get a stack trace?

You can manually try to create the stack trace from an oops message or from the stack dump of a task. See the ABI page for details on the stack convention for your architecture.


CategoryFAQ

  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01