blob: 1310a454e69cbd6ecc9f2f7808baca01513eaace [file] [log] [blame] [view]
andybonse6a8f2bd2015-08-31 22:46:011# Tips for debugging on Linux
andybons3322f762015-08-24 21:37:092
andybonsad92aa32015-08-31 02:27:443This page is for Chromium-specific debugging tips; learning how to run gdb is
4out of scope.
andybons3322f762015-08-24 21:37:095
andybonsad92aa32015-08-31 02:27:446[TOC]
andybons3322f762015-08-24 21:37:097
8## Symbolized stack trace
9
andybonsad92aa32015-08-31 02:27:4410The sandbox can interfere with the internal symbolizer. Use `--no-sandbox` (but
11keep this temporary) or an external symbolizer (see
12`tools/valgrind/asan/asan_symbolize.py`).
andybons3322f762015-08-24 21:37:0913
andybonsad92aa32015-08-31 02:27:4414Generally, do not use `--no-sandbox` on waterfall bots, sandbox testing is
15needed. Talk to security@chromium.org.
andybons3322f762015-08-24 21:37:0916
17## GDB
andybonsad92aa32015-08-31 02:27:4418
nodira6074d4c2015-09-01 04:26:4519*** promo
20GDB-7.7 is required in order to debug Chrome on Linux.
21***
andybons3322f762015-08-24 21:37:0922
23Any prior version will fail to resolve symbols or segfault.
24
25### Basic browser process debugging
26
andybonsad92aa32015-08-31 02:27:4427 gdb -tui -ex=r --args out/Debug/chrome --disable-seccomp-sandbox \
28 http://google.com
andybons3322f762015-08-24 21:37:0929
30### Allowing attaching to foreign processes
andybonsad92aa32015-08-31 02:27:4431
32On distributions that use the
33[Yama LSM](https://www.kernel.org/doc/Documentation/security/Yama.txt) (that
34includes Ubuntu and Chrome OS), process A can attach to process B only if A is
35an ancestor of B.
andybons3322f762015-08-24 21:37:0936
37You will probably want to disable this feature by using
andybonsad92aa32015-08-31 02:27:4438
39 echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
andybons3322f762015-08-24 21:37:0940
41If you don't you'll get an error message such as "Could not attach to process".
42
andybonsad92aa32015-08-31 02:27:4443Note that you'll also probably want to use `--no-sandbox`, as explained below.
andybons3322f762015-08-24 21:37:0944
45### Multiprocess Tricks
andybonsad92aa32015-08-31 02:27:4446
andybons3322f762015-08-24 21:37:0947#### Getting renderer subprocesses into gdb
andybonsad92aa32015-08-31 02:27:4448
49Since Chromium itself spawns the renderers, it can be tricky to grab a
50particular with gdb. This command does the trick:
51
andybons3322f762015-08-24 21:37:0952```
53chrome --no-sandbox --renderer-cmd-prefix='xterm -title renderer -e gdb --args'
54```
andybonsad92aa32015-08-31 02:27:4455
56The `--no-sandbox` flag is needed because otherwise the seccomp sandbox will
57kill the renderer process on startup, or the setuid sandbox will prevent xterm's
58execution. The "xterm" is necessary or gdb will run in the current terminal,
59which can get particularly confusing since it's running in the background, and
60if you're also running the main process in gdb, won't work at all (the two
61instances will fight over the terminal). To auto-start the renderers in the
62debugger, send the "run" command to the debugger:
63
nodira6074d4c2015-09-01 04:26:4564 chrome --no-sandbox --renderer-cmd-prefix='xterm -title renderer -e gdb \
65 -ex run --args
andybonsad92aa32015-08-31 02:27:4466
andybons3322f762015-08-24 21:37:0967If you're using Emacs and `M-x gdb`, you can do
andybons3322f762015-08-24 21:37:0968
andybonsad92aa32015-08-31 02:27:4469 chrome "--renderer-cmd-prefix=gdb --args"
andybons3322f762015-08-24 21:37:0970
nodira6074d4c2015-09-01 04:26:4571*** note
andybonsad92aa32015-08-31 02:27:4472Note: using the `--renderer-cmd-prefix` option bypasses the zygote launcher, so
73the renderers won't be sandboxed. It is generally not an issue, except when you
74are trying to debug interactions with the sandbox. If that's what you are doing,
75you will need to attach your debugger to a running renderer process (see below).
nodira6074d4c2015-09-01 04:26:4576***
andybons3322f762015-08-24 21:37:0977
andybonsad92aa32015-08-31 02:27:4478You may also want to pass `--disable-hang-monitor` to suppress the hang monitor,
79which is rather annoying.
80
81You can also use `--renderer-startup-dialog` and attach to the process in order
82to debug the renderer code. Go to
xiaoyin.l1003c0b2016-12-06 02:51:1783https://www.chromium.org/blink/getting-started-with-blink-debugging for more
andybonsad92aa32015-08-31 02:27:4484information on how this can be done.
andybons3322f762015-08-24 21:37:0985
86#### Choosing which renderers to debug
andybons3322f762015-08-24 21:37:0987
andybonsad92aa32015-08-31 02:27:4488If you are starting multiple renderers then the above means that multiple gdb's
89start and fight over the console. Instead, you can set the prefix to point to
90this shell script:
91
92```sh
andybons3322f762015-08-24 21:37:0993#!/bin/sh
94
95echo "**** Child $$ starting: y to debug"
96read input
97if [ "$input" = "y" ] ; then
98 gdb --args $*
99else
100 $*
101fi
102```
103
104#### Selective breakpoints
andybonsad92aa32015-08-31 02:27:44105
106When debugging both the browser and renderer process, you might want to have
107separate set of breakpoints to hit. You can use gdb's command files to
108accomplish this by putting breakpoints in separate files and instructing gdb to
109load them.
andybons3322f762015-08-24 21:37:09110
111```
andybonsad92aa32015-08-31 02:27:44112gdb -x ~/debug/browser --args chrome --no-sandbox --disable-hang-monitor \
113 --renderer-cmd-prefix='xterm -title renderer -e gdb -x ~/debug/renderer \
114 --args '
andybons3322f762015-08-24 21:37:09115```
116
andybonsad92aa32015-08-31 02:27:44117Also, instead of running gdb, you can use the script above, which let's you
118select which renderer process to debug. Note: you might need to use the full
119path to the script and avoid `$HOME` or `~/.`
andybons3322f762015-08-24 21:37:09120
121#### Connecting to a running renderer
122
andybonsad92aa32015-08-31 02:27:44123Usually `ps aux | grep chrome` will not give very helpful output. Try
124`pstree -p | grep chrome` to get something like
andybons3322f762015-08-24 21:37:09125
126```
127 | |-bash(21969)---chrome(672)-+-chrome(694)
128 | | |-chrome(695)---chrome(696)-+-{chrome}(697)
129 | | | \-{chrome}(709)
130 | | |-{chrome}(675)
131 | | |-{chrome}(678)
132 | | |-{chrome}(679)
133 | | |-{chrome}(680)
134 | | |-{chrome}(681)
135 | | |-{chrome}(682)
136 | | |-{chrome}(684)
137 | | |-{chrome}(685)
138 | | |-{chrome}(705)
139 | | \-{chrome}(717)
140```
141
andybonsad92aa32015-08-31 02:27:44142Most of those are threads. In this case the browser process would be 672 and the
143(sole) renderer process is 696. You can use `gdb -p 696` to attach.
144Alternatively, you might find out the process ID from Chrome's built-in Task
145Manager (under the Tools menu). Right-click on the Task Manager, and enable
146"Process ID" in the list of columns.
andybons3322f762015-08-24 21:37:09147
andybonsad92aa32015-08-31 02:27:44148Note: by default, sandboxed processes can't be attached by a debugger. To be
149able to do so, you will need to pass the `--allow-sandbox-debugging` option.
andybons3322f762015-08-24 21:37:09150
andybonsad92aa32015-08-31 02:27:44151If the problem only occurs with the seccomp sandbox enabled (and the previous
152tricks don't help), you could try enabling core-dumps (see the **Core files**
153section). That would allow you to get a backtrace and see some local variables,
154though you won't be able to step through the running program.
andybons3322f762015-08-24 21:37:09155
andybonsad92aa32015-08-31 02:27:44156Note: If you're interested in debugging LinuxSandboxIPC process, you can attach
157to 694 in the above diagram. The LinuxSandboxIPC process has the same command
158line flag as the browser process so that it's easy to identify it if you run
159`pstree -pa`.
andybons3322f762015-08-24 21:37:09160
161#### Getting GPU subprocesses into gdb
andybons3322f762015-08-24 21:37:09162
andybonsad92aa32015-08-31 02:27:44163Use `--gpu-launcher` flag instead of `--renderer-cmd-prefix` in the instructions
164for renderer above.
165
166#### Getting `browser_tests` launched browsers into gdb
167
168Use environment variable `BROWSER_WRAPPER` instead of `--renderer-cmd-prefix`
169switch in the instructions above.
andybons3322f762015-08-24 21:37:09170
171Example:
andybonsad92aa32015-08-31 02:27:44172
173```shell
174BROWSER_WRAPPER='xterm -title renderer -e gdb --eval-command=run \
175 --eval-command=quit --args' out/Debug/browser_tests --gtest_filter=Print
176```
andybons3322f762015-08-24 21:37:09177
178#### Plugin Processes
andybons3322f762015-08-24 21:37:09179
andybonsad92aa32015-08-31 02:27:44180Same strategies as renderers above, but the flag is called `--plugin-launcher`:
181
182 chrome --plugin-launcher='xterm -e gdb --args'
183
nodira6074d4c2015-09-01 04:26:45184*** note
185Note: For now, this does not currently apply to PPAPI plugins because they
186currently run in the renderer process.
187***
andybons3322f762015-08-24 21:37:09188
189#### Single-Process mode
andybons3322f762015-08-24 21:37:09190
andybonsad92aa32015-08-31 02:27:44191Depending on whether it's relevant to the problem, it's often easier to just run
192in "single process" mode where the renderer threads are in-process. Then you can
193just run gdb on the main process.
andybons3322f762015-08-24 21:37:09194
andybonsad92aa32015-08-31 02:27:44195 gdb --args chrome --single-process
196
197Currently, the `--disable-gpu` flag is also required, as there are known crashes
198that occur under TextureImageTransportSurface without it. The crash described in
xiaoyin.l1003c0b2016-12-06 02:51:17199https://crbug.com/361689 can also sometimes occur, but that crash can be
andybonsad92aa32015-08-31 02:27:44200continued from without harm.
201
202Note that for technical reasons plugins cannot be in-process, so
203`--single-process` only puts the renderers in the browser process. The flag is
204still useful for debugging plugins (since it's only two processes instead of
205three) but you'll still need to use `--plugin-launcher` or another approach.
andybons3322f762015-08-24 21:37:09206
207### Printing Chromium types
andybons3322f762015-08-24 21:37:09208
Tom Andersonf06ac382019-04-10 03:49:38209gdb 7 lets us use Python to write pretty-printers for Chromium types. See
210[gdbinit](https://chromium.googlesource.com/chromium/src/+/master/docs/gdbinit.md)
211to enable pretty-printing of Chromium types. This will import Blink
212pretty-printers as well.
Kenichi Ishibashie17b8d9f2018-04-26 03:32:46213
andybonsad92aa32015-08-31 02:27:44214Pretty printers for std types shouldn't be necessary in gdb 7, but they're
215provided here in case you're using an older gdb. Put the following into
216`~/.gdbinit`:
217
andybons3322f762015-08-24 21:37:09218```
219# Print a C++ string.
220define ps
221 print $arg0.c_str()
222end
223
224# Print a C++ wstring or wchar_t*.
225define pws
226 printf "\""
227 set $c = (wchar_t*)$arg0
228 while ( *$c )
229 if ( *$c > 0x7f )
230 printf "[%x]", *$c
231 else
232 printf "%c", *$c
233 end
234 set $c++
235 end
236 printf "\"\n"
237end
238```
239
240[More STL GDB macros](http://www.yolinux.com/TUTORIALS/src/dbinit_stl_views-1.01.txt)
241
Christian Biesinger3332bb3a2019-08-13 05:45:23242### JsDbg -- visualize data structures in the browser
243
244JsDbg is a debugger plugin to display various Chrome data structures in a
245browser window, such as the accessibility tree, layout object tree, DOM tree,
246and others.
247[Installation instructions are here](https://github.com/MicrosoftEdge/JsDbg),
248and see [here](https://github.com/MicrosoftEdge/JsDbg/blob/master/docs/FEATURES.md)
249for screenshots and an introduction.
250
251For Googlers, please see [go/jsdbg](https://goto.google.com/jsdbg) for
252installation instructions.
253
254### Time travel debugging with rr
255
256You can use [rr](https://rr-project.org) for time travel debugging, so you
257can also step or execute backwards. This works by first recording a trace
258and then debugging based on that. I recommend installing it by compiling
259[from source](https://github.com/mozilla/rr/wiki/Building-And-Installing).
260
261Once installed, you can use it like this:
262```
263rr record out/Debug/content_shell --single-process --no-sandbox --disable-hang-monitor --single-process --disable-seccomp-sandbox --disable-setuid-sandbox
264rr replay
265(gdb) c
266(gdb) break blink::NGBlockNode::Layout
267(gdb) rc # reverse-continue to the last Layout call
268(gdb) jsdbg # run JsDbg as described above to find the interesting object
269(gdb) watch -l box_->frame_rect_.size_.width_.value_
270(gdb) rc # reverse-continue to the last time the width was changed
271(gdb) rn # reverse-next to the previous line
272(gdb) reverse-fin # run to where this function was called from
273```
274
andybons3322f762015-08-24 21:37:09275### Graphical Debugging Aid for Chromium Views
276
277The following link describes a tool that can be used on Linux, Windows and Mac under GDB.
278
andybonsad92aa32015-08-31 02:27:44279[graphical_debugging_aid_chromium_views](graphical_debugging_aid_chromium_views.md)
andybons3322f762015-08-24 21:37:09280
281### Faster startup
282
andybonsad92aa32015-08-31 02:27:44283Use the `gdb-add-index` script (e.g.
284`build/gdb-add-index out/Debug/browser_tests`)
andybons3322f762015-08-24 21:37:09285
andybonsad92aa32015-08-31 02:27:44286Only makes sense if you run the binary multiple times or maybe if you use the
nodira6074d4c2015-09-01 04:26:45287component build since most `.so` files won't require reindexing on a rebuild.
andybons3322f762015-08-24 21:37:09288
andybonsad92aa32015-08-31 02:27:44289See
290https://groups.google.com/a/chromium.org/forum/#!searchin/chromium-dev/gdb-add-index/chromium-dev/ELRuj1BDCL4/5Ki4LGx41CcJ
291for more info.
andybons3322f762015-08-24 21:37:09292
andybons8c02a1f2015-09-04 17:02:32293You can improve GDB load time significantly at the cost of link time by
brettw20d800c2016-04-12 00:10:49294splitting symbols from the object files. In GN, set `use_debug_fission=false` in
295your "gn args".
andybons3322f762015-08-24 21:37:09296
Tom Anderson71df8872018-06-21 19:02:25297### Source level debug with -fdebug-compilation-dir
Takuto Ikuta3ae0e03b2018-05-18 06:10:40298
Nico Weber8940a782018-10-22 23:28:28299When `strip_absolute_paths_from_debug_symbols` is enabled (which is the
Tom Andersonf06ac382019-04-10 03:49:38300default), gdb may not be able to find debug files, making source-level debugging
301impossible. See
302[gdbinit](https://chromium.googlesource.com/chromium/src/+/master/docs/gdbinit.md)
303to configure gdb to be able to find debug files.
Takuto Ikuta3ae0e03b2018-05-18 06:10:40304
andybons3322f762015-08-24 21:37:09305## Core files
andybons3322f762015-08-24 21:37:09306
andybonsad92aa32015-08-31 02:27:44307`ulimit -c unlimited` should cause all Chrome processes (run from that shell) to
308dump cores, with the possible exception of some sandboxed processes.
andybons3322f762015-08-24 21:37:09309
andybonsad92aa32015-08-31 02:27:44310Some sandboxed subprocesses might not dump cores unless you pass the
311`--allow-sandbox-debugging` flag.
312
313If the problem is a freeze rather than a crash, you may be able to trigger a
314core-dump by sending SIGABRT to the relevant process:
315
316 kill -6 [process id]
andybons3322f762015-08-24 21:37:09317
318## Breakpad minidump files
319
Tom Andersonabdbd6a2020-01-09 16:59:27320See [minidump_to_core.md](minidump_to_core.md)
andybons3322f762015-08-24 21:37:09321
322## Running Tests
andybonsad92aa32015-08-31 02:27:44323
324Many of our tests bring up windows on screen. This can be annoying (they steal
325your focus) and hard to debug (they receive extra events as you mouse over them).
326Instead, use `Xvfb` or `Xephyr` to run a nested X session to debug them, as
Marijn Kruisselbrinkeebac46b2019-05-28 19:33:16327outlined on [testing/web_tests_linux.md](testing/web_tests_linux.md).
andybons3322f762015-08-24 21:37:09328
329### Browser tests
andybonsad92aa32015-08-31 02:27:44330
331By default the `browser_tests` forks a new browser for each test. To debug the
332browser side of a single test, use a command like
333
andybons3322f762015-08-24 21:37:09334```
Thomas Lukaszewicz2c5fb6142019-10-14 19:20:05335gdb --args out/Debug/browser_tests --single-process-tests --gtest_filter=MyTestName
andybons3322f762015-08-24 21:37:09336```
andybonsad92aa32015-08-31 02:27:44337
Thomas Lukaszewicz2c5fb6142019-10-14 19:20:05338**note the use of `single-process-tests`** -- this makes the test harness and
andybonsad92aa32015-08-31 02:27:44339browser process share the outermost process.
andybons3322f762015-08-24 21:37:09340
341
342To debug a renderer process in this case, use the tips above about renderers.
343
Kent Tamura59ffb022018-11-27 05:30:56344### Web tests
andybonsad92aa32015-08-31 02:27:44345
Marijn Kruisselbrinkeebac46b2019-05-28 19:33:16346See [testing/web_tests_linux.md](testing/web_tests_linux.md) for some tips. In particular,
Kent Tamura59ffb022018-11-27 05:30:56347note that it's possible to debug a web test via `ssh`ing to a Linux box; you
andybonsad92aa32015-08-31 02:27:44348don't need anything on screen if you use `Xvfb`.
andybons3322f762015-08-24 21:37:09349
350### UI tests
andybons3322f762015-08-24 21:37:09351
andybonsad92aa32015-08-31 02:27:44352UI tests are run in forked browsers. Unlike browser tests, you cannot do any
353single process tricks here to debug the browser. See below about
354`BROWSER_WRAPPER`.
355
356To pass flags to the browser, use a command line like
357`--extra-chrome-flags="--foo --bar"`.
andybons3322f762015-08-24 21:37:09358
359### Timeouts
andybonsad92aa32015-08-31 02:27:44360
361UI tests have a confusing array of timeouts in place. (Pawel is working on
362reducing the number of timeouts.) To disable them while you debug, set the
363timeout flags to a large value:
364
365* `--test-timeout=100000000`
366* `--ui-test-action-timeout=100000000`
367* `--ui-test-terminate-timeout=100000000`
andybons3322f762015-08-24 21:37:09368
369### To replicate Window Manager setup on the bots
andybonsad92aa32015-08-31 02:27:44370
371Chromium try bots and main waterfall's bots run tests under Xvfb&openbox
372combination. Xvfb is an X11 server that redirects the graphical output to the
373memory, and openbox is a simple window manager that is running on top of Xvfb.
374The behavior of openbox is markedly different when it comes to focus management
375and other window tasks, so test that runs fine locally may fail or be flaky on
376try bots. To run the tests on a local machine as on a bot, follow these steps:
andybons3322f762015-08-24 21:37:09377
378Make sure you have openbox:
andybonsad92aa32015-08-31 02:27:44379
380 apt-get install openbox
381
andybons3322f762015-08-24 21:37:09382Start Xvfb and openbox on a particular display:
andybonsad92aa32015-08-31 02:27:44383
384 Xvfb :6.0 -screen 0 1280x1024x24 & DISPLAY=:6.0 openbox &
385
andybons3322f762015-08-24 21:37:09386Run your tests with graphics output redirected to that display:
andybonsad92aa32015-08-31 02:27:44387
388 DISPLAY=:6.0 out/Debug/browser_tests --gtest_filter="MyBrowserTest.MyActivateWindowTest"
389
andybons3322f762015-08-24 21:37:09390You can look at a snapshot of the output by:
andybonsad92aa32015-08-31 02:27:44391
392 xwd -display :6.0 -root | xwud
andybons3322f762015-08-24 21:37:09393
394Alternatively, you can use testing/xvfb.py to set up your environment for you:
andybons3322f762015-08-24 21:37:09395
thomasanderson3d074282016-12-06 18:21:12396 testing/xvfb.py out/Debug/browser_tests \
andybonsad92aa32015-08-31 02:27:44397 --gtest_filter="MyBrowserTest.MyActivateWindowTest"
andybons3322f762015-08-24 21:37:09398
nodira6074d4c2015-09-01 04:26:45399### BROWSER_WRAPPER
andybonsad92aa32015-08-31 02:27:44400
401You can also get the browser under a debugger by setting the `BROWSER_WRAPPER`
402environment variable. (You can use this for `browser_tests` too, but see above
403for discussion of a simpler way.)
404
405 BROWSER_WRAPPER='xterm -e gdb --args' out/Debug/browser_tests
andybons3322f762015-08-24 21:37:09406
qyearsleyc0dc6f42016-12-02 22:13:39407### Replicating try bot Slowness
andybons3322f762015-08-24 21:37:09408
qyearsleyc0dc6f42016-12-02 22:13:39409Try bots are pretty stressed, and can sometimes expose timing issues you can't
andybonsad92aa32015-08-31 02:27:44410normally reproduce locally.
andybons3322f762015-08-24 21:37:09411
andybonsad92aa32015-08-31 02:27:44412You can simulate this by shutting down all but one of the CPUs
413(http://www.cyberciti.biz/faq/debian-rhel-centos-redhat-suse-hotplug-cpu/) and
414running a CPU loading tool (e.g., http://www.devin.com/lookbusy/). Now run your
qyearsleyc0dc6f42016-12-02 22:13:39415test. It will run slowly, but any flakiness found by the try bot should replicate
andybonsad92aa32015-08-31 02:27:44416locally now - and often nearly 100% of the time.
andybons3322f762015-08-24 21:37:09417
418## Logging
andybons3322f762015-08-24 21:37:09419
andybonsad92aa32015-08-31 02:27:44420### Seeing all LOG(foo) messages
421
422Default log level hides `LOG(INFO)`. Run with `--log-level=0` and
423`--enable-logging=stderr` flags.
424
qyearsleyc0dc6f42016-12-02 22:13:39425Newer versions of Chromium with VLOG may need --v=1 too. For more VLOG tips, see
xiaoyin.l1003c0b2016-12-06 02:51:17426[the chromium-dev thread](https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/dcd0cd7752b35de6?pli=1).
andybons3322f762015-08-24 21:37:09427
428### Seeing IPC debug messages
andybons3322f762015-08-24 21:37:09429
andybonsad92aa32015-08-31 02:27:44430Run with `CHROME_IPC_LOGGING=1` eg.
431
432 CHROME_IPC_LOGGING=1 out/Debug/chrome
433
434or within gdb:
435
436 set environment CHROME_IPC_LOGGING 1
437
438If some messages show as unknown, check if the list of IPC message headers in
nodira6074d4c2015-09-01 04:26:45439[chrome/common/logging_chrome.cc](/chrome/common/logging_chrome.cc) is
thakis3e861de2016-06-14 14:24:01440up to date. In case this file reference goes out of date, try looking for usage
nodira6074d4c2015-09-01 04:26:45441of macros like `IPC_MESSAGE_LOG_ENABLED` or `IPC_MESSAGE_MACROS_LOG_ENABLED`.
andybons3322f762015-08-24 21:37:09442
andybons3322f762015-08-24 21:37:09443## Profiling
andybonsad92aa32015-08-31 02:27:44444
445See
446https://sites.google.com/a/chromium.org/dev/developers/profiling-chromium-and-webkit
Tom Anderson93e49e492019-12-23 19:55:37447and [Linux Profiling](profiling.md).
andybons3322f762015-08-24 21:37:09448
449## i18n
andybons3322f762015-08-24 21:37:09450
andybonsad92aa32015-08-31 02:27:44451We obey your system locale. Try something like:
andybons3322f762015-08-24 21:37:09452
andybonsad92aa32015-08-31 02:27:44453 LANG=ja_JP.UTF-8 out/Debug/chrome
454
455If this doesn't work, make sure that the `LANGUAGE`, `LC_ALL` and `LC_MESSAGE`
456environment variables aren't set -- they have higher priority than LANG in the
457order listed. Alternatively, just do this:
458
459 LANGUAGE=fr out/Debug/chrome
460
461Note that because we use GTK, some locale data comes from the system -- for
462example, file save boxes and whether the current language is considered RTL.
463Without all the language data available, Chrome will use a mixture of your
464system language and the language you run Chrome in.
andybons3322f762015-08-24 21:37:09465
466Here's how to install the Arabic (ar) and Hebrew (he) language packs:
andybonsad92aa32015-08-31 02:27:44467
468 sudo apt-get install language-pack-ar language-pack-he \
469 language-pack-gnome-ar language-pack-gnome-he
470
andybons3322f762015-08-24 21:37:09471Note that the `--lang` flag does **not** work properly for this.
472
Tom Anderson287339e2018-08-22 21:52:02473On non-Debian systems, you need the `gtk30.mo` files. (Please update these docs
andybonsad92aa32015-08-31 02:27:44474with the appropriate instructions if you know what they are.)
andybons3322f762015-08-24 21:37:09475
476## Breakpad
andybonsad92aa32015-08-31 02:27:44477
Tom Anderson93e49e492019-12-23 19:55:37478See the last section of [Linux Crash Dumping](crash_dumping.md).
andybons3322f762015-08-24 21:37:09479
480## Drag and Drop
andybonsad92aa32015-08-31 02:27:44481
482If you break in a debugger during a drag, Chrome will have grabbed your mouse
483and keyboard so you won't be able to interact with the debugger! To work around
484this, run via `Xephyr`. Instructions for how to use `Xephyr` are on the
Marijn Kruisselbrinkeebac46b2019-05-28 19:33:16485[Running web tests on Linux](testing/web_tests_linux.md) page.
andybons3322f762015-08-24 21:37:09486
487## Tracking Down Bugs
488
489### Isolating Regressions
andybons3322f762015-08-24 21:37:09490
andybonsad92aa32015-08-31 02:27:44491Old builds are archived here:
xiaoyin.l1003c0b2016-12-06 02:51:17492https://build.chromium.org/buildbot/snapshots/chromium-rel-linux/
nodira6074d4c2015-09-01 04:26:45493(TODO: does not exist).
andybonsad92aa32015-08-31 02:27:44494
495`tools/bisect-builds.py` in the tree automates bisecting through the archived
496builds. Despite a computer science education, I am still amazed how quickly
497binary search will find its target.
andybons3322f762015-08-24 21:37:09498
499### Screen recording for bug reports
andybonsad92aa32015-08-31 02:27:44500
501 sudo apt-get install gtk-recordmydesktop
andybons3322f762015-08-24 21:37:09502
503## Version-specific issues
504
505### Google Chrome
andybonsad92aa32015-08-31 02:27:44506
507Google Chrome binaries don't include symbols. Googlers can read where to get
508symbols from
509[the Google-internal wiki](http://wiki/Main/ChromeOfficialBuildLinux#The_Build_Archive).
andybons3322f762015-08-24 21:37:09510
511### Ubuntu Chromium
andybonsad92aa32015-08-31 02:27:44512
513Since we don't build the Ubuntu packages (Ubuntu does) we can't get useful
514backtraces from them. Direct users to https://wiki.ubuntu.com/Chromium/Debugging
andybons3322f762015-08-24 21:37:09515
516### Fedora's Chromium
andybonsad92aa32015-08-31 02:27:44517
518Like Ubuntu, but direct users to
519https://fedoraproject.org/wiki/TomCallaway/Chromium_Debug
andybons3322f762015-08-24 21:37:09520
521### Xlib
andybonsad92aa32015-08-31 02:27:44522
andybons3322f762015-08-24 21:37:09523If you're trying to track down X errors like:
andybonsad92aa32015-08-31 02:27:44524
andybons3322f762015-08-24 21:37:09525```
526The program 'chrome' received an X Window System error.
527This probably reflects a bug in the program.
528The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
529```
andybonsad92aa32015-08-31 02:27:44530
andybons3322f762015-08-24 21:37:09531Some strategies are:
andybonsad92aa32015-08-31 02:27:44532
533* pass `--sync` on the command line to make all X calls synchronous
534* run chrome via [xtrace](http://xtrace.alioth.debian.org/)
535* turn on IPC debugging (see above section)
andybons3322f762015-08-24 21:37:09536
537### Window Managers
andybons3322f762015-08-24 21:37:09538
andybonsad92aa32015-08-31 02:27:44539To test on various window managers, you can use a nested X server like `Xephyr`.
540Instructions for how to use `Xephyr` are on the
Kent Tamura59ffb022018-11-27 05:30:56541[Running web tests on Linux](web_tests_linux.md) page.
andybonsad92aa32015-08-31 02:27:44542
543If you need to test something with hardware accelerated compositing
544(e.g., compiz), you can use `Xgl` (`sudo apt-get install xserver-xgl`). E.g.:
545
546 Xgl :1 -ac -accel glx:pbuffer -accel xv:pbuffer -screen 1024x768
547
andybons3322f762015-08-24 21:37:09548## Mozilla Tips
andybonsad92aa32015-08-31 02:27:44549
550https://developer.mozilla.org/en/Debugging_Mozilla_on_Linux_FAQ