[Issue 12839] std.parallelism with nested functions and lambdas. Segfault

2018-06-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12839

RazvanN  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |FIXED

--- Comment #7 from RazvanN  ---
All the examples in this bug report now compile successfully. However, Issue
16051 is still valid. Closing as fixed.

--


[Issue 12839] std.parallelism with nested functions and lambdas. Segfault

2016-05-21 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12839

--- Comment #6 from Lars T. Kyllingstad  ---
See also issue #16051, which deals with the same ICE.  Not sure if it's a
duplicate, though.

--


[Issue 12839] std.parallelism with nested functions and lambdas. Segfault

2016-05-21 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12839

Lars T. Kyllingstad  changed:

   What|Removed |Added

 CC||bugzi...@kyllingen.net

--


[Issue 12839] std.parallelism with nested functions and lambdas. Segfault

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12839

Andrei Alexandrescu  changed:

   What|Removed |Added

Version|unspecified |D2

--


[Issue 12839] std.parallelism with nested functions and lambdas. Segfault

2015-05-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12839

--- Comment #5 from Maxim Fomin  ---
Now it gives ice. 

auto loo(int a)
{
auto inner()
{
return a; // debugger caught SEGV at this line
}

return () => () => inner();
}

void main()
{
assert(loo(3)()() == 3);
}

DMD v2.068-devel-df9b8af-dirty DEBUG
dmd: toir.c:183: elem* getEthis(Loc, IRState*, Dsymbol*): Assertion
`thisfd->isNested() || thisfd->vthis' failed.
Aborted

--


[Issue 12839] std.parallelism with nested functions and lambdas. Segfault

2015-01-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12839

sinkuup...@gmail.com changed:

   What|Removed |Added

 CC||sinkuup...@gmail.com
  Component|Phobos  |DMD

--- Comment #4 from sinkuup...@gmail.com ---
Even replacing "taskPool.amap" with "map!"a()".array", it still segfaults.


import std.algorithm;
import std.array;

auto loo(int a, int[] b)
{
auto inner(int c)
{
return a; // debugger caught SEGV at this line
}
return b.map!((x) => () => inner(x));
}

void main()
{
auto res = loo(3, [1,2,3]);
auto jobs = map!"a()"(res).array; // evaluate eagerly
}


I reduced 'map' version, and found that just returning "() => () => inner()"
and calling it segfaults. IIUC this seems a compiler bug.


auto loo(int a)
{
auto inner()
{
return a; // debugger caught SEGV at this line
}

return () => () => inner();
}

void main()
{
assert(loo(3)()() == 3);
}

--


[Issue 12839] std.parallelism with nested functions and lambdas. Segfault

2014-08-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12839

Maxim Fomin  changed:

   What|Removed |Added

 CC||maxim-fo...@outlook.com
 OS|Linux   |All

--- Comment #3 from Maxim Fomin  ---
Fails on win64 too.

--


[Issue 12839] std.parallelism with nested functions and lambdas. Segfault

2014-06-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12839

--- Comment #2 from John Colvin  ---
sorry, ignore the () on jobs.front

--


[Issue 12839] std.parallelism with nested functions and lambdas. Segfault

2014-06-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12839

--- Comment #1 from John Colvin  ---
Interestingly, the following works fine. It should be the same as the
lambda-based version, no?

import std.parallelism;
import std.algorithm;

auto loo(int a, int[] b)
{
auto inner(int c)
{
return a;
}
auto wrapper(int x)
{
auto wrapperInner()
{
return inner(x);
}
return &wrapperInner;
}
return b.map!wrapper;
}

void main()
{
defaultPoolThreads = 1;
auto res = loo(3, [1,2,3]);
auto jobs = taskPool.map!"a()"(res);
assert(jobs.front() == 3);
}

--