just another web log

29 Nov 2014:
Build your own firefox and die in a podrace
I am continuing my fight against/with Firefox previously.

So I get the source code(firefox-27.0b1.source) and there is no make just mach build
but that wants python2 and gentoo is set to Python3 eselect python list
eselect python set 1

(might be a different index for you)
Then I need to disable gstreamer pluggins
echo ac_add_options --disable-gstreamer > mozconfig
Strangely the install page https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions
Starts with "The Mozilla build system, like the rest of the Mozilla code base, is cross-platform. It uses traditional Unix-style autoconf and make tools to build the various applications (even on non-unix operating systems)."

yeah right

Started a build at 22:37 and ... ran out of disk space by the morning.

Moved everything to a second disk and started deleting the many many copies of Firefox I now have.

./mach build
failed, needed to run
./mach clobber
./mach configure

before it would start again.

took 40mins, now to take it for a leakdrive

but now there is another problem

Switching python profiles had affected podracer the program I use to get all my podcasts that I listen to during my commute.

With the wrong version of python it started downloading all podcast even up to 4 years ago.

Note to self only change python profiles when absolutely necessary and then immediately change them back.

Now I can test my new Firefox.

- leak :(
28 Nov 2014:
Pumpkin Pi slowes down as it reaches X
What I had forgotten regarding the Pumpkin Pi was that while trying to get the kids involved I connected up a monitor and ran X rather than just ssh-ing in. this had a rather unfortunate side effect that the code ran almost 3x slower meaning the LEDs were constantly flashing and there was lots of head scratching. As soon as X was stopped and dev continued in VIM on the console everything was fine as you can see in the video.
28 Nov 2014:
Time lapse shelve construct with cat
Also in videos we built a set of Ikea shelves and time lapsed it in a random way.

28 Nov 2014:
Pumpkin pi gets diffuse
This Halloween(post is bit late) the kids wanted to update me Ghostly PiMatrix work.

The obvious choice was a Pumpkin but we wanted to lose the harsh LEDs so Alex created a diffusing screen. Results were not perfect, but it was a nice idea.

21 Nov 2014:
firefox spelunking pays off a little
Even more Firefox hacking!!

Now I know that the leak occurred between the releases 26.0 and 27.0 I should be able to diff the source code and view the change that started it all, then its just a matter of finding out who committed the change and hunting them down ...
or maybe just reporting the fact so it can get fixed.

First I need to narrow it down, the the beta version that had the first bad commit, drat there are loads of 26.0 and 27.0 releases, 19 betas. More narrowing required.

Attack Plan Alpha ~ Divide and ... leak

Mozilla Firefox-26.0b5 no leak
Mozilla Firefox-27.0b5 leak

Right, so somewhere between 26.0b5 and 27.0b5, here we go again.

Mozilla Firefox-27.0b4 leak
Mozilla Firefox-27.0b2 leak
Mozilla Firefox-27.0b1 leak
Mozilla Firefox-26.0b10 no leak
Mozilla Firefox-26.0b8 no leak
Mozilla Firefox-26.0b7 untested
Mozilla Firefox-26.0b6 untested

So just a quick diff and we are done here?

Not quite there are literally hundreds of files that are different :(

Time to report this as a bug


But I am not giving up...
16 Nov 2014:
digging into firefoxes history looking for the leak
More Firefox hacking!!

I explained my situation to colleague and he asked something rather obvious. What if the problem is not the canvas code but the way its being called ...

So I created a second script with a loop instead of "setInterval" and it does NOT exhibit issue (10,000,000 iterations).

Time to go further down the rabbit hole.

http://www.jumpstation.co.uk/evil/badactor.html with a line commented out
no issue, but very slow, about 4x slower than when not commented out.

I then ran the original again just to prove to myself that the issue still existed, it did.

http://www.jumpstation.co.uk/evil/badactor.html with a line commented out
//context.arc(0, 0, 10, 0, 2 * Math.PI, true);
no issue, normal speed

http://www.jumpstation.co.uk/evil/badactor.html with a line commented out
no issue

http://www.jumpstation.co.uk/evil/badactor.html with a line commented out
Issue and no slow down

Another live 32bit distro
knoppix:: Firefox 33.1(direct binary) ~ no issue

Do older version of Firefox have the same problem?

Time to go spelunking https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/

Mozilla Firefox-4.0rc2 - "Hooray! Your Firefox is up to date", 2x slower, no leak
Mozilla Firefox-8.0 - wouldn't run
Mozilla Firefox-10.0.12esr no leak
Mozilla Firefox-17.0.11esr no leak
Mozilla Firefox-20.0 no leak
Mozilla Firefox-23.0 no leak [1]
Mozilla Firefox-24.0 no leak [1]
Mozilla Firefox-24.0esr no leak
Mozilla Firefox-24.8.0esr no leak
Mozilla Firefox-24.8.1esr no leak
Mozilla Firefox 33.1 [Repeating for safety] ~ leak detected
Mozilla Firefox-30.0 leak
Mozilla Firefox-31.0 leak
Mozilla Firefox-32.0 leak
Mozilla Firefox-33.0 leak

Attack wave II
Mozilla Firefox-25.0.1 [1] no leak
Mozilla Firefox-26.0 [1] NO LEAK
Mozilla Firefox-27.0 [1] LEAK
Mozilla Firefox-28.0 [1] leak
Mozilla Firefox-29.0.1 leak

[1] The code I am using reports the date at the beginning of the test and then after the "setInterval" has been called 400,000 times, which is runs for 25 - 30mins. For all versions the code console.log(new Date());
produced the date and time but these two versions of Firefox output object Date

12 Nov 2014:
Firefox bisected with magic equals bad doodoo
So I am still trying to track down my little memory problem with a bit of JavaScript I wrote [link to previous ramblings].

The problem can be distilled down to the X server using up memory that does not get released when the browser is closed.
Firefox not Chrome
Specific JavaScript (no other pages give any problems)
My Machine, cannot replicate on an number of VMs

To narrow down what the actual issue is I have been repeatedly pairing down the code and running it for 30mins at a time, noting memory usage.

I expected this to a fairly quick exercise, and after 32 versions I have created a small web page with only a few lines of JavaScript in it that replicates the problem reliably.

<canvas id="canvasId"></canvas>
    var context = document.getElementById('canvasId').getContext("2d");

        context.arc(0, 0, 10, 0, 2 * Math.PI, true);
    }, 1);

That is it. Removing the fill line stops the memory growth, changing just about anything else makes no difference.

The page is available here http://www.jumpstation.co.uk/evil/badactor.html and has a button to start the test, remember the memory is not allocated by Firefox but X.

I have also been trying to get another machine (VM) to exhibit the problem but no luck.

My system
Linux 3.12.21-gentoo-r1 #1 SMP Sun Jun 22 22:06:54 BST 2014 x86_64 AMD Phenom(tm) II X4 850 Processor AuthenticAMD GNU/Linux
has tried

Mozilla Firefox 24.8.0 (esr) ~ Issue
Mozilla Firefox 31.2.0 (esr) ~ Issue
Mozilla Firefox 33.1 (direct 64bit binary) ~ Issue
Mozilla Firefox 33.1 (direct 32bit binary) ~ can not run 32bit on 64bit setup xul libraries
Google Chromium ~ no issue

On the VMs
(Windows host 32bit)

slax:: Mozilla Firefox 19.0.2 ~ no issue
knoppix:: iceweasel 21.0 ~ no issue
gentoo:: Konqueror 4.13.3 ~ no issue

(Windows host 64bit)

gentoo:: Aurora(Firefox 33.0) ~ no issue
gentoo:: Firefox 33.1 (direct 64bit binary) ~ no issue

I am still on the case. As I have no idea what to do !
loading results, please wait loading animateloading animateloading animate
[More tags]
rss feed



flog archives

Disclaimer: This page is by me for me, if you are not me then please be aware of the following
I am not responsible for anything that works or does not work including files and pages made available at www.jumpstation.co.uk I am also not responsible for any information(or what you or others do with it) available at www.jumpstation.co.uk In fact I'm not responsible for anything ever, so there!

[Pay4Foss banner long]