Debugging

Differences between revisions 8 and 12 (spanning 4 versions)
Revision 8 as of 2010-02-15 11:38:59
Size: 2370
Editor: e177164124
Comment: page was renamed from Chromium/Debug
Revision 12 as of 2012-07-11 10:33:46
Size: 2135
Editor: mitya57
Comment: Added Debugging page header
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
<<Include(Debugging/Header)>>
Line 2: Line 4:
When you want to file a bug, it should be filed '''upstream''' using this '''[[http://code.google.com/p/chromium/issues/entry?template=Defect%20on%20Linux|linux template]]'''.
Please always include the result of the following command:
{{{
dpkg -l | grep chromium-}}}

= Debugging Chromium crashes =

If chromium crashes and if you want to file a '''[[http://code.google.com/p/chromium/issues/entry?template=Defect%20on%20Linux|bug upstream]]''', you need to provide a proper backtrace for your crash.

It could be accomplished using '''gdb''' and some debug packages.

If you know nothing about gdb, the generic instructions are available here: [[https://wiki.ubuntu.com/Backtrace|Backtraces with gdb]]

The debug package for chromium is called '''chromium-browser-dbg''' (it's big, ~75MB). It could be installed and removed like any other packages.

Note: you may need other debug packages if the backtrace shows lines like "#5 0x083949e0 in ?? ()".
In that case, you need the corresponding -dbg or -dbgsym packages.
Instructions about those are available in [[https://wiki.ubuntu.com/DebuggingProgramCrash|DebuggingProgramCrash]]

Once done, open a terminal and proceed as follow:
If Chromium crashes and you want to file a bug upstream, use their [[http://code.google.com/p/chromium/issues/entry?template=Defect%20on%20Linux|linux template]]. Always include the output from the following command:
Line 24: Line 7:
chromium-browser --debug 2>&1 | tee gdb-chromium.txt $ dpkg -l | grep chromium-
}}}

You'll need to provide a [[https://wiki.ubuntu.com/Backtrace|backtrace]]. It can be produced using gdb, with the help of debugging symbols.

== Getting a backtrace ==
Debugging symbols come in packages that can be [[InstallingSoftware|installed just like any other software package]] in Ubuntu. The debugging symbols package for Chromium is called ''chromium-browser-dbg''. Once you've installed it, open a terminal and proceed as follows:

{{{
$ chromium-browser --debug 2>&1 | tee gdb-chromium.txt
Line 30: Line 22:
do what you need to do to trigger the crash, then: Do what you need to do to trigger the crash, then:
Line 38: Line 30:
Check the file '''gdb-chromium.txt''' to see if it contains symbols (as few "?? ()" as possible).
If not, please locate and install the missing debug package(s) and retry.
If the backtrace shows lots of lines with question marks (such as "#5&nbsp;0x083949e0&nbsp;in&nbsp;??&nbsp;()"), you're likely to need additional debugging symbols packages. To find out which libraries Chromium is loading, try:
Line 41: Line 32:
Note: ''ldd /usr/lib/chromium-browser/chromium-browser'' could give you a clue of which libs are loaded, and http://packages.ubuntu.com/ could tell you in which package they live. {{{
$ ldd /usr/lib/chromium-browser/chromium-browser
}}}
Line 43: Line 36:
Once you feel it's good enough, you may attach the file '''gdb-chromium.txt''' to your bug report. Then look for corresponding -dbg or -dbgsym packages in the repositories.
Line 45: Line 38:
Note: since chromium is multi-process (it spawns several processes, such as the sandbox and all renderers), the stack may be useless, depending on where the crash occurs. You can then try with --single-process (after --debug). If it is still not enough, you can try inferring from the upstream chrome debugging tips: http://code.google.com/p/chromium/wiki/LinuxDebugging == Debugging child processes ==
Since Chromium normally spawns several processes (such as the sandbox and renderers), the backtrace from the browser process may not be useful (unless it is the main process that crashes). For catching backtraces from Chromium's child processes, you should run Chromium with --single-process:

{{{
$ chromium-browser --debug --single-process 2>&1 | tee gdb-chromium.txt
}}}

Then proceed as above with gdb.

Once you feel your backtrace file (gdb-chromium.txt) is sufficient, attach it to your bug report.

== External links ==
 * [[http://code.google.com/p/chromium/wiki/LinuxDebugging|Upstream debugging instructions]]

----
CategoryDebugging

Debugging Central

This page is part of the debugging series — pages with debugging details for a variety of Ubuntu packages.

If Chromium crashes and you want to file a bug upstream, use their linux template. Always include the output from the following command:

$ dpkg -l | grep chromium-

You'll need to provide a backtrace. It can be produced using gdb, with the help of debugging symbols.

Getting a backtrace

Debugging symbols come in packages that can be installed just like any other software package in Ubuntu. The debugging symbols package for Chromium is called chromium-browser-dbg. Once you've installed it, open a terminal and proceed as follows:

$ chromium-browser --debug 2>&1 | tee gdb-chromium.txt
(gdb) handle SIG33 pass nostop noprint
(gdb) set pagination 0
(gdb) run <arguments, if any>

Do what you need to do to trigger the crash, then:

(gdb) backtrace
(gdb) thread apply all backtrace
(gdb) quit

If the backtrace shows lots of lines with question marks (such as "#5 0x083949e0 in ?? ()"), you're likely to need additional debugging symbols packages. To find out which libraries Chromium is loading, try:

$ ldd /usr/lib/chromium-browser/chromium-browser

Then look for corresponding -dbg or -dbgsym packages in the repositories.

Debugging child processes

Since Chromium normally spawns several processes (such as the sandbox and renderers), the backtrace from the browser process may not be useful (unless it is the main process that crashes). For catching backtraces from Chromium's child processes, you should run Chromium with --single-process:

$ chromium-browser --debug --single-process 2>&1 | tee gdb-chromium.txt

Then proceed as above with gdb.

Once you feel your backtrace file (gdb-chromium.txt) is sufficient, attach it to your bug report.


CategoryDebugging

Chromium/Debugging (last edited 2012-07-11 10:33:46 by mitya57)