Archive for the 'Business' Category

Results of Stray Event Scanner evaluation at a customer site

Tuesday, August 19th, 2008

As I mentioned, about a week ago I visited a customer site to find out if our Stray Event Scanner tool actually did the trick, on their codebase. That customer has kindly said I can post some results here.

Results were mixed!

Proportion of this customer’s codebase scanned 5% (estimate).
False positives reported by the tool 47
Of which are things I might be able to fix 37
are intrinsic limitations 8
are already fixed in a later development version of the tool 2
Interestingly, 35 of these false-positives were in one smallish area of code. It seems that some Symbian OS code conforms to the norms expected by the tool, whilst some code really gets is unnecessarily overexcited. All the rest of the code we scanned only produced 12 false-positives.
Real bugs found by the tool 14
Of which tool was precise about the problem 6
tool was wrong, or vague, about the specific problem but did identify the right bit of faulty code 8
Actual bugs filed in this customer’s defect-tracking system 10 (because the other four were duplicates)

Conclusions. Good things first…

  • As expected, the tool found plenty of bugs. Nearly all of these bugs were real problems which could cause E32USER-CBase 46 panics under some circumstances, which are awful to diagnose.
  • In fact one of them was a duplicate of an existing E32USER-CBase 46 bug, which they’d been searching for for some time, but had been unable to find. Result!
  • The tool broadly worked as planned. There were no hopeless incompatibilities with their source code.
  • With the exception of that one component, there were far fewer false-positives than I realised.

Bad things…

  • There were lots of false-positives in that one component. Many of these will be impossible to remove using the current analysis method.
  • In some cases the tool was not very accurate about specifying exactly what was wrong with the code. It would identify the right area of code, but a lot of examination and thought was required to identify whether there really was a problem there. Again, there’s not much that can be done about this: stray event problems are intrinsically complicated and somebody technically experienced will be required to analyse the results.

Next steps…

  • See how many of those false-positives I can remove easily
  • Fix a few other minor bugs that cropped up
  • Decide whether the tool is ready to leave the beta stage!

Off to demonstrate tomorrow…

Sunday, August 10th, 2008

A customer has given me a contract to deploy my tools on their codebase, to see whether they come up with useful results. After that, maybe they’ll talk about licencing the tool… very exciting! But of course I’ve failed to fix all the things I had wanted to fix in the time leading up to this demonstration, so I know it won’t meet their criteria, quite. Sugar!

Stray Event Scanner Launched

Wednesday, July 9th, 2008

Macrobug is proud to present its first product for actual sale: the Stray Event Scanner. This is a source code analysis tool which does one thing, and does it well: it finds the causes of the dreaded Stray Event panic. Why are they dreaded? Well, by the time the crash has happened, the reason is lost in the mists of time, so there’s no way to diagnose them except to read reams of source code and spot the mistake.

The Macrobug Stray Event Scanner does that for you. It uses GCCXML to build your source code, and then analyses the results to ensure that each any every time you make a request, you are somehow getting ready for the reply to be received.

Problem marker from Stray Event Scanner

And yes, the problem messages are so descriptive they don’t even fit on this website.

Download the demonstration version now, or buy the real one!

Crashing - how not to do it

Wednesday, July 9th, 2008

If you’re a Symbian OS device creator (that means, you make phones) you’ll want to read this paper. It includes interesting statistics about which crashes occur most often during the device creation process, and tips about which products can identify them early using source code analysis. Of course, the conclusion is, you should buy our new product – but also, you should buy Coverity™ or Klocwork™!

Imminent launch!

Wednesday, July 9th, 2008

Well, after years of procrastination, it’s about to happen.

This is it.

I’m about to release a product.

In fact, it’s already been available for download from this website for weeks, and has been diligently tested by a couple of testers (special thanks to Adrian in particular!) It’s still nowhere near final-quality, but it’s good enough that I want more people to download it and play with it. And, if people like it enough to buy it, that’s fine with me.

So, Macrobug enters a new phase - the terrifying phase of actually having to sell things. I’ll try to post relatively frequently to recount my experiences!

First steps:

  1. Post on blog - check!
  2. E-mail lots of contacts about it - check!
  3. Cross fingers very hard… check…

It’s springtime!

Tuesday, April 29th, 2008

Eh? What? Adrian’s blogging again?

Yes. Macrobug has not gone away, just been dormant for the past few months whilst I’ve been working on other things.

But, fear not, because I am about to launch a product!

Android versus Symbian OS

Saturday, December 8th, 2007

Here are some superficial thoughts on Android (which I don’t know much about) versus Symbian OS (which I do).

Android Symbian OS
Business model
Revenue stream for creator Advertising, fairy dust? Fixed license fee per phone (with a few quirks, all publicly known
Source code availability Available to nobody yet. Available to all, in theory, one day. Available only to Symbian OS phone manufacturers, plus partners who pay a lot.
Source code modifiability Freely modifiable (although I seem to remember constraints for Open Handset Alliance members, presumably related to keeping the APIs sufficiently similar between devices to keep a common platform for developers Modifiable, but with similar restrictions aimed at keeping a common platform.
End-user openness End devices will probably accept Java-language applications. No evidence that they will accept native applications. All end devices accept Java-language applications, and virtually all also accept native applications.
Current market position in smartphone market Zero, but has Google behind it Overwhelmingly dominant in EMEA and Japan, reasonable success elsewhere except America. (American technology writers just don’t realise Symbian exists, and that it’s America which is unusual…)
Technical Basis
API language Java C++ (J2ME Java also available for a subset of APIs)
Standards-compliance Highly POSIXy for native handset software. Proprietary for high-level Java APIs. Proprietary. POSIX layer available, but it limits interaction with the rest of the OS so much that it’s only really used for porting software.
Kernel Linux with minor changes Proprietary
Basic user library BSD-derived libc Proprietary
User interface Unknown; current is a ‘placeholder’ None; UIs developed by Nokia (S60), DoCoMo (MOAP) and UIQ/Motorola/Sony Ericsson (UIQ). Other UIs have existed in the past.
Typical filesystem YAFFS2 Proprietary.
Toolchain for native software Standard GCC, possibly requiring prelinking and other oddities Proprietary, built on top of GCC
Binary format Standard ELF Proprietary
Toolchain for typical third party software Ant-based, dex compiler, etc. Same toolchain for entire device
Debugging/profiling/investigation tools Standard UNIX tools Not a lot
Inter-process communication Unclear. D-bus for some layers. OpenBinder for others. Possibly something different again for messages flowing between the Dalvik-side processes. Proprietary; based on client-server.
Features
Pre-emptive multithreading Yes Yes
Memory protection between processes Yes Yes
Pre-emptible kernel Yes Yes
Demand paging Yes Yes
Virtual memory (page outs) Probably not according to Dianne Hackborn; they are anticipating devices with 64MB RAM and 128MB flash Not yet, but it may not be long; Symbian OS has been in use on phones with hard disks for some time
Shared libraries Yes Yes
Copy-on-write Yes N/A (’fork’ is not used)
Reference counting of kernel objects and proper cleanup if a process dies Yes Yes
Approaches to problems
Flash space taken by many copies of symbol names for dynamic linkage Unknown; maybe just don’t use too many native programs Link by ordinal not by name
Memory allocation Allocate a big hunk of virtual address space for process. On write, try to free up enough physical RAM pages to give it the memory it needs. Allocate minimum virtual and physical address space; heap algorithms in user library know how to request more RAM from kernel.
Memory full behaviour Kernel will kill other processes if necessary to relinquish physical RAM. If no physical RAM is available, program is killed. On some Symbian systems, user-side heap library may request other apps to exit. If no memory really is available, malloc equivalent throws an exception and application should be able to handle it.
Memory management within user code Check for NULLs from malloc if you’re lucky, but you’ve probably got spare virtual address space anyway so it’s unlikely you’ll be told of a memory allocation failure Incredibly anal rules about memory management
Security Each process runs as its own user. Unclear how this prevents access to certain APIs that could do destructive things. Processes have capabilities and can only access APIs appropriate to their capabilities. Applications must be certified and are then signed such that they cannot access APIs beyond their capabilities.
Overhead of loading binaries Store application code as dex files which can just be mmap’ped in Store application code as native code which can just be mmap’ed in (or equivalent)
Overhead of interpreter startup Application interpreter starts once (Zygote) and all other processes fork from that No interpreter - native applications
Componentisation Software uses ‘intents’ to say what it wishes to do. Other software can fulfil the intent. Applications typically rigidly defined (but can load plug-ins).
XML and text files are inefficient Compile XML down to a binary representation Compile resource files down to a binary representation
Overhead of multiple threads Remove need for multiple threads, but allow developers to use them if they wish. Provide event loop which runs in main thread and can respond to most events. Allow events to be posted onto event loop using handler object. Remove need for multiple threads, but allow developers to use them if they wish. Provide object-oriented event loop in main thread (’active scheduler’), using ‘active objects’ to respond to each type of incoming event.
Overhead of making APIs and libraries thread-safe Insist they are used only from main thread Run in a different process; use IPC for all UI requests. And indeed pretty much anything else.

Some of that’s probably rubbish, and may be based on misinterpreting bits of the interesting podcast. I’m happy to accept corrections, but then again, only six people read this blog anyway so this post was mostly for my own interest :-)

In other news, Motz has figured out the correct linker settings for the Android loader!

Plural number formats in Excel

Wednesday, October 10th, 2007

In Excel, suppose you want to produce a table like this:

2 oxen
1 ox
3 oxen
Total 6 oxen

Obviously you want to use the SUM formula to add up the total number of beasties. That means you can’t literally type “2 oxen” into the cell - you’ll have to just type “2″ but make up a number format to present it as you wish.

That’s easy for singular quantities: the number format would be 0 “sheep”.

But for plurals you have to go a bit further. It turns out you can put multiple formats in the box, separate them with semicolons, and add conditions. So the desired format is this: [=1]0 “ox”;0 “oxen”.

This adds all sorts of potential. What about [=0]”None”;[<4]”A few”;”Lots”? Or [=2]”Company”;[>2]”A crowd”?

Numbering table rows in Word

Thursday, September 27th, 2007

Useful for test plans, etc.

Insert a field each time you want a number produced, with the formula “Seq XYZ”, where XYZ is any arbitrary label you want. (It won’t appear; it just gives a name to the sequence and ensures that each item with that name gets a unique number).

More advanced tips here.

Minor health and safety quirk

Tuesday, September 11th, 2007

I think I’ve found a bug in the health and safety rules.

These rules always say that you should adjust your working environment so that the top of your monitor is level with your eyes. Which I’d been doing - but I’d also been getting back pains.

What I hadn’t done is ensure that the top of the monitor is level with my eyes when my back is straight. So, my adjustments had involved altering the level of my monitor, but only to the level of my eyes when I was slumped in a presumably-unhealthy posture.

Arguably, since I wanted to believe that my monitor was at the correct level, I’d been slumping in order to comply with the rules. Only at a subconscious level though!

I have now put my monitor about 10 inches higher, which is definitely too far up, but I’ll see what effects it has and hopefully find a happy medium. I’m certainly finding my back is straighter - I am having to look up very high to see anything at all!