Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Buffer GC issue with Nodejs 4.2 #458

Closed
beitler opened this issue Oct 13, 2015 · 1 comment
Closed

Buffer GC issue with Nodejs 4.2 #458

beitler opened this issue Oct 13, 2015 · 1 comment

Comments

@beitler
Copy link

beitler commented Oct 13, 2015

Description

A simple subscriber (example code see below) fails after some successful receives with the following error:

node: ../src/node_buffer.cc:151: void node::Buffer::CallbackInfo::WeakCallback(v8::Isolate*, v8::Local<v8::Object>): Assertion `(object)->IsUint8Array()' failed.

This behavior is new in nodejs Version 4.2 while in Version 4.1.2 the same code worked perfectly.

Reproduction

Environment:

$ cat /etc/issue
Ubuntu 14.04.3 LTS \n \l
$ node -v
v4.2.0
$ dpkg -l | grep libzmq
ii  libzmq3:amd64       4.0.5-1chl1~trusty1    amd64   lightweight messaging kernel (shared library)
ii  libzmq3-dev:amd64   4.0.5-1chl1~trusty1    amd64   lightweight messaging kernel (development files)

Example Code:

#!/usr/bin/env node

"use strict";
const
  zmq = require('zmq'),
  subscriber = zmq.socket('sub'),
  publisher = zmq.socket('pub');


// Publisher
setInterval(function() {
  publisher.send(JSON.stringify({msg:"Hello World."}));
}, 50);

publisher.bind('tcp://*:8000');

// Subscriber
subscriber.subscribe('');

subscriber.on('message', function(data) {
  console.log(data.toString())
});

subscriber.connect('tcp://localhost:8000');
@beitler beitler changed the title Buffer issue with Nodejs 4.2 Buffer GC issue with Nodejs 4.2 Oct 13, 2015
@kkoopa
Copy link
Contributor

kkoopa commented Oct 13, 2015

nodejs/node#3329

@beitler beitler closed this as completed Oct 13, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants