Blog Image

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...

configure: error: The header jni.h was not found.

Why did I reboot? Posted on 01 Apr, 2009 14:05:12

I don’t think I wrote about the above error before – but I have at several instances spend significant time on solving it…. In the output from the build there are some suggestions like setting some flags to disable JAVA in the configuration file, or setting the system up for Java.

But there is another possible reason that are not described in the output, and that is the reason that I usual have. The problem is that the various components of the build system are running from different directories, hence they need an absolute path to the configuration file – e.g. don’t write:

export MOZCONFIG=./myMozConfigFile

Give it the full path e.g.:

export MOZCONFIG=~/source/mozilla-central/myMozConfigFile

It’s ok to use ~ as the build system doesn’t change the “home” directory during the build.



/memory/jemalloc/jemalloc.c:4511: Failed assertion: “(mapelm->bits & CHUNK_MAP_ALLOCATED) != 0”

GStreamer Posted on 01 Apr, 2009 11:11:54

So after upgrading to the latest version of the Mozilla code last week I started to get an assertion when I was using GStreamer to decode video on the N810. Debugging is usual much nice to do on the PC, so I set up building Fennec for Linux, I had to repeat most of the steps that I had done in scratchbox to make it compile with gstreamer, but since it’s all Linux it wasn’t much of an issue to just repeat the steps.

Sure enough the same error appeared on the laptop as I had seen in the device (lucky me). I didn’t have much luck in attaching the debugger to Fennec after it had asserted, but when I redid the test starting Fennec from the debugger it was easy to see the call stack.

It seemed to be related to a delete of the buffer given to nsMediaDecoder::SetRGBData – diffing the old version of this function (where the code was working) with the new version, showed something interesting.

Originally the buffer given in SetRGBData had been copied to an internal buffer, meaning the caller of SetRGBData had ownership of the buffer. In the new version there is no longer a copy, the pointer to the buffer is stored in a nsAutoArrayPtr, meaning the next time this pointer is assigned something the previous content is deleted – ahh… we start to see a reason for the fault here, don’t we?

Previously it was the responsibility of the caller to delete the buffer, this is now handed over to the called function, but since the GStreamer code hasn’t been updated to reflect this there is a conflict of ownership.

Realising what the problem is, is the first step, now I need to fix it 😉



Visual debugger

Why did I reboot? Posted on 01 Apr, 2009 10:52:49

Well, do you know gdb, the command line debugger for Linux, well… I’m sure it’s quite useful, but there is a better alternative that suits me better – insight, it’s still gdb but wrapped in a nice user interface 🙂 (insight even takes the same command line arguments as gdb)

(see my comment on KDbg in the… well.. comments section)



Ubuntu vs. Source Insight

Why did I reboot? Posted on 01 Apr, 2009 10:44:17

I’m one happy man right now 🙂 as you know if you follow this blog, I have been using Scratchbox under Ubuntu (Linux) to compile for the Nokia device – now I quite like Linux but I also like visual and userfriendly GUI tools 🙂

My main tool when looking in code is Source Insight, I haven’t found any other tool that helps so much when trying to understand code – but guess what I now have it running in Linux by the help of wine, it was just so easy:

sudo apt-get install wine

Then I went to the homepage of source insight, downloaded the windows version… well, the only version… it installed, and fired up – that’s it – a few minutes to create a project and scan the files, and I was ready to go – maybe later I will try with Beyond Compare the best compare tool – like the new 3-way merge they have made 🙂

Now I’m seriously considering kicking Vista out from my private desktop and using Linux for everything 🙂 – might do a dual boot for the rare ocasion where I want to play a game.