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

Buffer GC issue with Nodejs 4.2 #458

@beitler

Description

@beitler

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');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions