digitalmars.D.bugs - [Issue 6629] New: std.conv.emplace: enforcement is too weak
- d-bugmail puremagic.com (28/28) Sep 08 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6629
- d-bugmail puremagic.com (6/6) Sep 08 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6629
- d-bugmail puremagic.com (12/12) Sep 09 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6629
- d-bugmail puremagic.com (13/15) Sep 09 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6629
http://d.puremagic.com/issues/show_bug.cgi?id=6629 Summary: std.conv.emplace: enforcement is too weak Product: D Version: D2 Platform: Other OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nobody puremagic.com ReportedBy: timon.gehr gmx.ch --- Comment #0 from timon.gehr gmx.ch 2011-09-08 15:35:28 PDT --- T emplace(T, Args...)(void[] chunk, Args args) if (is(T == class)) { enforce(chunk.length >= __traits(classInstanceSize, T), new ConvException("emplace: chunk size too small")); auto a = cast(size_t) chunk.ptr; enforce(a % T.alignof == 0, text(a, " vs. ", T.alignof)); ... } T.alignof is the alignment of the class reference, not the class instance. Classes have to be 16-byte aligned, but the enforcement checks only for 4 byte alignment. This results in segmentation faults in user code, even though the function performs checks. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 08 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6629 --- Comment #1 from timon.gehr gmx.ch 2011-09-08 15:58:32 PDT --- https://github.com/D-Programming-Language/phobos/pull/249 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 08 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6629 timon.gehr gmx.ch changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID --- Comment #2 from timon.gehr gmx.ch 2011-09-09 05:04:22 PDT --- The enforcement was actually correct, since apparently alignment of size_t.sizeof is enough. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 09 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6629 timon.gehr gmx.ch changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |FIXED --- Comment #3 from timon.gehr gmx.ch 2011-09-09 05:53:08 PDT --- (In reply to comment #2)The enforcement was actually correct, since apparently alignment of size_t.sizeof is enough.It is actually too weak, but enforcing 16-byte alignment is not the correct solution either, see new try at http://d.puremagic.com/issues/show_bug.cgi?id=6635 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 09 2011