Tuesday, July 24, 2007

automated leak testing - followup

I have filed a bug (389361 - reproducible leak accessing page www.1ting.com) as a result of my leak testing. There are actually 6 URLs in that bug, but I cannot differentiate the leaks, so I have reported them together. I will have to figure out the leaks-gauge output so that I can make sense of this and report better bugs.

The leaks tool available on the Mac allows one to set an environment variable, MallocStackLogging, that makes the leaks output much more verbose. It will potentially tell you a lot about the objects being leaked. Unfortunately, this mostly works for Objective-C objects. C++ seems to be pretty good at obfuscating itself, or Apple has not done the work to help here, or both. It's a shame.

Well, the long and short of it is that leaks-gauge output does not make very much sense to me yet. :-(

I was not being very creative in how I got URLs. Someone pointed me to the alexa 500 and I hit pay dirt. Here are the sites I filed the bug against:

* http://www.1ting.com
* http://www.chinaren.com/
* http://www.cmfu.com/
* http://www.hurriyet.com.tr/
* http://www.yahoo.com/
* http://www.zaycev.net/

By the way, I am trying to get my add-on up onto AMO. This extension does nothing but quit Firefox at any page load. This is useful when launching Firefox from a script. The extension is available at my site and in the AMO sand box (login required, or may not be reachable). If anyone wants to review, after reading the docs, please do. I am not sure what the trigger is for getting it accepted on AMO. We will see.

I find it interesting that these leaks are sometimes not reproducible. There were a couple of dozen URLs in the list which generated leaks, but only once. As I re-tested URLs, sometimes they would leak every other time (like www.yahoo.com) and sometimes every third access (like www.1ting.com) and sometimes it was just more random than that. I did not list a URL if I could not get it to leak again. I am re-launching the browser each time, though, so I thought the testing would be more reproducible. It is more reproducible, but it is still surprising to me how many one-time leaks there were. There are some questions I am going to investigate.

* Does it matter if I randomize the list of URLs I am checking?
* If I automatically retry leaking URLs a certain number of times, how many times should I check?
* What files in the app bundle or in the profile directory change with an instance launch and shutdown? Or,
* What state being held between app launches?

We'll see.

1 comment:

Pike said...

Mind changing that link to your add-on away from the developer page? No one but you can actually get there, I guess. https://addons.mozilla.org/en-US/firefox/addon/5371 is a much better link.