3

I've recently found, that my instance of TorBrowser crashes on "reddit.com".

I've tried to find any *.log file, like notice.log or debug.log. Nothing!

How can I DEBUG browser? To be sure what exactly was a reason of a crash.

1 Answer 1

1

There is an entire chunk of the wiki dedicated to this subject.

Have a read of Debugging the Tor Browser.

(These are all either internal to Firefox or Linux/UNIX specific...I've no idea how you'd even approach this on lesser operating systems? Windows Event Logs and windbg? Can they reach the output of the extensions or firefox's logs to stderr in any way?)

Debugging web content.

If you're having issues with a website and want to figure out why it's not loading properly, then you want to use Firefox's built-in Developer Console, this can be activated by navigating from the pull down menu at the top Tools -> Web Developer -> Toggle Tools or using the Ctrl+Shift+i key combination.

This will present you with a few tabs of various tools, the most useful are:

Inspector

This allows you to view the currently rendered content. Unlike View Source this is the content as it has been interpreted, and after it may have been altered by any javascript executing in the context of the page. You can also edit or entirely delete sections of the page through this tool.

Console

This is a javascript console, it will contain any errors encountered when processing content on the page. This is also where console.log() will be output to. You can use this to execute javascript in the context of the page.

Network

This lets you watch network requests being made by the page, this can be handy for discovering if certain resources included by the page are failing to be fetched due to some error, it also allows you to manipulate and resend requests.

Debugging Tor

If you're having connectivity issues with Tor, then you can go into the Tor Button (Onion) menu and select Tor Network Settings, then Copy Tor Log To Clipboard. You can then paste the Tor log into a text editor to review it, or into a site like https://paste.debian.net to share it with others for them to review.

You should note that if you are using private bridges their addresses may appear unredacted in these logs and you should take steps to redact them manually.

Debugging Tor Browser Addons

The Tor Browser addons (Tor Button and Tor Launcher being the main candidates) have logging functionality with configurable levels of log output. You can edit these through the about:config page on Tor Browser.

For Tor Button, the numeric value at extensions.torbutton.loglevel defines how detailed the logs are and similarly for extensions.torlauncher.loglevel for Tor Launcher.

Valid values are 1 through 5 (inclusive), with 1 being the most detailed and 5 being the lest, are defined as 1 - VERBOSE, 2 - DEBUG, 3 - INFO, 4 - NOTICE, 5 - WARNING.

To access the output, you should run run Tor Browser from the command line using the bash script (is there a windows or osx equivalent?) with either the --debug option set, which will write the output directly to the console or --log to write them to file. --log logs them to tor-browser.log by default, in the top level of the Tor Browser directory, but this can be manually set through an optional argument, for example ./tor-browser_en-US/Browser/start-tor-browser --log /home/user/mylog.log.

Debugging Firefox

If the firefox process for Tor Browser is crashing, on Linux you can run the command ulimit -c unlimited before running it manually from the command line, as outlined in the previous section. This will allow you to generate a coredump of the process if it crashes, this will preserve it's current state and allow you to use binary debugging tools like gdb to view the state of the process during it's crash. How and where a coredump is stored is defined by a sysctl value in the kernel. You can check this value by running sysctl kernel.core_pattern, editing it requires root (for obvious reasons). Traditionally it just dumps to a file called core in $PWD.

First, to make things easier you will want to retrieve the debugging symbols, since these can be bulky, Tor Browser ships without them by default to conserve space. They are available as a separate download in at the Tor Projects distribution storage website. The file is named tor-browser-linux$ARCH-debug.zip, where $ARCH is wither 32 or 64, depending on your processor architecture, they also have a corresponding signature which you should verify before use.

Once downloaded, move into the tor-browser_en-US directory and extract the contents and move the Debug/Browser folder contained inside to Browser/.debug. gdb should now be able to load the symbols required to debug Tor Browser. Now you're ready to debug, load up gdb by running, for example gdb --core Browser/core Browser/firefox. You can then use gdb to debug the crash and view human-readable function names and other debugging information.

2
  • Could you add some more description in your answer? The linked website could be gone or changed. So in general it is better to at least write a summary of the necessary steps. Thanks in advance
    – Jens Kubieziel
    Aug 4, 2016 at 13:10
  • 1
    Sure, I'll expand on this a bit to include a summary of the stuff currently on the wiki.
    – cacahuatl
    Aug 5, 2016 at 3:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .