Quick Tip: gtk_show_uri(): Operation Not Supported

Writing this down because it took me way too long to realise what I was missing.

If you’re getting the error “Operation Not Supported” when calling gtk_show_uri() or g_app_info_launch_default_for_uri(), then you’re most likely missing gvfs, which contains the extension points for all non-file:// URI schemas.

Now here’s the bit I forgot… gvfs has to be installed in the same prefix as glib. So if it works for your system GLib, but not for the one you built in some prefix, you probably forgot to build and install gvfs in that prefix.

Linux work available in Perth, Australia

My former employer, Fugro Seismic Imaging, is looking for new R&D staff for their office in Perth, Western Australia.

The team there is approximately half a dozen people, generally open-source experienced, who are primarily developing graphical front ends to geophysics applications (there’s also some other stuff, in general it’s pretty cool). You’ll almost certainly have to know C. Knowing any of C++, Python, Perl, GTK+, Qt or Fortran also a benefit. You don’t have to know any geophysics, but knowing a bit of maths and physics helps. You’ll easily pick up what you don’t know as you go along.

Pay and conditions are very good. FSI have previously provided sponsored work visas for skilled applicants looking to work in Australia.

If you’re interested, send your CV to the chief geophysicist, Kelly Beauglehole.

The Ada Initiative Census

The Ada Initiative have just launched their first annual census — a broad survey of open technology and culture participants — to find out more about what projects and communities people are involved in, and how they feel about women’s inclusion and representation in the field.

Everyone involved in free and open software, open culture, etc. is invited to participate and I encourage you all to do so.

The census is short and takes about 5 minutes to complete.

Take the Census

useful git aliases

Thought I’d share some useful git aliases with people. These can go in your ~/.gitconfig.

[alias]
    branch-name = !git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \\(.*\\)/\\1/'
    export-branch = !git format-patch --stdout $1 > ~/Desktop/`git branch-name`.diff

git branch-name (based on an idea from Jon Maddox) will print the name of your current working branch. For example:

[danni@adelie empathy]$ git branch-name 
ft-warning-644062

This can then be used to create another alias, git export-branch which will export the current branch from the named branchpoint to a format-patch called ~/Desktop/branchname.diff. For example:

[danni@adelie empathy]$ git export-branch gnome-2-34
[danni@adelie empathy]$ ls ~/Desktop/*.diff
/home/danni/Desktop/ft-warning-644062.diff

Update: thanks to David in the comments for a much more reliable approach to get the branch-name:

branch-name = !git for-each-ref --format='%(refname:short)' `git symbolic-ref HEAD`

Trying out Chromium (Google Chrome)

Due to tiredness with Firefox eating all my memory, getting out-of-memory killed for eating all of my memory, getting kind of slow (probably because it ate all of my memory) and an annoying layout bug in one website (which strangely didn’t appear on any other machine using Firefox except mine); I have decided to give Chromium a go (also, Melbourne is currently full of Google Chrome ads, this may have contributed to my decision).

Initial niggle was that it doesn’t seem to have a concept of minimum font size exposed in the UI. You can edit a config file to solve this, which is significantly less annoying than the extension that resizes your page 5 seconds after it loads.

Most of the extensions I use are available for Chrome, except I haven’t found an analogue for the very useful highlighter extension.

Telepathy GIT repositories move to freedesktop.org

Although Telepathy has always been a freedesktop project, for the longest time the repositories were hosted on Collabora’s git server (I blame the original use of darcs). Sjoerd informed me today that this is no longer the case and the repositories have finally been moved to freedesktop.org where they belong.

The repositories are still available read-only on git.collabora.co.uk for the time being. It’s not known to me when they might be moved to an archive directory or go away completely.

You can update your remotes with git remote set-url, in shell it looks like this (assuming your origin is Telepathy upstream):

# set NEW_URL appropriately
NEW_URL=git://anongit.freedesktop.org/telepathy/
# NEW_URL=ssh://git.freedesktop.org/git/telepathy/

for d in telepathy-*; do
  ( cd $d && \
    git remote set-url origin $NEW_URL$d && \
    git remote update -p origin )
done

~

Also in case you missed it, telepathy-sofiasip, the SIP connection manager has been renamed to telepathy-rakia. SofiaSIP is the name of the library that telepathy-rakia uses and since Telepathy connection managers are often referred to by the last part of their name (e.g. gabble, haze, butterfly), calling it sofiasip was ambiguous. Like all Telepathy names, there is a tenuous link between the name of the protocol and the name of the CM.

announcementses

The biographies of the advisory group for the Ada Initiative was recently announced and I’m extremely proud to say that I’m a part of it.

In other news, I merged support for contact blocking in Empathy 2.33.2, which will be in the Empathy 2.34 release (the gtk2 branch of Empathy), for Telepathy connection managers that support blocking (at least Google Talk). Hopefully my talented GOPW intern Chandi will find time to forward port that work to master (i.e. Empathy 3.x) before I do, so everyone else can enjoy it too.

Thanks to the hard work of other Collaborans (Emilio and Sjoerd), Empathy 2.33.2 also has experimental support for Call, the new VoIP API in Telepathy that supports a lot more than the older StreamedMedia API.

LD_PRELOAD GObject lifetime debugging tool

For years and years I’ve dreamt of a tool that would show me what GObjects are currently alive, and let me have a look at information about them. Today, while trying to debug a particularly horrid reference leak (program wedged under refdbg, and without being able to script SIGTRAP I’ve never found this method useful), I actually started writing the tool.

The tool uses LD_PRELOAD to replace g_object_new() — it should really replace g_object_newv() and g_object_new_valist() also, but I didn’t need those — to install a weak reference on the created objects to track their lifetime.

The result of which is something like this:

[danni@adelie src]$ LD_PRELOAD=libgobject-list.so \
    GOBJECT_LIST_FILTER=Gabble GABBLE_PERSIST=1 \
    /usr/lib/telepathy/telepathy-gabble 
 ++ Created object 0x9912530, GabbleGatewayPlugin
 ++ Created object 0x990c460, GabblePluginLoader
 ++ Created object 0x9917ab8, GabbleJabberProtocol
 ++ Created object 0x99172f0, GabbleConnectionManager
...

You can then list the currently living objects and their reference counts by sending SIGUSR1.

[danni@adelie src]$ killall -USR1 telepathy-gabble
Living Objects:
 - 0x9b47038, GabblePresence: 1 refs
 - 0x990c460, GabblePluginLoader: 2 refs
 - 0x9918ae0, GabbleRosterChannel: 1 refs
 - 0x991cb38, GabbleIMChannel: 1 refs
...

This by itself was useful in showing which object wasn’t finalized but should have been (and why my object in question also hadn’t finalized), but didn’t show me who was still holding the reference.

My hunch was that the problem was a reference cycle between two objects, so I hacked a bit of code into my tool to list the “connection” property on all objects that had it. [In Telepathy Connection Managers, objects are typically meant to let this go when connections become disconnected.]

  while (g_hash_table_iter_next (&iter, (gpointer) &obj, NULL))
    {
      GObjectClass *klass;
      GObject *conn;

      g_print (" - %p, %s: %u refs\n",
          obj, G_OBJECT_TYPE_NAME (obj), obj->ref_count);

      klass = G_OBJECT_GET_CLASS (obj);
      if (g_object_class_find_property (klass, "connection") != NULL)
        {
          g_object_get (obj,
              "connection", &conn,
              NULL);
          g_print ("\t + connection = %p\n", conn);
          if (conn != NULL)
            g_object_unref (conn);
        }
    }

This showed me which object was still holding a ref it should have let go. [Now I just need to work out why, the code in question is in an abstract base class, for which 5 of 6 concrete classes work correctly.]

If you’re interested, the code is in Git.

The tool could still benefit from a lot of work. For instance, the filtering is pretty basic at the moment and it should support all the ways to create GObjects. Originally I had envisioned this tool as a GUI window that popped up, so that you could click on an object and view all of its properties, connected signals, etc. That would be pretty neat actually.

Update: cassidy has already contributed by adding a listing of the objects remaining when a program exits and thus found a leak in Empathy. Awesome!

The Ada Initiative

A couple of weeks ago at linux.conf.au I was invited to a meeting to help brainstorm on a new initiative being set up by open source contributors Valerie Aurora and Mary Gardiner. That initiative, the Ada Initiative, has just been launched.

The Ada Initiative is a new non-profit organization dedicated to increasing participation of women in open technology and culture, which includes open source software, Wikipedia and other open data, and open social media.

The Ada Initiative is focused on helping women get careers in open technology through recruitment and training programs for women, education for community members who want to help women, and working with corporations and projects to improve their outreach to women.

Get more information from the launch announcement.

N.B. The Ada initiative should not be confused with Ada Lovelace Day, which incidentally has been moved further back in the year to October 7.

linux.conf.au roundup

Got back from linux.conf.au on Saturday afternoon. Sore and tired. Here is a brief roundup of my conference.

Monday

Spent the day at the Haecksen mini-conference. Gave my talk on the GNOME Outreach Programme for Women (yes, I will upload either my notes, or link to the video when it appears). Favourite talks for the day were Noírín’s on open source disaster and emergency management software and Donna’s. [You can learn about and contribute to Donna’s campaign to Digitise the Dawn here.]

Went to the Geek Girl Dinner in the evening. There was a paper plane competition. My plane performed woefully poorly.

Tuesday

I didn’t actually make it to the conference on Tuesday, because I spent the entire morning in a brainstorming meeting, which didn’t finish until after lunch. I decided to use the rest of the day to visit a friend.

I would have liked to have heard about Publican, the publishing tool Redhat use for their documentation. I wonder if it could be adapted to publish the Telepathy book.

Wednesday

The keynote talked about the IPv4 address exhaustion. Very doom and gloom. I can’t help but feel in the immediate term this will mostly affect people in the developing world. Maybe the take-away point is buy your iPhone now, while it can still be allocated an IP address.

Learnt about Intel’s new GLSL compiler, multi-core scalability in ext4 (interesting take away points for multithreaded userspace programming too), and how technical documentation is written at Redhat. Also attended two X/graphics talks. These mostly seemed focused on history, not really a clear vision of what happens next.

The Professional Delegates Networking Session (at the Maritime Museum) was enjoyable. Giant woks for cooking noodles. Surprise Australia Day fireworks. I didn’t go on any of the boats.

Thursday

Keynote was on the history of sendmail. I have to admit, I don’t really know if the history of projects is that interesting for a keynote address. I’d rather know what the future was going to look like. Learned that the keynote speaker and I are going to appear in the same book.

Advanced C Coding was actually just a show off of CCAN and I didn’t actually learn any new coding tricks. I went to Dave Airlie’s talk, but due to tiredness (did I mention I was staying with a one-year-old?), I can’t tell you what it actually contained.

Made a last minute decision to go to the LBGT lunch, this turned out to be a planning disaster that involved a 20 minute, uphill walk in the sun. It ran over, cutting into the next sessions. Between this, existing tiredness and now exhaustion, ended up writing the rest of the afternoon off and going back to the flat to nap prior to the dinner.

The Penguin Dinner was quite enjoyable. The vegan option was really tasty (entrée, main, dessert). I want to try and recreate the entrée.

Friday

Friday’s keynote was the disappointing one I mentioned earlier. Take away point is that Facebook is evil because it keeps your data locked up and they know all about your social network. Not sure how using an open system to store your social network would somehow prevent people who run servers from mining information from it.

Wanted to see Carol Smith’s talk, but the room had packed out by the time we got there. Sarah Sharp’s talk on open source gardening was probably a highlight of the conference for me. Part of me wants to replicate her garden watering system, although I think first I might still try my low-tech solution. The part of Tridge’s talk on reverse engineering USB device drivers was quite interesting.

~

Flew home Saturday morning, so I didn’t see any of the open day.

Was amused to learn that next year’s conference is in Ballarat. I wonder how some people are going to feel about landing in Melbourne, then having to take a bus to Southern Cross train station and then a train to Ballarat (Metlink informs me the total trip takes 2-2.5h).

Overall I had an enjoyable week, but an exhausting one. I enjoyed the company of the people I was staying with. I met some new people, who were pretty cool. I talked about rollerderby and the queerness of different shoes. Was really impressed by the Brisbane busway system. Helped someone debug telepathy-gabble.

Thanks as always to Collabora (my employer) for letting me go 🙂

Creative Commons Attribution-ShareAlike 2.5 Australia
This work by Danielle Madeley is licensed under a Creative Commons Attribution-ShareAlike 2.5 Australia.