digitalmars.D - What wrong?
- Fyodor Ustinov (13/13) May 04 2015 Simple code:
- Daniel =?UTF-8?B?S296w6Fr?= via Digitalmars-d (5/23) May 04 2015 I think it is releted with this chage:
- anonymous (31/44) May 04 2015 Reduced it a little:
- Fyodor Ustinov (21/44) May 04 2015 ~this() {
- anonymous (5/18) May 15 2015 I investigated this further. std.variant is to blame. I filed an
Simple code: http://pastebin.com/raw.php?i=7jVeMFXQ This code works compiled by DMD v2.066.1 and LDC2 (0.15.1) based on DMD v2.066.1 and LLVM 3.5.0. $ ./z TUQLUE 42 11 Compiled by DMD v2.067.1 the program crashes: $ ./aa TUQLUE Segmentation fault What I'm doing wrong?
May 04 2015
On Mon, 04 May 2015 08:48:45 +0000 Fyodor Ustinov via Digitalmars-d <digitalmars-d puremagic.com> wrote:Simple code: http://pastebin.com/raw.php?i=7jVeMFXQ This code works compiled by DMD v2.066.1 and LDC2 (0.15.1) based on DMD v2.066.1 and LLVM 3.5.0. $ ./z TUQLUE 42 11 Compiled by DMD v2.067.1 the program crashes: $ ./aa TUQLUE Segmentation fault What I'm doing wrong?I think it is releted with this chage: http://dlang.org/changelog.html#heap-struct-destructors So your code has been probably wrong before, but accidentally works
May 04 2015
On Monday, 4 May 2015 at 08:48:47 UTC, Fyodor Ustinov wrote:Simple code: http://pastebin.com/raw.php?i=7jVeMFXQ This code works compiled by DMD v2.066.1 and LDC2 (0.15.1) based on DMD v2.066.1 and LLVM 3.5.0. $ ./z TUQLUE 42 11 Compiled by DMD v2.067.1 the program crashes: $ ./aa TUQLUE Segmentation fault What I'm doing wrong?Reduced it a little: ---- module z; import std.stdio; import std.concurrency; import core.thread; struct Variant { void function() fptr = &handler; static void handler() {} ~this() { fptr(); } } void _get(Tid id) { id.send(Variant()); } void supervisor() { receive(&_get); } void main() { Tid supervisorTid = spawn(&supervisor); supervisorTid.send(thisTid); writeln("TUQLUE"); receive( (Variant a) {} ); writeln("42"); thread_joinAll(); } ----
May 04 2015
On Monday, 4 May 2015 at 12:19:27 UTC, anonymous wrote:On Monday, 4 May 2015 at 08:48:47 UTC, Fyodor Ustinov wrote:Simple code: http://pastebin.com/raw.php?i=7jVeMFXQ This code works compiled by DMD v2.066.1 and LDC2 (0.15.1) based on DMD v2.066.1 and LLVM 3.5.0. $ ./z TUQLUE 42 11 Compiled by DMD v2.067.1 the program crashes: $ ./aa TUQLUE Segmentation fault What I'm doing wrong?~this() { fptr(); }~this() { writeln(fptr); fptr(); } $ ./aa TUQLUE 464E70 464E70 464E70 464E70 464E70 464E70 464E70 464E70 464E70 464E70 464E70 6C2AD0 Segmentation fault OMG.
May 04 2015
On Monday, 4 May 2015 at 08:48:47 UTC, Fyodor Ustinov wrote:Simple code: http://pastebin.com/raw.php?i=7jVeMFXQ This code works compiled by DMD v2.066.1 and LDC2 (0.15.1) based on DMD v2.066.1 and LLVM 3.5.0. $ ./z TUQLUE 42 11 Compiled by DMD v2.067.1 the program crashes: $ ./aa TUQLUE Segmentation fault What I'm doing wrong?I investigated this further. std.variant is to blame. I filed an issue an made a pull request to fix it: https://issues.dlang.org/show_bug.cgi?id=14585 https://github.com/D-Programming-Language/phobos/pull/3284
May 15 2015