MikeK's software notebook

MikeK's software notebook

What you will find

This used to be the place where I wrote stuff I was thinking about while working on the Mozilla project.

Maybe in the near future I'll start to update it again as I'm involved in a couple of new open-source projects - updates pending...

Inconsistency detected by ld.so: rtld.c: 1192: dl_main: Assertion `(void *) ph->p_vaddr == _rtld_local._dl_sysinfo_dso' failed!

Why did I reboot?Posted by Mike Kristoffersen 17 May, 2009 22:34:27
On my 64-bit Ubuntu box, I got this error when I tried to login to scratchbox after following the instructions here. Fortunately there was a hint on how to solve it here.

The trick was to add:

abi.vsyscall32 = 0

To my /etc/sysctl.conf file:

~$ sudo gedit /etc/sysctl.conf

and then running

~$ sudo sysctl -p

  • Comments(2)//developer.mikek.dk/#post40

checking for minimum required Python version >= 2.4... configure: error: Python 2.4 or higher is required.

Why did I reboot?Posted by Mike Kristoffersen 07 May, 2009 13:40:15
Above fixed in scratchbox by:

> fakeroot apt-get install python2.4

  • Comments(0)//developer.mikek.dk/#post39

checking for libnotify >= 0.4... Package libnotify was not found in the pkg-config search path.

Why did I reboot?Posted by Mike Kristoffersen 04 May, 2009 19:49:47
Todays build error is (might be related to fetching the latest code, or upgrading my desktop to the latest 64-bit Ubuntu-studie base on Ubuntu 9.04) :

configure: error: Library requirements (libnotify >= 0.4) not met;

I tried fixing it by:

~$ sudo apt-get install libnotify-bin

Didn't seem to help anything, so tried with:

~$ sudo apt-get install libnotify-dev

and the issue was fixed :)

Updated 7 May 2009:

Note that when working in scratchbox you need to replace "sudo" with "fakeroot"

  • Comments(0)//developer.mikek.dk/#post38

Can we do more than Fennec to broaden our market, to accomplish our goal about an open WEB and one that it accessible to all?

I wonderPosted by Mike Kristoffersen 30 Apr, 2009 22:15:26

Here I'm thinking about the large population in developing countries that do not have computers and definitively not wired Internet connections.

If you go to the Mozilla homepage and try to find out what Mozilla is, then it's about “...improving the way people everywhere experience the Internet”, now if a significant part of the world community don't have access to computers, what can we do about it – I would claim that we can give them access to the Internet trough their mobile phones.

Some might ask if they have mobile coverage in undeveloped areas, and the answer is, that yes, it is much more likely that they have mobile coverage than wire-based coverage, simply because it is cheaper to create a mobile network than a wired one – in a wired one you have to physically connect each node with a wire, in a mobile network you only have to connect the base stations in the cells, which you might also do with wireless technology, leaving a power source as the only thing that might require some sort of existing infrastructure – this might be solved by generators, batteries, solar cells etc.

The next thing that might be relevant to ask is, if people can't read will they then have any benefit of Internet access? - First of all, it is not everybody that lives in undeveloped areas that can't read, and secondly, there are content types that could be highly useful even for those that don't have the ability to read – like farmers could benefit from a graphics based weather forecast, or they might see a locus warning forecast as highly valuable. More long valued audio content like educational or political could also be seen as valuable.

Now it would be a challenge to create a browser that didn't require any form of written interaction, but I'm sure that it can be done, creating a web without written words would also be a challenge, but, again I'm sure that it can all be done and it would make us really change the world!

The handsets that are available to people in developing countries are probably be very cheap and hence low on features and certainly they don't have lots of processing power nor memory – there have even been talks about creating phones without displays both for this market and for use-once-then-throw-away-when-your-battery-goes-dead-or-you-have-used-the-prepaid-amount phones for more developed areas – this would require some kind of audio-only browser which could give a similar web experience as people that don't have the ability to see the display on a normal computer has today. The main difference here being that the input method would be very different, as the target market might not have the ability to write – the most obvious solutions here are speech recognition and spoken menus.

We might not be ready to jump into development of the web-experience or the browser technology as described in this post, but I hope that more people will start to wonder how the content and the browser experience could be for these markets, this is where the important development needs to take place – the things that can be discussed later, is how do we make the software fit in very limited flash and volatile memory.

  • Comments(0)//developer.mikek.dk/#post37

Profiling tools

RandomPosted by Mike Kristoffersen 27 Apr, 2009 21:47:30
For Linux, try oprofile (a command line tool), or sysprof (GUI based)

My favorite for Windows is still AQTime

  • Comments(0)//developer.mikek.dk/#post36

.../mozilla-central/client.mk:284: *** Couldn't find autoconf 2.13. Stop.

Why did I reboot?Posted by Mike Kristoffersen 24 Apr, 2009 22:39:18
So yesterday I upgraded my Ubuntu on the laptop to version 9.04 - the Jaunty Jackalope I was a bit worried that it might get me into trouble with the Mozilla build, but since I'm at the Mozilla headquater this week, I was sure I could get help if it went totally bananas, better do it now, than when I'm back in DK was my thought :)

So as I thought it gave a build error - deleting the objdir and all random files I tried building again - this time I got the error:

.../mozilla-central/client.mk:284: *** Couldn't find autoconf 2.13. Stop.

Kind of made sense, as the Ubuntu upgrade probably upgraded this component too, and in the process deleted the old version - so after figuring it out, the fix was easy, just had to reinstall the old package again:

~$ sudo apt-get install autoconf2.13

Restarted the build, soon enough I got the next error (well hidden in the build output):

Package gtk+-2.0 was not found in the pkg-config search path.

I tried:

~$ sudo apt-get install libgtk2.0-dev

which seemed to fix it..., at least I now got a new error

Package dbus-glib-1 was not found in the pkg-config search path

fixed by:

~$ sudo apt-get install libdbus-glib-1-dev

new one:

Package libIDL-2.0 was not found in the pkg-config search path.

fixed by:

~$ sudo apt-get install libidl-dev


configure: error: Could not compile basic X program.

This was a new one, not directly complaining about a missing package... looking in the config.log file in the "root" folder of the build (mozilla-central) I saw an error about a missing X11 file :

error: X11/Intrinsic.h: No such file or directory

Searching my drive for this file only showed that it was under the scratchbox directories - not good enough - so a quick Yahoo search (yes, there are other search engines than Google) - showed that the file was part of the libxt-dev package - so I tried:

~$ sudo apt-get install libxt-dev

It didn't seem to make the "X11/Intrinsic.h" file appear in my search on the disk, but the build got happy enough to no longer bother me with the unability to compile the basic X program....

I then got another error that I forgot to cut'n'paste into this entry, the way I solved it was to delete all the build generated files in the mozilla-central directory...

The I got a bad one:

gfxPangoFonts.cpp:1841: error: ‘struct _PangoFcFontMapClass’ has no member named ‘context_substitute’

That one is because the Pango library interface changed between Pango version 1.22 and 1.24, so this means that I'm kind of forced to upgrade my source base to the latest, but as I was working on a rather old base in the first place that is probably ok :)

  • Comments(3)//developer.mikek.dk/#post35

Nice open-source presentation

RandomPosted by Mike Kristoffersen 23 Apr, 2009 21:14:48
This morning I saw a nice video presentation about the concept driving development in the open-source Mozilla organization/community, if that is the right way to describe it...

It is the kind of presentation that makes you think afterwards if you ignore the sales talk on firefox and mozilla build into it ;)

Finally the links to the presentation, and to the slides.

Why didn't I have the option to take this kind of classes when I went to the university?

  • Comments(0)//developer.mikek.dk/#post34


Mozilla coding hintsPosted by Mike Kristoffersen 22 Apr, 2009 23:14:28
Looking at the Mozilla code, you have probably come across the NS_DECL_ISUPPORTS and NS_DECL_ISUPPORTS_INHERITED macros. These are actuall not Mozilla specific but rather part of XPCOM.

The purpose of these macros are reference counting and interface detection.

So instead of implementing the:

NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);

functions that are declared in nsISupports, you add the NS_DECL_ISUPPORTS macro to your class definition, like:

class nsMyBasicClass : public nsISupports
// Basic refcount and interface detection macro

Now, if you inherit from an interface that inherits from nsISupports, then you need to specify this interface too:

class nsMyInterfaceImplementerClass : public nsIMyGreatInterface
// Basic refcount and interface detection macro

If you inherit from multiple interfaces then you just list them all instead of NS_DECL_NSIMYGREATINTERFACE in the example above.

The above "macros" take care of the prototyping of the functions, you also need to use some "macros" to implement the body of the functions.

In the case where there is a direct inheritance from nsISupports the "macro" should be:


(Just put it anywhere in your source file)

If you implement multiple interfaces you replace the 0 in the end of the name with the number of interfaces that you implement, and list the names of these interfaces after the name of the class that implements them:

NS_IMPL_ISUPPORTS1(nsMyInterfaceImplementerClass, nsIMyGreatInterface)

In the case where you inherit from multiple classes that already implement the nsISupports interface, you can get an ambugity as to which functions to call to do the reference counting - to solve this you must use the NS_DECL_ISUPPORTS_INHERITED "macro" instead of the plain NS_DECL_ISUPPORTS "macro"

Remember that all pointers to interfaces/classes should use a reference with the type:


rather than a nsMyType*, as you don't wan't to take care of the reference counting manually.

  • Comments(0)//developer.mikek.dk/#post33
« PreviousNext »