Guaranteeing memory safety in Rust | Air Mozilla

Nicholas Matsakis of Mozilla on how Rust guarantees type soundness, memory safety, and data-race freedom while still offering control similar to C/C++:

(via Guaranteeing memory safety in Rust | Air Mozilla.)

Rust, with its funny name, reminds more of a mutt than an academic programming language. It’s that pragmatism however, that has a lot of potential to help solving well-known “real world” reliability problems in software engineering. It would definitely make a worthwhile addition to other programming languages taught in CS classes.

Mozilla has already started building Servo, a web browser engine based on Rust. While still far from usable (Disclaimer: I’ve just compiled and quickly tested the current master branch sources on Mac OS X Mavericks), it’s the right strategic move and I wonder when other browser projects, like Chromium, will start shifting to safer programming languages too.

Modern web browsers are very complex and accordingly vulnerable pieces of software and yet, with the rise of the browser as an app platform, we depend more and more on their reliability, safety and security.

Ironically, my Chrome browser irrecoverably froze while I was drafting this blog post. Although chrome doesn’t rust, some Rust would actually be a good thing for Chrome, in the long term.

Zimbra Desktop Update to 7.2.5 on Mac OS X Mavericks

When Updating Zimbra Desktop (documentation) to the latest version on Mac OS X 10.9.3 (Mavericks), the installation of the update fails. The hint how to work around this bug is quite subtle, well hidden in the Zimbra Desktop 7.2.5 release notes and even wrong and misleading, so here’s the corrected hint:

Issue # 88878: Unable to install Zimbra Desktop on OS X Mavericks machine.
Workaround: If launching Zimbra Desktop fails on an
OS X Mavericks machine, you can override your security
settings to open Zimbra Desktop:
1. In the Finder, locate the Zimbra Desktop .mpkg file. This
can likely be found in the Applications folder [wrong, see my notes below!].
2. Press the Control-key and click the file.
3. Choose Open from the pop-up menu.
4. Click Open.

Important hint: The ‘Zimbra Desktop.mpkg’ file is NOT located in the Applications folder though, but in a mounted ‘update.dmg’ image, named “Zimbra Desktop Installer” (its icon is probably shown on your desktop), and only as long as the warning dialog is being displayed (do NOT close it before running ‘Zimbra Desktop.mpkg’!). Further, auto-mounting of update.dmg only works the first time right after booting – otherwise, you either need to reboot your Mac or manually mount

/private/tmp/zdupdate/update.dmg

(e.g. by copying [optional] and double-clicking it).

Addendum: This update was obviously packaged in a rush and wasn’t tested well on Mac OS X Mavericks (I seriously hope that’s not a bad omen for the future support of ZD on Mac OS X!). For example, after updating ZD to 7.2.5 GA build 12038, I can’t compose new messages anymore as there’s the following Java error when clicking on the “New” button:

HTTP ERROR 500

Problem accessing /zimbra/public/launchNewWindow.jsp. Reason:

    PWC6033: Unable to compile class for JSP

PWC6199: Generated servlet error:
The type java.util.regex.Pattern cannot be resolved. It is indirectly referenced from required .class files

PWC6199: Generated servlet error:
The import java.util.regex.Pattern cannot be resolved

Caused by:

org.apache.jasper.JasperException: PWC6033: Unable to compile class for JSP

PWC6199: Generated servlet error:
The type java.util.regex.Pattern cannot be resolved. It is indirectly referenced from required .class files

PWC6199: Generated servlet error:
The import java.util.regex.Pattern cannot be resolved


	at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:123)
	at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:296)
	at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:376)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:437)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:608)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:360)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:814)
	at com.zimbra.webClient.servlet.JspServlet.service(JspServlet.java:64)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
	at com.zimbra.cs.servlet.SetHeaderFilter.doFilter(SetHeaderFilter.java:79)
	at com.zimbra.webClient.filters.SetHeaderFilter.doFilter(SetHeaderFilter.java:239)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:218)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:422)
	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.handler.rewrite.RewriteHandler.handle(RewriteHandler.java:230)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:585)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:971)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:415)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:429)
	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)

Composing new messages on the ZCS web interface still works fine.

Essential Mac OS X tools: NoSleep extension

macosx-nosleep-extension – The MacOS X kernel extension, preventing sleep when you close the lid. – Google Project Hosting.

Very useful, especially when watching a movie on a projector using HDMI directly, instead of using AirPlay with an Apple TV. Thanks to NoSleep, you can close your MBA’s/MBP’s lid but still stream the movie to the projector.

If I were Apple, I’d be a bit embarrassed that such a setting is not already built-in.

macvim – Vim for the Mac

When using Mac OS X, I used to use the CLI vim by the excellent Homebrew package manager.

Now I’ve just stumbled over macvim, which is kind of a “deluxe vim” for Mac OS X, including adjusted key bindings for the Mac and a GUI menu, supporting Cocoa file dialogs, among others.

It’s highly recommended if you want to have the best of both the CLI and GUI editor worlds.

Download

Using IRC on the go

Running the console IRC client weechat (not to confuse with the wechat messenger) in a screen or tmux session on a Linux (or Mac OS X) server and accessing it trough mosh is a great way to use IRC on the go, i.e. with a unsteady Internet connection.

P.S. Thanks to Devaux and rmeyer for the hints

Zimbra ZCS: OpenDKIM not running

After upgrading Debian, OpenDKIM sometimes stops running or fails to properly restart. If you don’t actively monitor your ZCS server, the only way to detect this is either through a growing mail queue of unsent messages or through a note in the ZCS server admin panel.

Usually, manually restarting either OpenDKIM itself or the whole ZCS server once “fixes” the problem:

# service zimbra restart

or

# /etc/init.d/zimbra restart

In other cases, fixing the permissions may help:

# /opt/zimbra/libexec/zmfixperms -verbose -extended

(source)

Mac OS X: Reduce/increase workspace switching delay

Does dragging windows to the adjacent workspace in Mac OS X feel sluggish? Try lowering the according delay, e.g. to 0.1 seconds. For a persistent change, enter the following in a terminal:

defaults write com.apple.dock workspaces-edge-delay -float 0.1; killall Dock

If you’d like to have a longer delay, try setting a value of 1.0 or even 2.0.