RejectedSoftware Forums

Sign up

watchDirectory()

I am getting the following error calling watchDirectory for the following program. On mac osx mavericks. Any help is appreciated, thanks.

The log output

starting watch
CoreTaskFiber was terminated unexpectedly: Assertion failure

Here is the program

import vibe.d;

shared static this()
{

runTask({
	logInfo("starting watch");
	auto dw = watchDirectory("/Users/glen/_a/");
	logInfo("watching");
});

}

Re: watchDirectory()

Okay I admit I am a markdown newb. Here is the relevant info using properly formatted markdown

{
import vibe.d;

shared static this()
{
runTask({
logInfo("starting watch");
auto dw = watchDirectory("/Users/glen/_a/");
logInfo("watching");
});
}
}

The log output is

{
starting watch
CoreTaskFiber was terminated unexpectedly: Assertion failure
}

Re: watchDirectory()

Okay I admit I am a markdown newb. Here is the relevant info using properly formatted markdown

import vibe.d;
shared static this()
{
	runTask({
		logInfo("starting watch");
		auto dw = watchDirectory("/Users/glen/_a/");
		logInfo("watching");
	});
}


The log output is

starting watch
CoreTaskFiber was terminated unexpectedly: Assertion failure

Re: watchDirectory()

On Mon, 10 Feb 2014 10:01:16 GMT, Glen Marchesani wrote:

Okay I admit I am a markdown newb. Here is the relevant info using properly formatted markdown

import vibe.d;
shared static this()
{
	runTask({
		logInfo("starting watch");
		auto dw = watchDirectory("/Users/glen/_a/");
		logInfo("watching");
	});
}


The log output is

starting watch
CoreTaskFiber was terminated unexpectedly: Assertion failure


try to run you program with all logging enabled (i think --vvv) to get more info

Re: watchDirectory()

Thanks, here is the output. Note I noticed the event loop hadn't started before the call to watchDirectory failed. So I added a sleep for 10 seconds before the failing call to watchDirectory. It still failed but now with a full stack trace.

[09ED2E01:00000000 dbg] Create FreeListAlloc 8
[09ED2E01:00000000 dbg] Create FreeListAlloc 16
[09ED2E01:00000000 dbg] Create FreeListAlloc 32
[09ED2E01:00000000 dbg] Create FreeListAlloc 64
[09ED2E01:00000000 dbg] Create FreeListAlloc 128
[09ED2E01:00000000 dbg] Create FreeListAlloc 256
[09ED2E01:00000000 dbg] Create FreeListAlloc 512
[09ED2E01:00000000 dbg] Create FreeListAlloc 1024
[09ED2E01:00000000 dbg] Create FreeListAlloc 2048
[09ED2E01:00000000 dbg] Create FreeListAlloc 65540
[09ED2E01:00000000 dia] libevent version: 2.0.21-stable
[09ED2E01:00000000 dia] libevent is using kqueue for events.
[09ED2E01:00000000 dbg] Initializing OpenSSL...
[09ED2E01:00000000 dbg] ... done.
[09ED2E01:00000000 dbg] Creating new fiber...
sleeping for 10 seconds
[09ED2E01:00000000 dia] Running event loop...
starting watch
[09ED2E01:09ED5F01 CRITICAL] CoreTaskFiber was terminated unexpectedly: Assertion failure
[09ED2E01:09ED5F01 dia] Full error: core.exception.AssertError@vibe.core.drivers.libevent2(176): Assertion failure
[09ED2E01:09ED5F01 dia] ----------------
[09ED2E01:09ED5F01 dia] 5   my_vibe_project                     0x000000010979b136 _d_assertm + 38
[09ED2E01:09ED5F01 dia] 6   my_vibe_project                     0x0000000109657c5a void vibe.core.drivers.libevent2.__assert(int) + 26
[09ED2E01:09ED5F01 dia] 7   my_vibe_project                     0x00000001096d7967 vibe.core.file.DirectoryWatcher vibe.core.drivers.libevent2.Libevent2Driver.watchDirectory(vibe.inet.path.Path, bool) + 99
[09ED2E01:09ED5F01 dia] 8   my_vibe_project                     0x00000001096e357d vibe.core.file.DirectoryWatcher vibe.core.file.watchDirectory(vibe.inet.path.Path, bool) + 57
[09ED2E01:09ED5F01 dia] 9   my_vibe_project                     0x00000001096e35e2 vibe.core.file.DirectoryWatcher vibe.core.file.watchDirectory(immutable(char)[], bool) + 94
[09ED2E01:09ED5F01 dia] 10  my_vibe_project                     0x0000000109659009 void app._sharedStaticCtor1().__lambda1() + 125
[09ED2E01:09ED5F01 dia] 11  my_vibe_project                     0x00000001096d0cbf void vibe.core.core.CoreTask.run() + 251
[09ED2E01:09ED5F01 dia] 12  my_vibe_project                     0x000000010979e191 void core.thread.Fiber.run() + 49
[09ED2E01:09ED5F01 dia] 13  my_vibe_project                     0x000000010979dd3a fiber_entryPoint + 98
[09ED2E01:09ED5F01 dia] 14  ???                                 0x0000000000000000 0x0 + 0



Re: watchDirectory()

Am 10.02.2014 16:32, schrieb Glen Marchesani:

Thanks, here is the output. Note I noticed the event loop hadn't started before the call to watchDirectory failed. So I added a sleep for 10 seconds before the failing call to watchDirectory. It still failed but now with a full stack trace.

(...)


The reason is that watchDirectory unfortunately isn't implemented yet
for the libevent driver. I've added a proper message to the assertion now.

I'll need this feature in the mid term, so if nobody beats me to it, it
will be scheduled for the next version (0.7.20).

Re: watchDirectory()

Thanks for the quick response. That certainly explains the issue.

Also thanks for making this project possible. I am really excited at the possibilities to build first class async io based apps without having to play the deeply nested event handlers game.