You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This problem occurs during shutting down the application after calling theScheduler.shutdown and causes the app to SEGFAULT. Note that it is tested in D2 only.
#0 0x000000000065c7bc in _D5ocean4task4TaskQf9suspendedMFZb (this=0x0) at ./submodules/ocean/src/ocean/task/Task.d:399
#1 0x0000000000696245 in _D5ocean4task9SchedulerQk5awaitMFCQBgQBd4TaskQfMDFQrZvZ9__lambda3MFZv (this=0x7f49a3e4ecd8)
at ./submodules/ocean/src/ocean/task/Scheduler.d:412
#2 0x000000000065cb8f in _D5ocean4task4TaskQf10entryPointMFZb (this=0x7f499f966d00) at ./submodules/ocean/src/ocean/task/Task.d:489
#3 0x00000000005f247d in _D5ocean4task8internal18FiberPoolWithQueueQu17workerFiberMethodMFZ7runTaskMFZv (this=0x7f4998325f88)
at ./submodules/ocean/src/ocean/task/internal/FiberPoolWithQueue.d:175
#4 0x00000000005f23ba in _D5ocean4task8internal18FiberPoolWithQueueQu17workerFiberMethodMFZv (this=0x7f49a3e58e00)
at ./submodules/ocean/src/ocean/task/internal/FiberPoolWithQueue.d:189
#5 0x00000000006d3848 in core.thread.Fiber.run() (this=0x7f499f965a00) at src/core/thread.d:4389
#6 0x00000000006d3717 in fiber_entryPoint () at src/core/thread.d:3626
#7 0x0000000000000000 in ?? ()
Exchanging the delegate with a closure as follows fixes the problem but seems not to be a reasonable solution.
auto cl = {
if (context.suspended())
theScheduler.delayedResume(context);
};
// this methods stack is guaranteed to still be valid by the time
// task finishes, so we can reference `task` from delegate
task.terminationHook(cl);
The text was updated successfully, but these errors were encountered:
Both are clojsures, so the code should be the same.
Are they ? I see this code and d1to2fix should stick a scope there, which makes any direct call to not GC-allocate the context.
So the code with auto will GC-allocate, while passing the dg directly will not GC-allocate, but run into the problem you mentioned. That might be by design though.
If you turn the auto into scope the problem should manifest itself again.
This problem occurs during shutting down the application after calling
theScheduler.shutdown
and causes the app to SEGFAULT. Note that it is tested in D2 only.It seems that in at least one case the
context
variable is not valid when accessed from the delegate.https://github.com/sociomantic-tsunami/ocean/blob/v4.x.x/src/ocean/task/Scheduler.d#L430
Here is the stacktrace:
Exchanging the delegate with a closure as follows fixes the problem but seems not to be a reasonable solution.
The text was updated successfully, but these errors were encountered: