Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Crash in _createFLAP #4

DarkSilence opened this Issue · 7 comments

3 participants



I have using node-oscar for few days, ands sometimes it crashes in _createFLAP function here:

var seqNum = conn.seqNum = (conn.seqNum === 0x7FFF ? 0 : conn.seqNum + 1);

Crash reason — conn is undefined, but I have no closing, or some other events, from connection... this is weird. May be you can help with this issue?

Also I fix a few bugs, and implement authRequest and authReply and change encoding to UNICODE. Here is my diff: DarkSilence/node-oscar@f78cb89


Hmmm... does the backtrace say which function called _createFLAP and at what line?


I have the same problem.
Everything can work properly for a several minutes or hours, then all connections disappear from _state.connections, but I see, that node is online. It crashes when trying to send message or keep alive.

  var seqNum = conn.seqNum = (conn.seqNum === 0x7FFF ? 0 : conn.seqNum + 1);
TypeError: Cannot read property 'seqNum' of undefined
    at OscarConnection._createFLAP (/home/unk/node/node_modules/oscar/oscar.js:3000:35)
    at OscarConnection.sendIM (/home/unk/node/node_modules/oscar/oscar.js:223:19)
    at OscarConnection.<anonymous> (/home/unk/node/test.js:23:10)
    at OscarConnection.emit (events.js:72:17)
    at OscarConnection._parseSNAC (/home/unk/node/node_modules/oscar/oscar.js:1781:18)
    at Socket.data_handler (/home/unk/node/node_modules/oscar/oscar.js:799:14)
    at Socket.<anonymous> (/home/unk/node/node_modules/oscar/oscar.js:915:72)
    at Socket.emit (events.js:64:17)
    at Socket._onReadable (net.js:678:14)
    at IOWatcher.onReadable [as callback] (net.js:177:10)```

Yep, I have same error on SendIM.

I wrote event function on im receive, and send message to user from this function, and sometimes my script crashes in SendIM :(


As a fast temporary fix you can check the availability of icq._state.connections.main and re-create icq object if it disappeared. Do not forget to remove old event handlers and bind new ones.
I am still looking for solution.




It'll be several days before I'll have a chance to look more thoroughly at this, but what I think might be happening is one of the server connections (main or otherwise) is getting severed and the end/close event handler is incorrectly resetting the entire internal state.

If this is the case and application-level keepalive packets were being sent like they need to/should be (still haven't gotten to that yet), then this problem shouldn't occur (unless of course the connection is otherwise severed unexpectedly). Nonetheless, the entire internal state should not be reset unless the main connection is severed, so this is a bug.


You completely right. Bart connection closes by server with tcp RST after about 15 minutes regardless of OS or app-level keep alives. Now I've disabled BART and CHAT_NAV connections, looks like everything became fine.

@mscdex mscdex closed this in 2af0833
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.