digitalmars.D.bugs - [Issue 5485] New: TLS sections handled incorrectly
- d-bugmail puremagic.com (24/24) Jan 25 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5485
- d-bugmail puremagic.com (12/12) Jan 25 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5485
- d-bugmail puremagic.com (41/41) Jan 25 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5485
- d-bugmail puremagic.com (10/10) Jan 26 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5485
- d-bugmail puremagic.com (19/19) Jan 26 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5485
- d-bugmail puremagic.com (11/11) Feb 20 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5485
- d-bugmail puremagic.com (11/11) Feb 20 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5485
http://d.puremagic.com/issues/show_bug.cgi?id=5485 Summary: TLS sections handled incorrectly Product: D Version: D2 Platform: Other OS/Version: FreeBSD Status: NEW Severity: normal Priority: P2 Component: druntime AssignedTo: nobody puremagic.com ReportedBy: dawg dawgfoto.de --- Comment #0 from dawg dawgfoto.de 2011-01-25 11:53:08 PST --- Created an attachment (id=879) git format-patch In src/core/thread.d: _tlsstart/_tlsend should be handled same as for linux elf. - extern void* _tlsstart; - extern void* _tlsend; + extern __thread int _tlsstart; + extern __thread int _tlsend; -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 25 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5485 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla digitalmars.com Resolution| |INVALID --- Comment #1 from Walter Bright <bugzilla 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: -------
Jan 25 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5485 Brad Roberts <braddr puremagic.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED CC| |braddr puremagic.com Resolution|INVALID | --- Comment #2 from Brad Roberts <braddr 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: -------
Jan 25 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5485 --- Comment #3 from dawg 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: -------
Jan 26 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5485 Steven Schveighoffer <schveiguy yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |schveiguy yahoo.com --- Comment #4 from Steven Schveighoffer <schveiguy 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: -------
Jan 26 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5485 Brad Roberts <braddr 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: -------
Feb 20 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5485 Brad Roberts <braddr puremagic.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED --- Comment #5 from Brad Roberts <braddr 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: -------
Feb 20 2011