RejectedSoftware Forums

Sign up

Pages: 1 2

Re: App crashed with segfault.

On Fri, 13 Mar 2015 11:07:44 GMT, Sönke Ludwig wrote:

I've started a new branch with the required fixes and a test included:

https://github.com/rejectedsoftware/vibe.d/tree/inter_task_fixes

Those fixes won't get into the next release yet, because they required a few deeper changes that need more testing first.

BTW, for proper bi-directional connection close behavior you should add explicit close requests to the forwarding function. See the example for reference: https://github.com/rejectedsoftware/vibe.d/blob/intertaskfixes/tests/tcpproxy/source/app.d#L55>

Thanks for your response,I will review my code.

Re: App crashed with segfault.

On Fri, 13 Mar 2015 11:07:44 GMT, Sönke Ludwig wrote:

I've started a new branch with the required fixes and a test included:

https://github.com/rejectedsoftware/vibe.d/tree/inter_task_fixes

Those fixes won't get into the next release yet, because they required a few deeper changes that need more testing first.

BTW, for proper bi-directional connection close behavior you should add explicit close requests to the forwarding function. See the example for reference: https://github.com/rejectedsoftware/vibe.d/blob/intertaskfixes/tests/tcpproxy/source/app.d#L55>

The runTask method fails to execute tasks when switch to intertaskfixes.

Code in task was not executed.

auto wtask = runTask({
				writeln("sttt.d");
			});

The writeln is not executed.

It will be executed when switching to master.

Re: App crashed with segfault.

Am 16.03.2015 um 08:43 schrieb zhmt:

auto wtask = runTask({

writeln("sttt.d");

});

I've tested with the follwing program and it works as expected, printing
"sttt.d". Can you give a complete failing example?

import vibe.core.core;
import std.stdio;

shared static this()
{
	auto wtask = runTask({
		writeln("sttt.d");
	});
}

Re: App crashed with segfault.

On Mon, 16 Mar 2015 14:02:44 +0100, Sönke Ludwig wrote:

Am 16.03.2015 um 08:43 schrieb zhmt:

auto wtask = runTask({

writeln("sttt.d");

});

I've tested with the follwing program and it works as expected, printing
"sttt.d". Can you give a complete failing example?

import vibe.core.core;
import std.stdio;

shared static this()
{
	auto wtask = runTask({
		writeln("sttt.d");
	});
}
import vibe.core.core;
import std.stdio;

shared static this()
{
	auto wtask = runTask({
		writeln("sttt.d");
	});
	wtask.join();
}

There is join calling in my original code , if I remove the task.join, it works.

But the task.join works well with ~master.
Should I remove task.join?

Re: App crashed with segfault.

On Mon, 16 Mar 2015 14:02:44 +0100, Sönke Ludwig wrote:

Am 16.03.2015 um 08:43 schrieb zhmt:

auto wtask = runTask({

writeln("sttt.d");

});

I've tested with the follwing program and it works as expected, printing
"sttt.d". Can you give a complete failing example?

import vibe.core.core;
import std.stdio;

shared static this()
{
	auto wtask = runTask({
		writeln("sttt.d");
	});
}

I remove task.join, It works very well.

I noticed that a lot of code of have changed 4 days ago, thanks for excellent work of vibe.d .

Re: App crashed with segfault.

Am 16.03.2015 um 20:20 schrieb zhmt:

I remove task.join, It works very well.

I noticed that a lot of code of have changed 4 days ago, thanks for excellent work of vibe.d .

There was indeed an issue when Task.join() was called from outside of
a task. I've fixed that now, so that this works again, too:

shared static this()
{
	auto wtask = runTask({
		writeln("sttt.d");
	});
	wtask.join(); // works now as expected
}

Re: App crashed with segfault.

On Tue, 17 Mar 2015 07:33:16 +0100, Sönke Ludwig wrote:

Am 16.03.2015 um 20:20 schrieb zhmt:

I remove task.join, It works very well.

I noticed that a lot of code of have changed 4 days ago, thanks for excellent work of vibe.d .

There was indeed an issue when Task.join() was called from outside of
a task. I've fixed that now, so that this works again, too:

shared static this()
{
	auto wtask = runTask({
		writeln("sttt.d");
	});
	wtask.join(); // works now as expected
}

OK, Thank you very much.

But I got another problem now, the fixed code works well on mac or linux , but crashes soon on windows, here is the call stack, I hope you can help again, thanks in advance:

Task terminated with unhandled exception: Acquiring reader of already owned connection.
core.exception.AssertError@..\vibe.d-inter_task_fixes\source\vibe\core\drivers\libevent2_tcp.d(373): Acquiring reader of already owned connection.
----------------
0x005557E5 in _d_assert_msg
0x004C5D79 in bool vibe.core.drivers.libevent2_tcp.Libevent2TCPConnection.waitForData(core.time.Duration) at C:\dwork\ezsock\..\vibe.d-inter_task_fixes\source\vibe\core\drivers\libevent2_tcp.d(282)
0x00437258 in int ezsockacount.NetUtil.NetUtil.readSome(vibe.core.net.TCPConnection, ubyte[]) at C:\dwork\ezsock\source\ezsockacount\NetUtil.d(112)
0x0043841E in D12ezsockacount19SpeedLimitForwarder19SpeedLimitForwarder7forwardMFC4vibe4core3net13TCPConnection at C:\dwork\ezsock\source\ezsockacount\SpeedLimitForwarder.d(61)
0x004382E3 in D12ezsockacount19SpeedLimitForwarder19SpeedLimitForwarder10tryForwardMFC4vibe4core3net13TCPConnectionC4vibe4core3net13TCPConnectionZ9__lambda3 at
C:\dwork\ezsock\source\ezsockacount\SpeedLimitForwarder.d(35)
0x00412ADE in void vibe.core.core.makeTaskFuncInfo!(void delegate()).makeTaskFuncInfo(ref void delegate()).callDelegate(vibe.core.core.TaskFuncInfo*) at C:\dwork\ezsock\..\vibe.d-inter_task_fixes\source\vibe\core\core.d(464)
0x00467FE7 in void vibe.core.core.CoreTask.run() at C:\dwork\ezsock\..\vibe.d-inter_task_fixes\source\vibe\core\core.d(967)
0x0056A635 in void core.thread.Fiber.run()
There are still tasks running at exit.

Re: App crashed with segfault.

Am 17.03.2015 um 08:35 schrieb zhmt:

But I got another problem now, the fixed code works well on mac or linux , but crashes soon on windows, here is the call stack, I hope you can help again, thanks in advance:

Task terminated with unhandled exception: Acquiring reader of already owned connection.
core.exception.AssertError@..\vibe.d-inter_task_fixes\source\vibe\core\drivers\libevent2_tcp.d(373): Acquiring reader of already owned connection.
----------------
0x005557E5 in _d_assert_msg
0x004C5D79 in bool vibe.core.drivers.libevent2_tcp.Libevent2TCPConnection.waitForData(core.time.Duration) at C:\dwork\ezsock\..\vibe.d-inter_task_fixes\source\vibe\core\drivers\libevent2_tcp.d(282)
0x00437258 in int ezsockacount.NetUtil.NetUtil.readSome(vibe.core.net.TCPConnection, ubyte[]) at C:\dwork\ezsock\source\ezsockacount\NetUtil.d(112)
0x0043841E in D12ezsockacount19SpeedLimitForwarder19SpeedLimitForwarder7forwardMFC4vibe4core3net13TCPConnection at C:\dwork\ezsock\source\ezsockacount\SpeedLimitForwarder.d(61)
0x004382E3 in D12ezsockacount19SpeedLimitForwarder19SpeedLimitForwarder10tryForwardMFC4vibe4core3net13TCPConnectionC4vibe4core3net13TCPConnectionZ9__lambda3 at
C:\dwork\ezsock\source\ezsockacount\SpeedLimitForwarder.d(35)
0x00412ADE in void vibe.core.core.makeTaskFuncInfo!(void delegate()).makeTaskFuncInfo(ref void delegate()).callDelegate(vibe.core.core.TaskFuncInfo*) at C:\dwork\ezsock\..\vibe.d-inter_task_fixes\source\vibe\core\core.d(464)
0x00467FE7 in void vibe.core.core.CoreTask.run() at C:\dwork\ezsock\..\vibe.d-inter_task_fixes\source\vibe\core\core.d(967)
0x0056A635 in void core.thread.Fiber.run()
There are still tasks running at exit.

Is it possible that the same connection is actually accessed by a
different task concurrently? By looking at the implementation of close()
and waitForData() it doesn't seem possible that the assertion is
triggered when those two are used concurrently, so it would have to be
something else that is responsible.

I'm thinking of adding a Task.name property that gets printed out in
such situations to aid debugging.

Pages: 1 2