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

Crash in zmq::IncomingMsg::IntoBuffer #433

Open
jolting opened this issue Jan 2, 2021 · 0 comments
Open

Crash in zmq::IncomingMsg::IntoBuffer #433

jolting opened this issue Jan 2, 2021 · 0 comments
Labels

Comments

@jolting
Copy link

jolting commented Jan 2, 2021

Relates to:
nodejs/node#32463

* V8_Fatal(char const*, ...)
* v8::internal::GlobalBackingStoreRegistry::Register(std::shared_ptr<v8::internal::BackingStore>)
* v8::ArrayBuffer::GetBackingStore()
* napi_get_typedarray_info
* Napi::TypedArrayOf<unsigned char>::TypedArrayOf(napi_env__*, napi_value__*)
* Napi::Buffer<unsigned char>::Buffer(napi_env__*, napi_value__*, unsigned long, unsigned char*)
* zmq::IncomingMsg::IntoBuffer(Napi::Env const&) 
* zmq::Socket::Receive(Napi::CallbackInfo const&) 

Describe the bug
Crash in zmq::IncomingMsg::IntoBuffer(Napi::Env const&) when using zero-copy. The address of the buffer used by a zmq_msg_t buffer is not unique, which appears to be incompatible with the way the new v8 BackingStore api.. The underlying zmq_msg_t uses reference counting to implement shallow copying behavior and it may return the same address for multiple messages

Reproducing
I tried to run the unit tests and I ran into this issue. It seemed to fail when it hit "should release buffers" failed in "socket-send-receive-test.ts"

Expected behavior
No crash.

Tested on

  • OS: Ubuntu 20.04
  • Node version: v14.15.3
  • ZeroMQ.js version: e2821f0
@jolting jolting added the bug label Jan 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant