[Issue 3342] TLS on dynamically loaded DLLs fails on Windows earlier than Vista

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3342

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|2.034   |D2

--


[Issue 3342] TLS on dynamically loaded DLLs fails on Windows earlier than Vista

2010-04-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3342


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #5 from Don clugd...@yahoo.com.au 2010-04-09 19:36:55 PDT ---
Fixed DMD2.042, documentation fixed in 2.043.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3342] TLS on dynamically loaded DLLs fails on Windows earlier than Vista

2010-03-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3342



--- Comment #4 from Rainer Schuetze r.sagita...@gmx.de 2010-03-10 01:32:28 
PST ---
There is a detection whether _tls_index is set and the tls-data-array contains
a valid pointer (thinking about it the latter might be flawed), so this should
cover any situation where the OS did not setup TLS correctly (when loaded at
process init time, TLS is correct on XP, too).

Do you think, that an explicite version check is better? What about
applications that are configured to pretend running under a different windows
version?

As much as I can see, the referenced code contains two things not in the patch:

- it keeps track of used tls-indexes in a bitmap, but XP does not have this.
That's why the patch prevents unloading of the DLL.
- it uses ExReleaseRundownProtection before accessing some TEB data, but this
seems to be an (undocumented) kernel function, and I think we should be safe
with our operations as the nt-loader holds a lock that disallows reentrence
into DllMain

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3342] TLS on dynamically loaded DLLs fails on Windows earlier than Vista

2010-03-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3342



--- Comment #3 from Walter Bright bugzi...@digitalmars.com 2010-03-09 
23:11:09 PST ---
I've been looking at the patch, it's an impressive piece of work!

But I'd like it to detect the Windows version, and not do anything if it is
Vista or newer, as those systems don't have the TLS bug. If we don't do this
check, since the patch relies on undocumented ntdll internals, D apps are
vulnerable to breaking with Windows updates.

Also, skywing has some code to deal with this at
http://www.nynaeve.net/Code/VistaImplicitTls.cpp

Can you check it to see if anything was missed?

Thanks!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3342] TLS on dynamically loaded DLLs fails on Windows earlier than Vista

2010-03-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3342


Rainer Schuetze r.sagita...@gmx.de changed:

   What|Removed |Added

 CC||r.sagita...@gmx.de


--- Comment #2 from Rainer Schuetze r.sagita...@gmx.de 2010-03-06 08:42:18 
PST ---
I've posted a patch for multi-threading support for DLLs here in bug #3885.
This includes a fix for implicite TLS on XP.

It needs to access some global data in ntdll.dll, and the way to get there is
not really obvious, but seems to be valid for all the ntdll-versions I have
found on my system: SP2, one inbetween and SP3.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---