Skip to content
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

AssertError: eventcore/drivers/posix/driver.d(243): Overwriting notification callback #56

Closed
Abscissa opened this issue Mar 8, 2018 · 2 comments

Comments

@Abscissa
Copy link

Abscissa commented Mar 8, 2018

I received a bug report over at mysql-native that I've tracked down to an assert failure in eventcore. It wasn't clear at first because there's another mysql-native issue that was covering up this assert failure during stack unwinding.

To reproduce:

  1. Use the test case provided in the original post here

  2. Edit mysql-native's source/mysql/protocol/sockets.d and comment out line 121: assert(!!socket); (I think it was supposed to be assert(socket !is null); but I'm getting a weird compile error from that - still figuring that one out) This change will allow the original AssertError to propagate to the top without being hijacked by mysql-native freaking out.

  3. Run dub and receive this:

core.exception.AssertError@../../../.dub/packages/eventcore-0.8.29/eventcore/source/eventcore/drivers/posix/driver.d(243): Overwriting notification callback.
----------------
??:? _d_assert_msg [0x4cbb24ba]
??:? nothrow @nogc @safe void eventcore.drivers.posix.driver.PosixEventLoop.setNotifyCallback!(0).setNotifyCallback(eventcore.driver.Handle!("fd", ulong, -1uL).Handle, void delegate(eventcore.driver.Handle!("fd", ulong, -1uL).Handle) nothrow @safe) [0x4cb85b15]
??:? _D9eventcore7drivers5posix7sockets__T23PosixEventDriverSocketsHTCQClQCeQBz5epoll14EpollEventLoopZQCi4readMFNbNfSQEg6driver__T6HandleVAyaa12_73747265616d536f636b6574TSQGiQCc__TQByVQBua6_736f636b6574TSQHpQDj__TQDfVQDba2_6664TmVmN1ZQEaVQBjS1N1ZQEmVQDcS1S1N1ZQFaAhEQJzQFt6IOModeDFNbNfQGnEQKwQGq8IOStatusmZvZv [0x4cb73e01]
??:? _D4vibe4core3net13TCPConnection11waitForDataMFNfSQBq4time8DurationZ__T9__lambda2TDFNbNfS9eventcore6driver__T6HandleVAyaa12_73747265616d536f636b6574TSQCjQCc__TQByVQBua6_736f636b6574TSQDqQDj__TQDfVQDba2_6664TmVmN1ZQEaVQBjS1N1ZQEmVQDcS1S1N1ZQFaEQFyQFr8IOStatusmZvZQHjMFNbNfQHhZv [0x4cb679ae]
??:? _D4vibe8internal5async__T13asyncAwaitAnyVbi1SQBrQBpQBj__T8WaitableTDFNbNfS9eventcore6driver__T6HandleVAyaa12_73747265616d536f636b6574TSQCjQCc__TQByVQBua6_736f636b6574TSQDqQDj__TQDfVQDba2_6664TmVmN1ZQEaVQBjS1N1ZQEmVQDcS1S1N1ZQFaEQFyQFr8IOStatusmZvSQJl4core3net13TCPConnection11waitForDataMFNfSQBq4time8DurationZ9__lambda2SQMhQCwQCuQCtQChMFNfQBxZ9__lambda3SQNpQEeQEcQEbQDpMFNfQDfZ9__lambda4ZZQObMFNfQLjZv [0x4cb3913d]
??:? _D4vibe8internal5async__T13asyncAwaitAnyVbi1SQBrQBpQBj__T8WaitableTDFNbNfS9eventcore6driver__T6HandleVAyaa12_73747265616d536f636b6574TSQCjQCc__TQByVQBua6_736f636b6574TSQDqQDj__TQDfVQDba2_6664TmVmN1ZQEaVQBjS1N1ZQEmVQDcS1S1N1ZQFaEQFyQFr8IOStatusmZvSQJl4core3net13TCPConnection11waitForDataMFNfSQBq4time8DurationZ9__lambda2SQMhQCwQCuQCtQChMFNfQBxZ9__lambda3SQNpQEeQEcQEbQDpMFNfQDfZ9__lambda4ZZQObMFNfQEcQLmZv [0x4cb38fbd]
??:? @safe bool vibe.core.net.TCPConnection.waitForData(core.time.Duration) [0x4cb3804d]
??:? @safe bool vibe.core.net.TCPConnection.read(scope ubyte[], eventcore.driver.IOMode).__lambda3!(core.time.Duration).__lambda3(core.time.Duration) [0x4cb397b9]
??:? @safe void vibe.core.net.loopWithTimeout!(vibe.core.net.TCPConnection.read(scope ubyte[], eventcore.driver.IOMode).__lambda3, Exception).loopWithTimeout(core.time.Duration) [0x4cb3965e]
??:? @safe ulong vibe.core.net.TCPConnection.read(scope ubyte[], eventcore.driver.IOMode) [0x4cb3825a]
??:? @safe void vibe.core.net.TCPConnection.read(scope ubyte[]) [0x4cb38298]
??:? void mysql.protocol.sockets.MySQLSocketVibeD.read(ubyte[]) [0x4c985228]
??:? ubyte[] mysql.protocol.comms.getPacket(mysql.connection.Connection) [0x4c98013e]
??:? bool mysql.protocol.comms.execQueryImpl(mysql.connection.Connection, mysql.protocol.comms.ExecQueryImplInfo, out ulong) [0x4c97fdaa]
??:? mysql.result.ResultRange mysql.commands.queryImpl(mysql.commands.ColumnSpecialization[], mysql.connection.Connection, mysql.protocol.comms.ExecQueryImplInfo) [0x4c97b46a]
??:? mysql.result.ResultRange mysql.commands.query(mysql.connection.Connection, const(char[]), mysql.commands.ColumnSpecialization[]) [0x4c97b3ed]
??:? void app.WebInterface.index(vibe.http.server.HTTPServerResponse) [0x4c960492]
??:? void vibe.web.web.handleRequest!("index", app.WebInterface.index(vibe.http.server.HTTPServerResponse), app.WebInterface).handleRequest(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse, app.WebInterface, vibe.web.web.WebInterfaceSettings) [0x4c96b111]
??:? @trusted void vibe.web.web.registerWebInterface!(app.WebInterface, 5).registerWebInterface(vibe.http.router.URLRouter, app.WebInterface, vibe.web.web.WebInterfaceSettings).__lambda4(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse) [0x4c96a608]
??:? @safe bool vibe.http.router.URLRouter.handleRequest(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse).__lambda4!(ulong, immutable(char)[][]).__lambda4(ulong, scope immutable(char)[][]) [0x4ca4a4a7]
??:? const @safe bool vibe.http.router.MatchTree!(vibe.http.router.Route).MatchTree.doMatch(immutable(char)[], scope bool delegate(ulong, scope immutable(char)[][]) @safe) [0x4ca4cbd5]
??:? @safe bool vibe.http.router.MatchTree!(vibe.http.router.Route).MatchTree.match(immutable(char)[], scope bool delegate(ulong, scope immutable(char)[][]) @safe) [0x4ca4c4d7]
??:? @safe void vibe.http.router.URLRouter.handleRequest(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse) [0x4ca4a168]
??:? @safe bool vibe.http.server.handleRequest(vibe.internal.interfaceproxy.InterfaceProxy!(vibe.core.stream.Stream).InterfaceProxy, vibe.core.net.TCPConnection, vibe.http.server.HTTPServerContext, ref vibe.http.server.HTTPServerSettings, ref bool, scope stdx.allocator.IAllocator) [0x4cad024d]
??:? @trusted void vibe.http.server.handleHTTPConnection(vibe.core.net.TCPConnection, vibe.http.server.HTTPServerContext).__lambda3() [0x4cace7d0]
??:? @safe void vibe.http.server.handleHTTPConnection(vibe.core.net.TCPConnection, vibe.http.server.HTTPServerContext) [0x4cace57b]
??:? nothrow @safe void vibe.http.server.listenHTTPPlain(vibe.http.server.HTTPServerSettings, void delegate(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse) @safe).doListen(vibe.http.server.HTTPServerContext, bool, bool).__lambda4(vibe.core.net.TCPConnection) [0x4ca56771]
??:? void vibe.core.task.TaskFuncInfo.set!(void delegate(vibe.core.net.TCPConnection) @safe, vibe.core.net.TCPConnection).set(ref void delegate(vibe.core.net.TCPConnection) @safe, ref vibe.core.net.TCPConnection).callDelegate(ref vibe.core.task.TaskFuncInfo) [0x4cb69a64]
??:? void vibe.core.task.TaskFuncInfo.call() [0x4cb4b3d9]
??:? nothrow void vibe.core.task.TaskFiber.run() [0x4cb4a9e1]
??:? void core.thread.Fiber.run() [0x4cc041c3]
??:? fiber_entryPoint [0x4cc04092]
??:? [0xffffffff]
Program exited with code -6
@Abscissa
Copy link
Author

Abscissa commented Mar 8, 2018

By adding this to the test case's WebInterface.index function:

import std.stdio;
writeln("*cast(void**)&conn: ", *cast(void**)&conn);

I can see that ConnectionPool is handing out the same connection to two different tasks before the first task has completed.

@Abscissa
Copy link
Author

Abscissa commented Mar 8, 2018

Nevermind the above post, I think my diagnostic code there is in error.

In any case, the corresponding mysql-native issue has made it clear that this was indeed a mysql-native issue after all, so I'm closing this. Thanks for the help, Sonke!

@Abscissa Abscissa closed this as completed Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant