question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Port Scanning on jeromq based application (OutOfMemoryError)

See original GitHub issue

Hi Guys,

We are facing a critical issue while a port scanning application is running against our jeromq based application, version 0.3.4.

It seems like an issue in zmq.V1Decoder, it collects the traffic of the port scanning application, and then failed while initializing the Msg object due to the message size.

Please see below the exception stack trace: java.lang.OutOfMemoryError: Java heap space Exception in thread “iothread-2” java.lang.OutOfMemoryError: Java heap space at zmq.Msg.<init>(Msg.java:64) at zmq.V1Decoder.eight_byte_size_ready(V1Decoder.java:104) at zmq.V1Decoder.next(V1Decoder.java:45) at zmq.DecoderBase.process_buffer(DecoderBase.java:124) at zmq.StreamEngine.in_event(StreamEngine.java:307) at zmq.StreamEngine.plug(StreamEngine.java:240) at zmq.SessionBase.process_attach(SessionBase.java:355) at zmq.ZObject.process_command(ZObject.java:80) at zmq.IOThread.in_event(IOThread.java:90)

After investigation of the heapdump, we noticed that in eight_byte_size_ready() the msg_size is a negative big number.

byte[] tmpbuf = new byte[] { -5, 24, -1, -5, 31, -1, -5, 32 };
final long msg_size = -353251116709840096;

The comparison in the V1Decoder eight_byte_size_ready function doesn’t help as it looks like it’s not expect to have a negative number.

if (maxmsgsize >= 0)
..
 if (msg_size > Integer.MAX_VALUE) {
..

We thought that the PLAIN authentication feature in 0.4.0 may help us to solve this problem, but we don’t find any documentation or examples of how to use it in jeromq…

Can you please help ? Any comment is really appreciated!

Thanks a lot! Kobi.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kmualemcommented, Nov 6, 2018

Yes, It looks like the problem that I had is solved.

0reactions
trevorbernardcommented, Nov 6, 2018

Awesome

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chapter 5 - Advanced Pub-Sub Patterns - ZeroMQ Guide
The answer is yes, if we make a proxy that sits between the publisher and subscribers; an analog for the PGM switch, but...
Read more >
Port Scanning With Java - Baeldung
In this tutorial, we'll explain how to develop a simple application for port scanning with Java that we can use to scan a...
Read more >
The ZeroMQ Guide - for Python Developers
Getting an Official Port Number . ... We'll use port 5556 for this application: ... Configuring sockets by setting options on them and...
Read more >
ØMQ - The Guide - WikiLeaks
We'll use port 5556 for this application: ... Configuring sockets by setting options on them and checking them if necessary (see ...
Read more >
Log4j – Changes - Apache Logging Services
Log4j 1.2 bridge for Syslog Appender defaults to port 512 instead of 514. ... Allow Spring Boot application properties to be accessed in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found