RejectedSoftware Forums

Sign up

Task terminated with unhandled exception: Assertion failure

I'm trying to do a simple TCP sever and client in vibe. Quite often when I run my code [1] I get the error in the subject. Here is the full output:

$ dub
Target vibe-d 0.7.21-rc.4 is up to date. Use --force to rebuild.
Target vibetest ~master is up to date. Use --force to rebuild.
Running ./vibe
test
Starting app.Client
Running app.Client
Task terminated with unhandled exception: Assertion failure
core.exception.AssertError@../../../.dub/packages/vibe-d-0.7.21-rc.4/source/vibe/core/core.d(951): Assertion failure
Error executing command run: Program exited with code 1

I'm using:

OS X 10.9.5
DMD 2.066.0
DUB version 0.9.22
vibe-d 0.7.21-rc.4
libevent 2.0.21 from Macports

[1] http://pastebin.com/MsYPDGZG

/Jacob Carlborg

Re: Task terminated with unhandled exception: Assertion failure

On Thu, 30 Oct 2014 07:58:14 GMT, Jacob Carlborg wrote:

I'm trying to do a simple TCP sever and client in vibe. Quite often when I run my code [1] I get the error in the subject. Here is the full output:

[1] http://pastebin.com/MsYPDGZG

/Jacob Carlborg

The calls to join are definitely a problem. IIRC, they will make you yield before the event loop is started (after module ctor).

Usually, when you test both client and server in the same app, you 'just' launch the server (listenTCP/UDP/HTTP is non-blocking), then run the client(s) using setTimer / runTask (example here: https://github.com/rejectedsoftware/vibe.d/blob/master/examples/rest/source/app.d#L332 )

Note: listenTCP/UDP/HTTP is non-blocking.