hyperboria / bugs

Peer-to-peer IPv6 networking, secure and near-zero-conf.
154 stars 17 forks source link

triggering assertion failures via admin port #23

Closed ansuz closed 9 years ago

ansuz commented 9 years ago

I started playing around with the admin interface, which I haven't done in a while, and I found I could trigger crashes by calling certain functions.

[ansuz@blackbox tools]$ ./cexec "RouterModule_getPeers('0000.0000.0000.0001',10000,'0000.0000.0000.0001')"
/home/ansuz/code/cjdns/tools/cexec:35
        if (err) { throw err; }
                         ^
Error: timeout after 10000ms
    at null._onTimeout (/home/ansuz/code/cjdns/contrib/nodejs/cjdnsadmin/cjdnsadmin.js:27:18)
    at Timer.listOnTimeout (timers.js:110:15)

In addition to the timeout error, I get this assertion failure.

Assertion failure [RouterModule.c:557] [(addr->path != 1)]

I'm going to keep on looking into this, and try out the other functions in RouterModule, but maybe other people can look into it as well.

ansuz commented 9 years ago

Follow-up: I'm not quite running the latest crashey, but it's fairly recent. The line in question is not in master, but can still be found in the latest crashey.

I'm not sure why we shouldn't be pinging ourselves, but it seems like a fairly minor thing to crash over. This might be for debugging purposes, making cjdns fragile enough that we notice when it does something odd, but it seems like this kind of thing should be handled more gracefully.

I stumbled across it while starting to trying to recurse across the network graph. In any case, if this is going to stay, it should be well documented.

cjdelisle commented 9 years ago

ok to drop it, at one point it caused a crypto fuckup but ping-self was reworked to be handled as a special case as I recall

ansuz commented 9 years ago

played it safe and commented it out, PR sent.