node.js and sqlite3 web app, corrupted unsorted chunks : /

I am new to node and am trying it out on my raspberry pi. I have installed the latest version (http://nodejs.org/dist/v0.9.9/node-v0.9.9-linux-arm-pi.tar.gz)

and npm installed sqlite3 (made and installed too)

I am now trying to run the following code:

var http    = require("http");
var sqlite3 = require("sqlite3").verbose();
var port    = 1337;
var ip  = "192.168.2.15";

http.createServer(function (req, res) {
    res.writeHead(200, {"Content-Type": "text/plain"});

    var db = new sqlite3.Database(":memory:");

    db.serialize(function() {
        db.run("CREATE TABLE lorem (info TEXT)");
        console.log("CREATE");
        var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
        for (var i = 0; i < 10; i++) {
            stmt.run("Ipsum " + i);
        }
        stmt.finalize();
        console.log("START SELECT [");
        db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {
            console.log(row.id + ": " + row.info);
        });
        console.log("] END SELECT");
    });
    console.log("CLOSE");

    db.close();

    res.end("Hello World.");

}).listen(port, ip);

console.log("Server running at http://" + ip + ":" + port);

The output I get is:

Server running at http://192.168.2.15:1337
CREATE
START SELECT [
] END SELECT
CLOSE
1: Ipsum 0
2: Ipsum 1
3: Ipsum 2
4: Ipsum 3
5: Ipsum 4
6: Ipsum 5
7: Ipsum 6
8: Ipsum 7
9: Ipsum 8
10: Ipsum 9
*** glibc detected *** node: free(): corrupted unsorted chunks: 0x0072fe28 ***
Aborted

My assumptions are that ether I have a race condition even though I am using db.serialize or this is not going to work on the pi (although sqlite3 did compile okay)

Thanks

I recently encountered this issue. I realized I was not using a stable/recommended version of node.js. Resolved by downgrading to 0.8.15