Archive for December, 2007

Crashtests

Thursday, December 27th, 2007

Crashtest is Mozilla's newest test suite. It provides a very simple way to make sure a page doesn't cause Gecko to crash (or hang or assert or leak). Since I report a lot of crash and assertion and leak bugs, I've been looking forward to being able to use this test suite. (For some bugs, I had been using "== about:blank" and "!= about:blank" reftests, but most of my bugs weren't getting tests checked in at all.)

I spent most of last week making crashtests for old bugs I had reported and checking them in.

So far, these crashtests have found bug 409150, a crash on Windows that happens on Tinderbox but not dveditz's computer, and bug 408746, a crash on Linux that happens on sayrer's computer but not on Tinderbox. They also found a problem in a patch before it was checked in.

The value of crashtests (and reftests) goes beyond keeping regressions out of nightlies. The test suites can be run under Valgrind's Memcheck, potentially finding subtle memory safety bugs that don't normally show up as crashes. The pages can even be used outside of the normal test framework, for example for finding inconsistent-rendering bugs.

Fixing leaks

Thursday, December 27th, 2007

Lately, I've been running debug builds of Firefox with trace-refcnt summaries enabled and reporting any leaks I can reproduce. Frequently, someone else quickly attaches a patch, but in the case of bug 401393, nobody else could reproduce the leak I was seeing. For me, simply loading a page with Flash and scrolling down could leak several objects.

Boris helped me use more detailed trace-refcnt logging options to figure out what caused the leak, and then Jonas assigned the bug to me:

Jesse, here's your first blocker :)

Let me know if you need help and I'll do my best.

I was able to fix the leak, although I still don't understand much of the code for the class I modified. Boris and I also figured out why not everyone could reproduce the leak: it only happened because I was using Greasemonkey, which implements nsIContentPolicy using JavaScript. (Adblock Plus does the same, and it is apparently the most popular Firefox extension, so I'm glad this leak is fixed!)

Knowing how to debug leaks with trace-refcount logging turned out to be useful: I was able to fix a few editor leaks and debug another.

Mozilla 2 thread

Wednesday, December 19th, 2007

There's an interesting thread on mozilla.dev.planning about the scope and schedule of Mozilla 2.