GNAT GPL 2012 is here!

I’ve been waiting anxiously for the 2012 edition of the GNAT GPL compiler and the accompanying GNAT Programming Studio update, and now the wait is finally over:

Get the GNAT GPL 2012 package

Coinciding with the GNAT GPL 2012 release, we also get a bunch of updates to all the other great libre.adacore.com tools, such as:

And a whole slew more. I’ve personally installed GNAT GPL 2012, the new GPS, AWS 2012, GNATColl 2012, Florist 2012 and XML/Ada 2012 on my Slackware64 boxes, and everything went without a hitch. It just worked. Next up: Getting familiar with some of new Ada 2012 features. Should be fun.

Using AWA and Dynamo To Quickly Build An Ada Web Application

AWA, or Ada Web Application, is an Ada powered framework to build web applications. It is made by Stephane Carrez and sits on top of Ada Server Faces, Ada Database Objects and Ada Web Server. The latest version of AWA provides:

  • A new event framework with configurable action listeners.
  • Persistent event queues for the event framework.
  • A new blog module and wiki engine supporting Google Wiki, Creole, MediaWiki, phpPP and Dotclear syntax
  • New mail UI components allowing to generate and send email easily with the ASF presentation pages
  • A new Javascript plugin Markedit with jQuery Markedit (MIT License).

If you want to experience AWA at work, you can go to the online demo, or you can take a look at a video Stephane did called Creating a Web Application with AWA. In this video he mentions Dynamo, which is a tool created to help build Ada web applications. Dynamo version 0.5.0 was recently made available with lots of new features:

  • Support multi-line comments in XML mappings.
  • Generate List_Bean types for the XML mapped queries.
  • Add support for Ada enum generation.
  • Add test template generation.
  • Add AWA service template generation.
  • Add support for blob model mapping.
  • New command ‘add-ajax-form’, ‘add-query’, ‘dist’, ‘create-plugin’.

Be sure to go check out all these tools if you’re in the market for building a web application in Ada – AWA and its siblings might just be what the doctor ordered.

AWS patch the 28c3 hash vulnerability

January the 3rd. and 9th. I posted two short messages to the AWS mailing list, asking whether AWS was susceptible to this attack (video). I got no answer, but from looking at the hash function used, I was pretty sure AWS was just as vulnerable as all the other web technologies. This was confirmed at the January open Ada-DK meeting, where we spent some time checking out the code.

Things were also stirring at the #ada Freenode IRC channel, and january the 17th. Marcelo Freitas put together a test, and actually found 46656 hash collisions simply by bruteforcing the Ada.Strings.Hash function, which is what AWS used at the time.

Those 46656 collision were enough to keep one core running at 100% for 3 minutes, using a simple “Hello World” AWS server.

Marcelo sent his findings to the AWS developers, and shortly thereafter these fixes were pushed to the AWS Git repository:

The power of Open Source software is amazing. This fix went in the same day Marcelo had reported the issue. That is just plain awesome.

AWS now ranks proudly among the few web technologies where this problem has been fixed.

AWS vs node.js Wiki Article Migrated

One more down! Only a few more to go. The latest Wiki article I’ve migrated is my now 1 year old AWS vs node.js shootout. Yea, it’s getting a bit long in the tooth. I’m trying to convince Kim Rostgaard Christensen to help me redo it, perhaps with some more interesting workloads added to the mix.

But for now you’re going to have to make do with the old article. 🙂

Ada on Slackware

I finally got around to writing an article about Ada Programming on Slackware. Actually that’s probably overstating things a bit, as no actual Ada programming is happening in the article. Instead the focus is on how to install an Ada compiler and some Ada libraries on a Slackware system.

It is by no means a complicated process, but then again nothing is complicated if you know how it’s done. This article is squarely aimed at Ada programmers who perhaps do not live and die by the commandline.

The article is also a first for me, because it contains videos of the entire compile/install process. Yes, that’s right, you get to “enjoy” my gentle voice, while I struggle with the English language. I know videos aren’t exactly the best way to convey information about these things, but I do think that they are good addition for someone to whom tar zxvf something.tar.gz is completely alien.

At least I hope so.

Feel free to let me know if you think I’ve completely wasted my time doing these videos or if you’d like me to do more.

If you don’t want to bother with the article, you can go straight to the videos:

I think my next article might be about Ada tasking, unless you’ve got a better suggestion?

Logging options for Ada

The other day Marc C. posted a link to an AdaCore Gem dealing with the very nice GNATColl.Traces package, and shortly thereafter he did another reddit/r/ada post collecting a bunch of Ada logging tools.

As it turns out, there are five very nice solutions available to us Ada’ists:

I’ve personally used GNATCOLL.Traces and AWS.Log, and both are pretty good. I’m partial to GNATCOLL.Traces because of its syslog support, though at the time of writing GNATCOLL.Traces.Syslog is borked. It simply segfaults when you try to use it. Hopefully AdaCore will have that bug sorted out soon.

I intend to give Alog a whirl, as it was updated to version 0.4 yesterday, and one of the “fixes” in the new version reads “Cleanup of syslog facility”, which to a syslog fan like me is sweet music.

Adding external logging support to AWS

As you know, I like the AWS (Ada Web Server) project a lot, and I have on previous occasions submitted patches to them, when I felt I had a contribution worthwhile bothering the AWS developers with.

This is one such occasion.

Together with a bunch of Ada-DK guys, I’ve started a new business called AdaHeads K/S, and we plan on using AWS heavily, and one of the small “annoyances” we stumbled on, was the fact that AWS could only log it’s activity and error log data to a local file. This is both potentially inefficient under heavy load, and it is a real security issue if the server is compromised, because the attacker then have easy and unlimited access to the log data.

So we really wanted to enable AWS to send its log data to something like syslogd, and as luck would have it, another AdaCore package could help us do just that: GNATColl. This little marvel of a package can talk to syslogd, so now all that was needed was a way to connect AWS to said functionality.

And that’s just what I’ve done. Or rather, I’ve written a patch that gives AWS users the ability to send access and/or error log data to an external procedure. This procedure can then make use of GNATColl’s Traces.Syslog package to handle the log data. Obviously this also opens up the possibility of sending the log data to wherever it might suit a given AWS user. You don’t have to use GNATColl. It’s a very flexible and basic system really. My hope is that even if the AWS developers dismiss my patch, for one reason or another, they’ll at least consider adding the functionality to AWS, because it really is a dealbreaker for the AdaHeads project if AWS can’t do logging to an external service such as syslogd.

We’ll be keeping our fingers crossed.

AWS Can Now Send Emails With Pre-Composed Sources

I got my latest patch to AWS (Ada Web Server) accepted and merged. Thanks Pascal!

So if you clone from the official Git repo, you should now be able to send emails via the AWS email facilities using pre-composed email sources.

This is, in my humble opinion, quite nifty.

I use GNATcoll to compose my emails, and with this patch it is now possible for me to combine these two awesome tools. Yes, life with Ada is good. :o)

Apache Bench To Blame, Not AWS

Some days ago I reported on what appeared to be a problem with the Ada Web Server (AWS) project:

After a lot of testing, it now appears that this specific behavior has nothing to do with AWS, and everything to do with Apache Bench.

I grabbed a copy of the Apache Bench sources, and took a good look at them, and I think I actually managed to track down what looks like a classic race condition. When things are going really fast, Apache Bench can actually start more connections than requested by the -n parameter, and the data returned on these excessive connections are happily added to the accumulated totals by Apache Bench.

At this point it’s probably a good thing to note that my C skills are, at best, pretty bad, which is why I’ve send my speculations to the AWS maillist, where I’m sure some more experienced developers will let me know if I’m wrong or right.

What does support my findings, is that httperf does _not_ exhibit this behavior. Both I and Pascal have not been able to reproduce this problem using httperf.

So at this point, the finger of blame is pointing at Apache Bench.

AWS Bug Confirmed By Pascal Obry

### UPDATE ###

After more tests and a closer look at the ApacheBench sources, we now know that this problem stems from a race condition in ApacheBench.

### END UPDATE ###

The AWS bug I mentioned in my previous post has been confirmed by lead AWS developer Pascal Obry:

Just to let you know that I have been able to reproduce on a fast
GNU/Linux machine.
Feel free to debug that on your side, it will help understanding and
fixing this issue.

Very nice. Now all we have to do is wait for a fix, which I’m sure is right around the corner. The power of open source is amazing!