[Issue 5485] TLS sections handled incorrectly

2011-02-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5485


Brad Roberts bra...@puremagic.com changed:

   What|Removed |Added

Attachment #879|application/octet-stream|text/plain
  mime type||
 Attachment #879 is|0   |1
  patch||


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


[Issue 5485] TLS sections handled incorrectly

2011-02-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5485


Brad Roberts bra...@puremagic.com changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED


--- Comment #5 from Brad Roberts bra...@puremagic.com 2011-02-20 01:23:27 PST 
---
https://github.com/D-Programming-Language/druntime/commit/7d46be0ee4ba4a59a39f99d92756685c7452bcc8

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


[Issue 5485] TLS sections handled incorrectly

2011-01-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5485



--- Comment #3 from d...@dawgfoto.de 2011-01-26 06:43:37 PST ---
Sorry, shouldn't have cited only part of the patch.
The important difference is in void[] thread_getTLSBlock().
_tlsstart/_tlsend are used directly as pointers to the TLS section.
But instead the address of the symbols should be taken.
Please have a look at the attachment and things should be clear.

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


[Issue 5485] TLS sections handled incorrectly

2011-01-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5485


Steven Schveighoffer schvei...@yahoo.com changed:

   What|Removed |Added

 CC||schvei...@yahoo.com


--- Comment #4 from Steven Schveighoffer schvei...@yahoo.com 2011-01-26 
07:08:53 PST ---
Sorry, that thread_getTLSBlock function was mine (used to prune the LRU cache
for array appending during a collection cycle).  I misinterpreted the
difference between _tlsstart/_tlsend in FreeBSD being a pointer meaning that it
points to where tls starts/ends.  I never tested it, since I don't have a
FreeBSD system.

I think the patch should be applied.  It won't affect anything other than the
thread_getTLSBlock function, as the code that assigns the Thread.m_tls member
already correctly uses the address of the _tlsstart and _tlsend to determine
the block, not the values as I have done.

I'd apply the patch, but I have yet to take the time to learn git.

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


[Issue 5485] TLS sections handled incorrectly

2011-01-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5485


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||INVALID


--- Comment #1 from Walter Bright bugzi...@digitalmars.com 2011-01-25 
17:09:58 PST ---
__thread is the default for D2, so this patch doesn't do anything.

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


[Issue 5485] TLS sections handled incorrectly

2011-01-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5485


Brad Roberts bra...@puremagic.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 CC||bra...@puremagic.com
 Resolution|INVALID |


--- Comment #2 from Brad Roberts bra...@puremagic.com 2011-01-25 18:59:51 PST 
---
So, the obvious follow up here is that the existing __thread parts from the
other _tlsstart and _tlsend declarations should be yanked as pointless:

diff --git a/src/core/thread.d b/src/core/thread.d
index a317306..911efb3 100644
--- a/src/core/thread.d
+++ b/src/core/thread.d
@@ -130,8 +130,8 @@ version( Windows )
 //   these are defined in dm\src\win32\tlsseg.asm by DMC.
 extern (C)
 {
-extern __thread int _tlsstart;
-extern __thread int _tlsend;
+extern int _tlsstart;
+extern int _tlsend;
 }
 }
 else
@@ -251,8 +251,8 @@ else version( Posix )
 {
 extern (C)
 {
-extern __thread int _tlsstart;
-extern __thread int _tlsend;
+extern int _tlsstart;
+extern int _tlsend;
 }
 }
 else version( OSX )

Also, how about the int vs void* difference?  From the look of the usage
pattern, it probably doesn't matter, but it does stand out as a difference.

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