New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task terminated with unhandled exception: null this #1354

Closed
9il opened this Issue Dec 17, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@9il
Contributor

9il commented Dec 17, 2015

Code:

import vibe.core.core;
import vibe.core.log;
import vibe.http.server;
import vibe.http.websockets;

shared static this()
{
    auto settings = new HTTPServerSettings;
    // 10k + issue number -> Avoid bind errors
    settings.port = 11332;
    settings.bindAddresses = ["::1", "127.0.0.1"];
    listenHTTP(settings, handleWebSockets((scope ws) {
        //assert(ws.receiveText() == "foo");
        //ws.send(null, FrameOpcode.ping);
        ws.send("hello");
        // assert(ws.receiveText() == "bar");
        ws.close();
    }));

    runTask({
        scope(exit) exitEventLoop(true);

        connectWebSocket(URL("http://127.0.0.1:11332/local_log"), (scope ws) {
            //ws.send("foo");
            //ws.send(null, FrameOpcode.ping);
            assert(ws.receiveText() == "hello");
            //ws.send("bar");
            assert(!ws.waitForData);
            ws.close();
            logInfo("WebSocket test successful");
        });
    });
}

Log:

dub
Performing "debug" build using dmd for x86_64.
vibe-d:utils 0.7.27-alpha.2+commit.48.ge35b213: target for configuration "library" is up to date.
vibe-d:data 0.7.27-alpha.2+commit.48.ge35b213: target for configuration "library" is up to date.
vibe-d:core 0.7.27-alpha.2+commit.48.ge35b213: target for configuration "libevent" is up to date.
vibe-d:http 0.7.27-alpha.2+commit.48.ge35b213: target for configuration "library" is up to date.
1332 ~master: target for configuration "application" is up to date.
To force a rebuild of up-to-date targets, run again with --force.
Running ./1332 
Listening for requests on http://::1:11332
Listening for requests on http://127.0.0.1:11332
Task terminated with unhandled exception: null this
Task terminated with unhandled exception: null this
core.exception.AssertError@../../source/vibe/core/sync.d(360): null this
----------------
4   1332                                0x0000000101f3920e _d_assert_msg + 142
5   1332                                0x0000000101ed720d @safe void vibe.core.sync.InterruptibleTaskMutex.lock() + 73
6   1332                                0x0000000101e85a91 void vibe.core.sync.performLocked!(_D4vibe4http10websockets9WebSocket11startReaderMFZ9__lambda6MFZv, vibe.core.sync.InterruptibleTaskMutex).performLocked(vibe.core.sync.InterruptibleTaskMutex) + 33
7   1332                                0x0000000101e84123 void vibe.http.websockets.WebSocket.startReader() + 723
8   1332                                0x0000000101df2773 void vibe.core.core.makeTaskFuncInfo!(void delegate()).makeTaskFuncInfo(ref void delegate()).callDelegate(vibe.core.core.TaskFuncInfo*) + 119
9   1332                                0x0000000101ea561a void vibe.core.core.CoreTask.run() + 294
10  1332                                0x0000000101f3cc37 void core.thread.Fiber.run() + 43
11  1332                                0x0000000101f3c670 fiber_entryPoint + 108
12  ???                                 0xffffffffffffffff 0x0 + 18446744073709551615
core.exception.AssertError@../../source/vibe/core/sync.d(620): null this
----------------
4   1332                                0x0000000101f3920e _d_assert_msg + 142
5   1332                                0x0000000101ed7abd void vibe.core.sync.InterruptibleTaskCondition.notifyAll() + 73
6   1332                                0x0000000101e841be void vibe.http.websockets.WebSocket.startReader() + 878
7   1332                                0x0000000101df2773 void vibe.core.core.makeTaskFuncInfo!(void delegate()).makeTaskFuncInfo(ref void delegate()).callDelegate(vibe.core.core.TaskFuncInfo*) + 119
8   1332                                0x0000000101ea561a void vibe.core.core.CoreTask.run() + 294
9   1332                                0x0000000101f3cc37 void core.thread.Fiber.run() + 43
10  1332                                0x0000000101f3c670 fiber_entryPoint + 108
11  ???                                 0xffffffffffffffff 0x0 + 18446744073709551615

9il added a commit to 9il/vibe.d that referenced this issue Dec 17, 2015

@9il 9il referenced this issue Dec 17, 2015

Closed

Fix #1354 #1355

9il added a commit to 9il/vibe.d that referenced this issue Dec 17, 2015

@s-ludwig s-ludwig closed this in b6ec16c Dec 18, 2015

s-ludwig added a commit that referenced this issue Dec 18, 2015

Merge pull request #1356 from 9il/patch-4
Fix high-level race-conditions in WebSocket's initialization code. Fixes #1354.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment