{"action":"closed","issue":{"url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/1270","repository_url":"https://api.github.com/repos/rejectedsoftware/vibe.d","labels_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/1270/labels{/name}","comments_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/1270/comments","events_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/1270/events","html_url":"https://github.com/rejectedsoftware/vibe.d/issues/1270","id":107002442,"number":1270,"title":"Assert triggered: Task is already scheduled to be resumed!","user":{"login":"Marenz","id":424752,"avatar_url":"https://avatars.githubusercontent.com/u/424752?v=3","gravatar_id":"","url":"https://api.github.com/users/Marenz","html_url":"https://github.com/Marenz","followers_url":"https://api.github.com/users/Marenz/followers","following_url":"https://api.github.com/users/Marenz/following{/other_user}","gists_url":"https://api.github.com/users/Marenz/gists{/gist_id}","starred_url":"https://api.github.com/users/Marenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marenz/subscriptions","organizations_url":"https://api.github.com/users/Marenz/orgs","repos_url":"https://api.github.com/users/Marenz/repos","events_url":"https://api.github.com/users/Marenz/events{/privacy}","received_events_url":"https://api.github.com/users/Marenz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-09-17T14:50:46Z","updated_at":"2016-03-13T13:07:59Z","closed_at":"2016-03-13T13:07:59Z","body":"I was running a performance and stability test on my server and after a while got this:\r\n\r\n```\r\nTask terminated with unhandled exception: Task is already scheduled to be resumed!\r\nFull error: core.exception.AssertError@../../../.dub/packages/vibe-d-0.7.24/source/vibe/core/core.d(1649): Task is already scheduled to be resumed!\r\n----------------\r\n./masterserver(void vibe.core.core.CoreTaskQueue.insertBack(vibe.core.core.CoreTask)+0x8b) [0x9a41ff]\r\n./masterserver(void vibe.core.core.CoreTask.run()+0x364) [0x9a247c]\r\n./masterserver(void core.thread.Fiber.run()+0x2a) [0xb4554a]\r\n./masterserver(fiber_entryPoint+0x61) [0xb45439]\r\n[(nil)]\r\nError executing command run:\r\nProgram exited with code -11\r\n```\r\n\r\nThis is the gdb backtrace:\r\n\r\n```\r\nProgram terminated with signal SIGSEGV, Segmentation fault.\r\n#0  0x0000000000b4d0c4 in rt.deh_win64_posix.terminate() ()\r\n(gdb) bt\r\n#0  0x0000000000b4d0c4 in rt.deh_win64_posix.terminate() ()\r\n#1  0x0000000000b05090 in _d_throwc ()\r\n#2  0x00000000009a3560 in vibe.core.core.VibeDriverCore.resumeCoreTask(vibe.core.core.CoreTask, Exception) (this=0x7fb3ce77e900, event_exception=0x0, ctask=0x7fb37d1fa400)\r\n    at ../../../.dub/packages/vibe-d-0.7.24/source/vibe/core/core.d:1133\r\n#3  0x00000000009a3396 in vibe.core.core.VibeDriverCore.resumeTask(vibe.core.task.Task, Exception, bool) (this=0x7fb3ce77e900, initial_resume=false, event_exception=0x0, task=...)\r\n    at ../../../.dub/packages/vibe-d-0.7.24/source/vibe/core/core.d:1109\r\n#4  0x00000000009a30c9 in vibe.core.core.VibeDriverCore.resumeTask(vibe.core.task.Task, Exception) (this=0x7fb3ce77e900, event_exception=0x0, task=...)\r\n    at ../../../.dub/packages/vibe-d-0.7.24/source/vibe/core/core.d:1085\r\n#5  0x00000000009b1d5c in onSocketRead (buf_event=0x14396f8, arg=0x1439a90) at ../../../.dub/packages/vibe-d-0.7.24/source/vibe/core/drivers/libevent2_tcp.d:621\r\n#6  0x00007fb3cdf89eea in ?? () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5\r\n#7  0x00007fb3cdf7f254 in event_base_loop () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5\r\n#8  0x00000000009a706b in vibe.core.drivers.libevent2.Libevent2Driver.processEvents() (this=0x7fb3ce77d400) at ../../../.dub/packages/vibe-d-0.7.24/source/vibe/core/drivers/libevent2.d:200\r\n#9  0x00000000009a37a1 in vibe.core.core.VibeDriverCore.notifyIdle() (this=0x7fb3ce77e900) at ../../../.dub/packages/vibe-d-0.7.24/source/vibe/core/core.d:1153\r\n#10 0x00000000009a6f1d in vibe.core.drivers.libevent2.Libevent2Driver.runEventLoop() (this=0x7fb3ce77d400) at ../../../.dub/packages/vibe-d-0.7.24/source/vibe/core/drivers/libevent2.d:183\r\n#11 0x00000000009a1b4d in vibe.core.core.runEventLoop() () at ../../../.dub/packages/vibe-d-0.7.24/source/vibe/core/core.d:97\r\n#12 0x000000000095abe7 in D main () at ../../../.dub/packages/vibe-d-0.7.24/source/vibe/appmain.d:66\r\n```\r\n\r\nThe error might be related to code change I did, which was that I changed\r\n\r\n```\r\n        while(conn.connected)\r\n        {\r\n            bool filterMessage ( std.variant.Variant msg )\r\n            {\r\n                return true;\r\n            }\r\n\r\n            void handleMessage ( std.variant.Variant msg )\r\n            {\r\n                auto data = msg.get!(ubyte[])();\r\n\r\n                conn.write(data);\r\n                conn.flush();\r\n            }\r\n\r\n            Task.getThis().messageQueue.receiveTimeout(dur!\"seconds\"(1),\r\n                    &filterMessage, &handleMessage);\r\n        }\r\n```\r\n\r\nto\r\n\r\n```\r\n        while ( conn.connected )\r\n        {\r\n            if (client_context.pipe.waitForData(dur!\"seconds\"(1)))\r\n                conn.write(client_context.pipe);\r\n        }\r\n```\r\n\r\nBasically, previously I was communicating with my Writing Fiber Task using the messageQueue and I changed that to use a `TaskPipe`.\r\n\r\nI saved the core dump and binary in case you need some info from that core dump."}}