I've been trying to track down a crash in my app.

I am spawning a thread that I want to use to record statistics
information for each request to a MongoDB database. I send it
messages with a struct containing the information to log.

But, it crashes every time on the insert. If I call the exact
same function from the handler thread instead of sending the data
in a message to the logging thread I do not get the crash.

Here are the last few lines from gdb analyzing the core:

#0 0x000000000052f61f in vibe.core.tcp.connectTcp() ()
#1 0x000000000059cda0 in TMP898 ()<br>#2 0x00007ff3a7b1bff0 in ?? ()<br>#3 0x0000000000559165 in gcmalloc ()
#4 0x0000000000542f27 in
vibe.db.mongo.connection.MongoConnection.connect() ()

I modified connectTcp to make sure values were legit:

import std.exception;
import std.string;
auto driver = getEventDriver();
enforce(driver !is null, "Event driver is null.");
enforce(port != 0, "Port shouldn't  be 0.");
enforce(cmp(host, "") != 0, "host shouldn't be emtpy.");
		
return driver.connectTcp(host, port);

Sure enough, the event driver is null:

[7FD19483D4D1:00000000 ERR] Unable to record performance
information for /man. Error was: Event driver is null.

Am I doing something really wrong? Or should I open a bug?

-Dave