Runtime error when accessing static data in a DLL

Don nospam at nospam.com
Sat Dec 26 17:17:41 PST 2009


Phil Deets wrote:
> On Thu, 24 Dec 2009 13:10:14 -0500, Phil Deets <pjdeets2 at gmail.com> wrote:
> 
>> On Thu, 24 Dec 2009 12:49:42 -0500, Richard Webb 
>> <webby at beardmouse.org.uk> wrote:
>>
>>> Sounds like you might be running into this:
>>> http://d.puremagic.com/issues/show_bug.cgi?id=3342
>>
>> Thanks for the link. That is probably my problem since I'm running 
>> Windows XP.
>>
>> Phil
> 
> I'm quite confident now that this is the issue. I added my vote to the 
> bug.

Yes, it's the most serious bug in Bugzilla. (It's quite appalling that 
such a terrible bug has existed in Windows for so long). I wish we had a 
solution to this. I guess we could replace all uses of implicit TLS with 
a Windows function call -- it'd be slow, but it ought to work.


  Does anybody know how much the runtime uses TLS? I'm thinking about
> the possibility of adding __gshared to all its static data.
> 
> An alternative workaround would be to install Vista or 7, but although I 
> do have a legal Vista install disk, I would prefer an upgrade since I 
> don't want to reinstall all my programs. Also, my computer barely meets 
> Vista's minimum requirements.


> 
> I also might be able to rewrite lua.exe in D and preload my code in the 
> executable. Most of Lua's functionality is in a library which would not 
> need to be rewritten so this might be feasible.


More information about the Digitalmars-d-learn mailing list