Thread overview
[Issue 3677] New: null dereference with offset not memory-@safe
Jan 05, 2010
Michel Fortin
Feb 06, 2011
Brad Roberts
Jun 16, 2011
yebblies
January 05, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3677

           Summary: null dereference with offset not memory-@safe
           Product: D
           Version: 2.038
          Platform: x86_64
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: michel.fortin@michelf.com


--- Comment #0 from Michel Fortin <michel.fortin@michelf.com> 2010-01-05 10:11:57 EST ---
This supposedly "safe" program under Mac OS X 10.6 doesn't give any error neither at compile time nor at runtime, yet it isn't memory-safe at all as it corrupts some part of the memory space.

struct S {
    uint[100000] a;
    uint b;
}

S* s = null;

@safe void main() {
    s.b = 1;
}

This happen because the offset for member "b" is very far, allowing it to falls on another memory page which happen to exists.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 06, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=3677


Brad Roberts <braddr@puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Platform|x86_64                      |x86


--- Comment #1 from Brad Roberts <braddr@puremagic.com> 2011-02-06 15:39:03 PST ---
Mass migration of bugs marked as x86-64 to just x86.  The platform run on isn't what's relevant, it's if the app is a 32 or 64 bit app.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 16, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=3677


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies@gmail.com
         Resolution|                            |DUPLICATE


--- Comment #2 from yebblies <yebblies@gmail.com> 2011-06-16 01:04:46 PDT ---
This bug is a subset of issue 5176

*** This issue has been marked as a duplicate of issue 5176 ***

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