www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9144] New: synchronized CRITSECSIZE should be a target constant

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9144

           Summary: synchronized CRITSECSIZE should be a target constant
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dawg dawgfoto.de



In statement.c the compiler defines CRITSECSIZE to be the size of a critical
section. This is done using the HOST system headers and sizeof. During cross
compilation this may lead to memory corruptions when the size of a critical
section is smaller on the host system than it is on the target.

This is already the case for Linux 32/64 (32 vs. 40 byte).
I found this bug by tracking down a memory corruption using a mipsel-linux-gdc
cross compiler.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 11 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9144


Iain Buclaw <ibuclaw ubuntu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw ubuntu.com



Speaking of target constants.  There should be target hooks for this sort of
stuff to allow different backends to implement their own value.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 11 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9144




There should be target hooks
Yeah there should be hooks for target constants. For this I think we should expose a critical section struct through the druntime/compiler interface. It's effectively a runtime issue to do the locking so it should choose the means. I'll prepare a pull request. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 11 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9144


Martin Nowak <code dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



https://github.com/D-Programming-Language/dmd/pull/2060
https://github.com/D-Programming-Language/dmd/commit/f8669e6c38d5e03757aeabe2a29a8e76d75c7baf

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