MPL 2 Upgrade Process Complete

With the closure of the bug for Hackasaurus, we have now finished the 19-month MPL 2 upgrade project :-) All Mozilla software which used to use the tri-licence now uses the MPL 2.

Particular thanks go to Francesco “flod” Lodolo, who was the driving force behind the last big push to get the outstanding l10n repos relicensed.

(A post like this one is, of course, begging for someone to point out some files I may have missed. There are still a few tri-licensed files in the tree because they come from upstream projects that still use that licence. If you still think I’ve missed something, please file a licensing bug.)

Firefox OS Phones Available Worldwide from Friday

Firefox OS has launched in Spain, Poland, Venezuela and Colombia – but not yet here in the UK. However, from Friday ZTE (one of the manufacturers Mozilla is working with) will be selling their “ZTE Open” Firefox OS phone unlocked from their UK and US eBay stores, and it can be purchased worldwide.

They will sell a US-frequencies model from their US store for $79.99, and a UK/EU-frequencies model from their UK store for £59.99. The phone is network unlocked, so you can use it anywhere. It ships with Firefox OS 1.0.1 and can be updated over-the-air.

So if you’ve been waiting to get your hands on one, wait no longer :-)

Copying Permissively-Licensed Code Into MPL 2 Files

Mozilla has always used some permissively-licensed (MIT/BSD) code, and more recently started using and now creating (most prominently in Gaia) Apache 2-licensed code. This has made some questions about what to do when copying code between files of different licenses more pressing.

To help, the licensing team have produced a document on what to do when you want to copy permissively-licensed code into files which are under the MPL 2.

A BREACH Mitigation Idea

The BREACH attack on SSL was recently disclosed at Black Hat. It depends on an attacker being able to notice a small difference in response size between two very similar requests.

Therefore, various mitigation methods which have been proposed involve attempting to disguise the length of a response. Some have said that this is mathematically infeasible, in that there is no way of disguising it enough without destroying the compression performance to such a degree that you might as well just switch compression off. I am not qualified to assess that claim, but I did have an idea as to how to add arbitrary length to the response in a transparent way.

My suggestion to vary the length is to add some non-determinism to gzip on the server side. This has the significant advantage of being transparent both to the application being served and to the client – it requires no changes to either. This makes it much easier to deploy than mechanisms which pad the content itself, or add data which needs to be explicitly ignored on the client. A quick review of the algorithm suggests that there are several places where you could introduce non-determinism.

The gzip algorithm either reproduces a string of bytes literally or, if that string has occurred before, replaces it with a pointer-length pair to a previously-occurring string of bytes. I suggest that the way that adds most variability to the output length would be to have gzip either not shorten a string, or shorten it to less than the maximum possible shortening, on some small percentage of occasions when it would otherwise do a full compression. The question is whether one can add enough length non-determinism to make the leaky length difference hard to detect without many repetitions and statistical analysis (which would drastically slow down the attack), without destroying the compression performance.

This scheme can be used to add arbitrary amounts of additional length (up to the original size of the file) in arbitrary places and patterns, dependent on static or variable factors.

As determinism may be an expected feature of gzip in some contexts, it would probably need to be made an option (which mod_gzip and similar libraries would invoke).

As an opening (and probably terrible) proposal for a static random length increase, I suggest that for each replaced sequence in the file, gzip decides either to replace it fully with a pointer+length, or to do so for all the chars bar the last one (emitting that char as a literal). It should do this with a probability of 1/N+1 for the Nth replacement in the file. This front-loads the non-determinism, producing an exponential decay in the likelihood of the sub-optimal choice being chosen, and meaning that the deleterious effect on large files is not overly large but small files still get a significant length variation.

This method might also work as a mitigation for CRIME.

Jefferson was a Do-ocrat

In his multi-volume biography of Thomas Jefferson, Jefferson and His Time, Dumas Malone tells the story of how Jefferson handled the first meeting held to decide the organization of the future University of Virginia. The University had been Jefferson’s idea in the first place, but (as is the case everywhere, not just in open source projects) many other parties had climbed on board quickly, each with their own interests and agendas. When they gathered at that first meeting to hash things out, Jefferson made sure to show up with meticulously prepared architectural drawings, detailed budgets for construction and operation, a proposed curriculum, and the names of specific faculty he wanted to import from Europe. No one else in the room was even remotely as prepared; the group essentially had to capitulate to Jefferson’s vision, and the University was eventually founded more or less in accordance with his plans. The facts that construction went far over budget, and that many of his ideas did not, for various reasons, work out in the end, were all things Jefferson probably knew perfectly well would happen. His purpose was strategic: to show up at the meeting with something so substantive that everyone else would have to fall into the role of simply proposing modifications to it, so that the overall shape, and therefore schedule, of the project would be roughly as he wanted.

— Karl Fogel, Producing Open Source Software

Bugzilla 1,000,000 Bug Sweepstake

[Note: The closing date for entries was midday ZST on Thursday 5th September 2013, i.e. a long time ago :-).]

Some of you may have noticed that, after a long history of contests, there was no competition to predict the time of arrival of the 900,000th bug on bugzilla.mozilla.org. This was because we were preparing for the big 1M.

Now we are over 9000,00 (can that really be right?), I can reveal that the prize for the Millionth Bug Sweepstake will be the top-of-the-range Most Splendid Package from the Mozilla Gear Store, which includes a black hoodie, a drawstring tote bag, a Moleskine notebook, and a Rickshaw laptop bag, all Firefox or Mozilla-branded.

The aim of the contest is simple – you need your guess to be the closest to the actual filing date of the one millionth bug in our Bugzilla installation.

To enter, email me a plain text email at gerv@mozilla.org, ideally using this link, filling in the date and time you think the one millionth bug will be filed, along with your Bugzilla ID or email address. As the link suggests, your entry should be on the first line of your email, and formatted as follows:

2010-09-08 06:54:32 bugzilla-id@example.com

All times are in ZST (‘Zilla Standard Time, a.k.a. Pacific Time, as displayed in Bugzilla timestamps unless you’ve changed a pref). If you prefer to be contacted on a different address, add that as well, in brackets on the end of the same line. We have ample graphs and charts (requires editbugs) to help you with your assessment. But if you can’t be bothered to do any research and analysis, just guess optimistically and hope!

This is a Mozilla community event. To keep it that way, entrants must have either a Bugzilla account on bugzilla.mozilla.org created before the end of July 2013, and which has done something useful in the past six months, or a Mozillians account vouched for before the same date. Anyone who meets those criteria can (and is encouraged to) enter, including Mozilla employees. Once the bug is filed, I’ll check those entries who are closest, and keep discarding them until I find one which meets these criteria. Therefore, there’s no point posting this to Slashdot or any other non-Mozilla-focussed news source. But please do post it in Mozilla news sources!

Badly-formatted entries may be discarded. The judge’s decision is final, and any funny business regarding the filing of bugs on or around the one million mark will be frowned upon. The closing date for entries is midday ZST on Thursday 5th September 2013.

Newsgroup/Mailing List Sync Fixed

Dave Miller writes:

We’ve had an ongoing issue with the news-to-mail gateway on some of our newsgroups, and today we figured out what was going on and fixed it. Of our 214 gatewayed newsgroups, 74 of them were failing to sync messages from news.mozilla.org out to the mailing lists. On the other hand (as far as we know), messages from the mailing lists *were* making it to the newsgroups. As best as we can tell, this started happening around May 4th or so, due to a corrupted newsgroup at Giganews that caused the gateway script to crash before completing syncing all of the newsgroups. When the problem was resolved, the newsgroup messages which hadn’t gone to the mailing lists yet all went out at once, so if you subscribe to any of those lists, you may have had a sudden onslaught of email this afternoon. We apologize if that caused anyone any problems.

Full details of the issue, including a list of the affected mailing lists, can be found at https://bugzilla.mozilla.org/show_bug.cgi?id=891906

Feel free to forward this message anywhere appropriate.

TEMPORAl Distortion

The UK’s General Communications Headquarters (GCHQ) has a system called TEMPORA. TEMPORA is the signals intelligence community’s first “full-take” Internet buffer that doesn’t care about content type and pays only marginal attention to the Human Rights Act. It snarfs everything, in a rolling buffer to allow retroactive investigation without missing a single bit. Right now the buffer can hold three days of traffic, but that’s being improved. Three days may not sound like much, but remember that that’s not metadata. “Full-take” means it doesn’t miss anything, and ingests the entirety of each circuit’s capacity. If you send a single ICMP packet 5 and it routes through the UK, we get it. If you download something and the CDN (Content Delivery Network) happens to serve from the UK, we get it. If your sick daughter’s medical records get processed at a London call center … well, you get the idea. … As a general rule, so long as you have any choice at all, you should never route through or peer with the UK under any circumstances. Their fibers are radioactive, and even the Queen’s selfies to the pool boy get logged.

Blimey.

Cheaper Data Centre Power

Evening out demand to match supply is a big problem in the energy industry. One way is differential pricing – charge more at peak times. Another way is energy storage, so you can supply more at peak times. One method of storage is to store the energy using compressed air. The disadvantage is that compressing the air gives off heat, and re-expanding it requires heat. Not supplying heat during re-expansion makes the storage much less efficient.

So which industry has large and fairly constant power costs it would like to reduce by buying some of that power at off-peak prices, equipment which can be placed anywhere, including where land prices are cheap, plus a lot of waste heat it doesn’t know what to do with?

Someone should come up with a gas compression power storage system for data centres.

Cost of power, ballpark: $0.06 per kWH peak (say 8am – 6pm), $0.03 off-peak
Power consumption of server: 1KW
Current cost of power per server per day: $1.02
Potential saving per server per year if all power used were priced at the off-peak price: $110

One issue is that a 5l bottle can store 500kJ of energy (0.14 kwH), so you’d need 500l per server. That’s a lot, so you may not be able to get the full saving unless you use an underground cavern rather than surface storage tanks. But if land is cheap, you could make a dent in your power bill.

Believe it or not, this post was half-written before I saw this Slashdot article.

GSoC 2013 Project List

The Google Summer of Code students got chosen 2 weeks ago, and I am pleased to list the 21 projects being done under the Mozilla banner – a new high for the Mozilla project. The name of each student is linked to the location where they will be posting weekly updates on their progress, if you want to follow along with a project you are interested in. I’m sure they would appreciate any help or advice you have :-) Please make them feel welcome!

Project Student Mentor
Improving Text Selection and Rotation in PDF.js Srishti Srivastava Bill Walker
Designing Hacktivities (Meemoo) Matthias Brown Forrest Oliphant
Dynamically Configurable Actions add-on (ZAP) Alessandro Secco Simon Bennetts
Autosuggest Search Engines (Firefox) Sankha Narayan Guria Matthew Noorenberghe
Clearer Add-on Installation (Firefox) Sachin Hosmani Jorge Villalobos
Enhanced Customization APIs (Firefox) Riadh Chtara Kris Maglione
Additional JavaScript Protocol Plug-ins – Yahoo! (Instantbird) Quentin Headen Patrick Cloke
Awesometab (Instantbird) Nihanth Subramanya Benedikt Pfeifer
Profile in the Cloud (PiCl) Client (Firefox OS) Akshay Katyal Jed Parsons
Prototype HTTP/2 Server Gábor Molnár Nick Hurley
Debug Symbol Generation (Rust) Michael Woerister Josh Matthews
Implement Branch Prediction (IonMonkey) Wei Wu Nicolas B. Pierron
Make Firefox Developer Tools Compatible With Thunderbird Philipp Kewisch Mike Conley
Security Report (Firefox) Kailas Ravsaheb Patil Mark Goodwin
CSS Generation Tools (MDN) Gabriel Ivanica Jean-Yves Perrier
Unit Tests for Mozbase Anhad Jai Singh Clint Talbert
Backend Connectors for Ensemble (Thunderbird) Jonathan Demelo Mike Conley
Localization Dashboard Berker Peksag John Karahalis
FileLinks in Instant Messages Instantbird) Atul Jangra Florian Quèze
Sample Apps for Firefox Marketplace Developer Hub (Firefox OS) Andre Alves Garzia Marcos Caceres
about:memory for Real People (Firefox) Abhishek Choudhary Felipe Gomes

The World Before Rapid Release

Stabilization is the process of getting a release branch into a releasable state; that is, of deciding which changes will be in the release, which will not, and shaping the branch content accordingly.

There’s a lot of potential grief contained in that word, “deciding”. The last-minute feature rush is a familiar phenomenon in collaborative software projects: as soon as developers see that a release is about to happen, they scramble to finish their current changes, in order not to miss the boat. This, of course, is the exact opposite of what you want at release time. It would be much better for people to work on features at a comfortable pace, and not worry too much about whether their changes make it into this release or the next one. The more changes one tries to cram into a release at the last minute, the more the code is destabilized, and (usually) the more new bugs are created.

…

Thus, the process of stabilizing a release is mostly about creating mechanisms for saying “no”.

— Karl Fogel, Producing Open Source Software

Correctly Indicating Newsworthiness

In free software, there is a fairly smooth continuum between purely internal discussions and public relations statements. This is partly because the target audience is always ill-defined: given that most or all posts are publicly accessible, the project doesn’t have full control over the impression the world gets. Someone—say, a slashdot.org editor—may draw millions of readers’ attention to a post that no one ever expected to be seen outside the project. This is a fact of life that all open source projects live with, but in practice, the risk is usually small. In general, the announcements that the project most wants publicized are the ones that will be most publicized, assuming you use the right mechanisms to indicate relative newsworthiness to the outside world.

— Karl Fogel, Producing Open Source Software

3D Printing A Replacement Cot Clip

Update: Every year or so someone asks me for the files, so here is all I have as a ZIP. If it works for you, great. If not, sorry :-)

Some things made with 3D printers could possibly be made more easily using other manufacturing methods – although printing them yourself is often more fun. But sometimes you come across something which would be fairly tricky to make otherwise, unless perhaps you had high-end equipment like a laser cutter.

Cots, in the UK at least, often have a “drop side” – a side which is normally at the standard height, but can be lowered to make it easier to insert or remove a child. The side is usually held up by some kind of safety clip at each end, such that when you raise the side, the clips automatically engage, and when you want to lower it, you need to lift the side a little and pull both clips out of the way from the outside. This prevents a child pulling off an escape :-)

One of the two cots we have used to belong to my wife’s brother. It has such clips, and long ago one of them broke. He made a flat replacement out of cut perspex, but it has also recently broken. This is a problem because our changing table fits on top of the cot, and if the sides aren’t the same height, the table can’t be used and we are having to change William and John with the mat on the floor! So I thought I’d try and print one.

As you can see from the right of the photo below, the existing clip is a rather specific shape, and would have been hard to produce by many other methods without a lot of trial and error. Many parts have to be exactly the right angle and length or it won’t open, or close, or pass the cot side, or whatever. I took a scan of the existing clip (which was a bit blurry, as the clip is not flat) and traced around it in LibreCAD. I then saved that trace as a DXF file, and wrote an OpenSCAD file to make a new clip, based on a linear extrusion of the outline, plus (on later attempts) two extra blocks for a stop and a handle. Here are my efforts:

4 attempts to make the clip

The first was too small, the second marginally too big (and the blocks not aligned right), and the third, like Little Bear’s porridge, was just right :-) Well, it suffices anyway, although the hook could do with being 1mm smaller for easy passage of the side.

Here’s the clip in situ, supporting the side of the cot:

Clip supporting cot side

And this photo, beautifully modelled by my wife, shows how it fits when the side is down:

Clip being used