On Fri, 19 Nov 2010 01:49:30 -0500, Steve Teale <[email protected]> wrote:


As I said before, I don't know if the thread being created by the
windows service procedure is properly initializing the D modules of the
library/runtime.  Try as the first line of ServiceMain to initialize the
current thread:

auto mythread = thread_attachThis();

see http://www.digitalmars.com/d/2.0/phobos/core_thread.html

-Steve

Steve,

I don't think it gets as far as ServiceMain. Anyway, I tried it there,
and at the point just before the first WINAPI call, but it still crashes.

I can fix it, by making my statically initialized RegExp objects __gshared
or immutable, but the latter involves inserting a slew of tedious casts
into my XML parser, since RexExp calls are used all over the place.

See my separate post for my thoughts on that.

OK, I'm out of ideas, sorry :(

It certainly looks like there is an issue with TLS. I wouldn't suggest band-aiding things how you are doing, because some modules in phobos/druntime use TLS also. It's reasonable to assume that if your uses of TLS are failing, those may fail as well.

-Steve

Reply via email to